@smartico/public-api 0.0.158 → 0.0.160
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/.prettierrc +10 -10
- package/dist/Bonuses/Bonus.d.ts +20 -0
- package/dist/Bonuses/BonusMetaMap.d.ts +3 -0
- package/dist/Bonuses/BonusStatus.d.ts +8 -0
- package/dist/Bonuses/BonusTemplateMetaMap.d.ts +5 -0
- package/dist/Bonuses/ClaimBonusRequest.d.ts +4 -0
- package/dist/Bonuses/ClaimBonusResponse.d.ts +4 -0
- package/dist/Bonuses/GetBonusesRequest.d.ts +3 -0
- package/dist/Bonuses/GetBonusesResponse.d.ts +5 -0
- package/dist/Bonuses/index.d.ts +7 -0
- package/dist/SmarticoAPI.d.ts +5 -1
- package/dist/SmarticoLib/index.d.ts +58 -2
- package/dist/WSAPI/WSAPI.d.ts +18 -3
- package/dist/WSAPI/WSAPITypes.d.ts +32 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +254 -147
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +72 -2
- package/dist/index.modern.mjs.map +1 -1
- package/docs/README.md +2 -0
- package/docs/classes/WSAPI.md +109 -72
- package/docs/interfaces/TBonus.md +65 -0
- package/docs/interfaces/TClaimBonusResult.md +27 -0
- package/docs/interfaces/TInboxMessageBody.md +2 -2
- package/docs/interfaces/TLevel.md +2 -2
- package/docs/interfaces/TMissionOrBadgeTask.md +1 -10
- package/docs/interfaces/TTournament.md +1 -1
- package/docs/interfaces/TTournamentDetailed.md +2 -2
- package/docs/interfaces/TUserProfile.md +2 -2
- package/package.json +41 -41
- package/src/Base/AchRelatedGame.ts +10 -10
- package/src/Base/ProtocolMessage.ts +4 -4
- package/src/Base/ProtocolRequest.ts +4 -4
- package/src/Base/ProtocolResponse.ts +3 -3
- package/src/Bonuses/Bonus.ts +40 -0
- package/src/Bonuses/BonusMetaMap.ts +3 -0
- package/src/Bonuses/BonusStatus.ts +8 -0
- package/src/Bonuses/BonusTemplateMetaMap.ts +6 -0
- package/src/Bonuses/ClaimBonusRequest.ts +5 -0
- package/src/Bonuses/ClaimBonusResponse.ts +5 -0
- package/src/Bonuses/GetBonusesRequest.ts +3 -0
- package/src/Bonuses/GetBonusesResponse.ts +6 -0
- package/src/Bonuses/index.ts +7 -0
- package/src/CookieStore.ts +6 -6
- package/src/Core/CheckSegmentMatchRequest.ts +2 -2
- package/src/Core/CheckSegmentMatchResponse.ts +4 -4
- package/src/Core/CoreUtils.ts +12 -7
- package/src/Core/GetAchievementsUserInfoRequest.ts +1 -1
- package/src/Core/GetAchievementsUserInfoResponse.ts +3 -3
- package/src/Core/GetLabelInfoRequest.ts +1 -1
- package/src/Core/GetLabelInfoResponse.ts +3 -3
- package/src/Core/GetTranslationsRequest.ts +5 -5
- package/src/Core/GetTranslationsResponse.ts +3 -3
- package/src/Core/PublicProperties.ts +7 -7
- package/src/Core/ResponseIdentify.ts +10 -10
- package/src/Core/TranslationArea.ts +1 -1
- package/src/Core/index.ts +9 -9
- package/src/CustomSections/GetCustomSectionsRequest.ts +1 -1
- package/src/CustomSections/GetCustomSectionsResponse.ts +3 -3
- package/src/CustomSections/UICustomSection.ts +21 -16
- package/src/CustomSections/index.ts +4 -4
- package/src/ErrorCodes.ts +2 -2
- package/src/GResponse.ts +5 -5
- package/src/ILogger.ts +5 -5
- package/src/Inbox/GetInboxMessagesRequest.ts +4 -4
- package/src/Inbox/GetInboxMessagesResponse.ts +8 -8
- package/src/Inbox/InboxMessage.ts +20 -20
- package/src/Inbox/MarkInboxMessageDeletedRequest.ts +3 -3
- package/src/Inbox/MarkInboxMessageDeletedResponse.ts +3 -3
- package/src/Inbox/MarkInboxMessageReadRequest.ts +3 -3
- package/src/Inbox/MarkInboxMessageReadResponse.ts +3 -3
- package/src/Inbox/MarkInboxMessageStarredRequest.ts +3 -3
- package/src/Inbox/MarkInboxMessageStarredResponse.ts +3 -3
- package/src/Inbox/index.ts +10 -10
- package/src/IntUtils.ts +36 -28
- package/src/Jackpots/GetJackpotsPotsRequest.ts +2 -2
- package/src/Jackpots/GetJackpotsPotsResponse.ts +3 -3
- package/src/Jackpots/GetJackpotsRequest.ts +3 -3
- package/src/Jackpots/GetJackpotsResponse.ts +4 -4
- package/src/Jackpots/JackPotWinner.ts +6 -6
- package/src/Jackpots/JackpotContributionType.ts +1 -1
- package/src/Jackpots/JackpotDetails.ts +18 -18
- package/src/Jackpots/JackpotHtmlTemplate.ts +3 -3
- package/src/Jackpots/JackpotPot.ts +6 -6
- package/src/Jackpots/JackpotPublicMeta.ts +9 -9
- package/src/Jackpots/JackpotType.ts +1 -1
- package/src/Jackpots/JackpotWinPush.ts +5 -5
- package/src/Jackpots/JackpotsOptinRequest.ts +2 -2
- package/src/Jackpots/JackpotsOptinResponse.ts +1 -1
- package/src/Jackpots/JackpotsOptoutRequest.ts +2 -2
- package/src/Jackpots/JackpotsOptoutResponse.ts +1 -1
- package/src/Jackpots/index.ts +16 -16
- package/src/Leaderboard/GetLeaderBoardsRequest.ts +5 -5
- package/src/Leaderboard/GetLeaderBoardsResponse.ts +3 -3
- package/src/Leaderboard/LeaderBoardDetails.ts +11 -11
- package/src/Leaderboard/LeaderBoardPosition.ts +8 -8
- package/src/Leaderboard/LeaderBoardPublicMeta.ts +3 -3
- package/src/Leaderboard/LeaderBoards.ts +16 -16
- package/src/Leaderboard/index.ts +6 -6
- package/src/Level/GetLevelMapResponse.ts +7 -7
- package/src/Level/Level.ts +9 -9
- package/src/Level/LevelPublicMeta.ts +10 -10
- package/src/Level/index.ts +3 -3
- package/src/MiniGames/SAWAcknowledgeSpinPushRequest.ts +3 -3
- package/src/MiniGames/SAWBuyInType.ts +2 -2
- package/src/MiniGames/SAWDoAknowledgeRequest.ts +2 -2
- package/src/MiniGames/SAWDoAknowledgeResponse.ts +2 -2
- package/src/MiniGames/SAWDoSpinRequest.ts +3 -3
- package/src/MiniGames/SAWDoSpinResponse.ts +9 -9
- package/src/MiniGames/SAWEventSawPush.ts +3 -3
- package/src/MiniGames/SAWGameType.ts +2 -2
- package/src/MiniGames/SAWGetTemplatesRequest.ts +3 -3
- package/src/MiniGames/SAWGetTemplatesResponse.ts +18 -16
- package/src/MiniGames/SAWPrize.ts +11 -11
- package/src/MiniGames/SAWPrizeDropAknowledgeRequest.ts +4 -4
- package/src/MiniGames/SAWPrizeDropAknowledgeResponse.ts +2 -2
- package/src/MiniGames/SAWPrizeDropWinPush.ts +8 -8
- package/src/MiniGames/SAWPrizeType.ts +2 -2
- package/src/MiniGames/SAWPrizeUI.ts +16 -16
- package/src/MiniGames/SAWSpinsCountPush.ts +3 -3
- package/src/MiniGames/SAWTemplate.ts +26 -26
- package/src/MiniGames/SAWTemplateUI.ts +42 -42
- package/src/MiniGames/SAWUtils.ts +10 -10
- package/src/MiniGames/SAWWinSoundType.ts +1 -1
- package/src/MiniGames/index.ts +24 -24
- package/src/Missions/AchCategoryPublicMeta.ts +2 -2
- package/src/Missions/AchClaimPrizeRequest.ts +3 -3
- package/src/Missions/AchClaimPrizeResponse.ts +1 -1
- package/src/Missions/AchievementCategory.ts +8 -8
- package/src/Missions/AchievementOptinRequest.ts +2 -2
- package/src/Missions/AchievementOptinResponse.ts +1 -1
- package/src/Missions/AchievementPublicMeta.ts +19 -19
- package/src/Missions/AchievementTaskPublicMeta.ts +2 -2
- package/src/Missions/GetAchCategoriesRequest.ts +1 -1
- package/src/Missions/GetAchCategoriesResponse.ts +3 -3
- package/src/Missions/GetAchievementMapRequest.ts +1 -1
- package/src/Missions/GetAchievementMapResponse.ts +3 -3
- package/src/Missions/GetRelatedAchTourRequest.ts +2 -2
- package/src/Missions/GetRelatedAchTourResponse.ts +5 -5
- package/src/Missions/ReloadAchievementsEvent.ts +3 -3
- package/src/Missions/UserAchievement.ts +48 -46
- package/src/Missions/UserAchievementTask.ts +13 -13
- package/src/Missions/index.ts +19 -19
- package/src/NodeCache.ts +12 -12
- package/src/OCache.ts +22 -22
- package/src/Quiz/MarketsAnswers.ts +9 -9
- package/src/Quiz/MarketsInfo.ts +62 -23
- package/src/Quiz/MarketsPerSport.ts +11 -4
- package/src/Quiz/ScoreResultTypes.ts +22 -22
- package/src/Quiz/SportTypes.ts +1 -1
- package/src/Quiz/index.ts +6 -6
- package/src/SmarticoAPI.ts +556 -303
- package/src/SmarticoLib/index.ts +956 -840
- package/src/Store/BuyStoreItemRequest.ts +2 -2
- package/src/Store/BuyStoreItemResponse.ts +2 -2
- package/src/Store/GetCategoriesStoreResponse.ts +3 -3
- package/src/Store/GetStoreHistoryRequest.ts +3 -3
- package/src/Store/GetStoreHistoryResponse.ts +4 -4
- package/src/Store/GetStoreItemsResponse.ts +3 -3
- package/src/Store/StoreCategory.ts +8 -8
- package/src/Store/StoreCategoryPublicMeta.ts +2 -2
- package/src/Store/StoreItem.ts +13 -13
- package/src/Store/StoreItemPublicMeta.ts +10 -10
- package/src/Store/StoreItemPurchased.ts +17 -17
- package/src/Store/StoreItemType.ts +2 -2
- package/src/Store/index.ts +13 -13
- package/src/Tournaments/GetTournamentInfoRequest.ts +2 -2
- package/src/Tournaments/GetTournamentInfoResponse.ts +18 -18
- package/src/Tournaments/GetTournamentsRequest.ts +1 -1
- package/src/Tournaments/GetTournamentsResponse.ts +6 -6
- package/src/Tournaments/Tournament.ts +43 -39
- package/src/Tournaments/TournamentInstanceStatus.ts +2 -2
- package/src/Tournaments/TournamentPlayer.ts +7 -7
- package/src/Tournaments/TournamentPrize.ts +8 -8
- package/src/Tournaments/TournamentPublicMeta.ts +16 -16
- package/src/Tournaments/TournamentRegisterRequest.ts +2 -2
- package/src/Tournaments/TournamentRegisterResponse.ts +3 -3
- package/src/Tournaments/TournamentRegistrationStatus.ts +6 -4
- package/src/Tournaments/TournamentRegistrationType.ts +9 -3
- package/src/Tournaments/TournamentUtils.ts +44 -38
- package/src/Tournaments/index.ts +16 -16
- package/src/WSAPI/WSAPI.ts +244 -132
- package/src/WSAPI/WSAPITypes.ts +287 -250
- package/src/index.ts +16 -15
- package/tsconfig.json +41 -43
|
@@ -59,7 +59,7 @@ ___
|
|
|
59
59
|
|
|
60
60
|
• **required\_level\_counter\_1**: `number`
|
|
61
61
|
|
|
62
|
-
The counter of 1st metric used to reach the Level.
|
|
62
|
+
The counter of 1st metric used to reach the Level.
|
|
63
63
|
Relevant in case of using advanced leveling logic
|
|
64
64
|
https://help.smartico.ai/welcome/more/release-notes/september-2022#new-logic-for-leveling-users
|
|
65
65
|
|
|
@@ -69,7 +69,7 @@ ___
|
|
|
69
69
|
|
|
70
70
|
• **required\_level\_counter\_2**: `number`
|
|
71
71
|
|
|
72
|
-
The counter of 2nd metric used to reach the Level.
|
|
72
|
+
The counter of 2nd metric used to reach the Level.
|
|
73
73
|
Relevant in case of using advanced leveling logic
|
|
74
74
|
https://help.smartico.ai/welcome/more/release-notes/september-2022#new-logic-for-leveling-users
|
|
75
75
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Interface: TMissionOrBadgeTask
|
|
2
2
|
|
|
3
|
-
TMissionOrBadgeTask describes the information of tasks that
|
|
3
|
+
TMissionOrBadgeTask describes the information of tasks that belings to mission or badge. See also TMissionOrBadge
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
@@ -57,12 +57,3 @@ ___
|
|
|
57
57
|
• `Optional` **execution\_count\_actual**: `number`
|
|
58
58
|
|
|
59
59
|
This is the number of times the user has executed 'activity' of the task. e.g. he bet 5 times out of 100. Here will be 5
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
___
|
|
63
|
-
|
|
64
|
-
### display\_progress\_as\_count
|
|
65
|
-
|
|
66
|
-
• `Optional` **display\_progress\_as\_count**: `boolean`
|
|
67
|
-
|
|
68
|
-
If enabled, mission progress will show as a count (35/100) instead of a %. For missions with multiple tasks, each task will display progress as a count, while the overall progress bar will still show a %.
|
|
@@ -140,7 +140,7 @@ ___
|
|
|
140
140
|
|
|
141
141
|
### prizes
|
|
142
142
|
|
|
143
|
-
• `Optional` **prizes**: { `name`: `string` ; `description`: `string` ; `image_url`: `string` ; `place_from`: `number` ; `place_to`: `number` ; `type`: `string` ; `points?`: `number` }[]
|
|
143
|
+
• `Optional` **prizes**: \{ `name`: `string` ; `description`: `string` ; `image_url`: `string` ; `place_from`: `number` ; `place_to`: `number` ; `type`: `string` ; `points?`: `number` }[]
|
|
144
144
|
|
|
145
145
|
Prize structure
|
|
146
146
|
|
|
@@ -383,7 +383,7 @@ ___
|
|
|
383
383
|
|
|
384
384
|
### players
|
|
385
385
|
|
|
386
|
-
• `Optional` **players**: { `public_username`: `string` ; `avatar_url`: `string` ; `position`: `number` ; `scores`: `number` ; `is_me`: `boolean` }[]
|
|
386
|
+
• `Optional` **players**: \{ `public_username`: `string` ; `avatar_url`: `string` ; `position`: `number` ; `scores`: `number` ; `is_me`: `boolean` }[]
|
|
387
387
|
|
|
388
388
|
The list of the tournament participants
|
|
389
389
|
|
|
@@ -412,7 +412,7 @@ ___
|
|
|
412
412
|
|
|
413
413
|
### prizes
|
|
414
414
|
|
|
415
|
-
• `Optional` **prizes**: { `name`: `string` ; `description`: `string` ; `image_url`: `string` ; `place_from`: `number` ; `place_to`: `number` ; `type`: `string` ; `points?`: `number` }[]
|
|
415
|
+
• `Optional` **prizes**: \{ `name`: `string` ; `description`: `string` ; `image_url`: `string` ; `place_from`: `number` ; `place_to`: `number` ; `type`: `string` ; `points?`: `number` }[]
|
|
416
416
|
|
|
417
417
|
Prize structure
|
|
418
418
|
|
|
@@ -35,8 +35,8 @@ ___
|
|
|
35
35
|
|
|
36
36
|
• **core\_public\_tags**: `string`[]
|
|
37
37
|
|
|
38
|
-
The array of the public tags set on the user object.
|
|
39
|
-
They can be treated as server-based cookies.
|
|
38
|
+
The array of the public tags set on the user object.
|
|
39
|
+
They can be treated as server-based cookies.
|
|
40
40
|
You can set tags using following method _smartico.event('core_public_tags_update', { core_public_tags: ['A', 'B'] } );
|
|
41
41
|
And then you can check for the tags
|
|
42
42
|
|
package/package.json
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
2
|
+
"name": "@smartico/public-api",
|
|
3
|
+
"version": "0.0.160",
|
|
4
|
+
"description": "Smartico public API",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"module": "dist/index.modern.mjs",
|
|
8
|
+
"source": "src/index.ts",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "microbundle --no-compress --format modern,cjs",
|
|
11
|
+
"start": "microbundle watch --no-compress --format modern,cjs",
|
|
12
|
+
"link": "npm link",
|
|
13
|
+
"dev": "npm-run-all link start",
|
|
14
|
+
"unlink": "npm unlink",
|
|
15
|
+
"git-push": "git push --follow-tags",
|
|
16
|
+
"pub": "npm publish",
|
|
17
|
+
"patch": "npm version patch",
|
|
18
|
+
".sm-commit": "git add -A && git commit -m 'Pre-publish commit'",
|
|
19
|
+
".sm-deploy": "npm-run-all build patch pub git-push",
|
|
20
|
+
"bump": "npm-run-all bump-r-server bump-r-client bump-tracker bump-ach bump-bo-server bump-bo-client",
|
|
21
|
+
"bump-r-server": "cd ../r-games/r-server && npm install @smartico/public-api@latest",
|
|
22
|
+
"bump-r-client": "cd ../r-games/r-client && npm install @smartico/public-api@latest",
|
|
23
|
+
"bump-tracker": "cd ../tracker && npm install @smartico/public-api@latest --legacy-peer-deps",
|
|
24
|
+
"bump-ach": "cd ../tracker/ach && npm install @smartico/public-api@latest --legacy-peer-deps",
|
|
25
|
+
"bump-bo-server": "cd ../bo_server/server && source ~/.nvm/nvm.sh && nvm use v13.13.0 && npm install @smartico/public-api@latest",
|
|
26
|
+
"bump-bo-client": "cd ../bo_server/client && source ~/.nvm/nvm.sh && nvm use v13.13.0 && npm install @smartico/public-api@latest",
|
|
27
|
+
"doc": "typedoc"
|
|
28
|
+
},
|
|
29
|
+
"author": "",
|
|
30
|
+
"license": "ISC",
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"md5-typescript": "^1.0.5",
|
|
33
|
+
"typescript-map": "^0.1.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@types/node-fetch": "^2.6.2",
|
|
37
|
+
"microbundle": "0.15.0",
|
|
38
|
+
"npm-run-all": "4.1.5",
|
|
39
|
+
"typedoc": "^0.24.8",
|
|
40
|
+
"typedoc-plugin-markdown": "^3.15.4",
|
|
41
|
+
"typedoc-plugin-merge-modules": "^5.0.1"
|
|
42
|
+
}
|
|
43
43
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
interface AchRelatedGame {
|
|
2
2
|
/* ID of the game on Smartico side */
|
|
3
|
-
ach_game_id: number
|
|
3
|
+
ach_game_id: number;
|
|
4
4
|
/* ID of the game on operator side */
|
|
5
|
-
ext_game_id: string
|
|
5
|
+
ext_game_id: string;
|
|
6
6
|
game_public_meta: {
|
|
7
|
-
name: string
|
|
8
|
-
link: string
|
|
9
|
-
image: string
|
|
10
|
-
enabled: boolean
|
|
11
|
-
game_categories?: string[]
|
|
12
|
-
game_provider?: string
|
|
13
|
-
}
|
|
7
|
+
name: string;
|
|
8
|
+
link: string;
|
|
9
|
+
image: string;
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
game_categories?: string[];
|
|
12
|
+
game_provider?: string;
|
|
13
|
+
};
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export { AchRelatedGame }
|
|
16
|
+
export { AchRelatedGame };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ClassId } from './ClassId'
|
|
1
|
+
import { ClassId } from './ClassId';
|
|
2
2
|
|
|
3
3
|
export interface ProtocolMessage {
|
|
4
|
-
cid: number // can be ClassId when we move all ClassIds from ach to use @smartico
|
|
5
|
-
ts?: number
|
|
6
|
-
uuid?: string
|
|
4
|
+
cid: number; // can be ClassId when we move all ClassIds from ach to use @smartico
|
|
5
|
+
ts?: number;
|
|
6
|
+
uuid?: string;
|
|
7
7
|
|
|
8
8
|
// eventType?: string;
|
|
9
9
|
// payload?: any;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ProtocolMessage } from './ProtocolMessage'
|
|
1
|
+
import { ProtocolMessage } from './ProtocolMessage';
|
|
2
2
|
|
|
3
3
|
export interface ProtocolRequest extends ProtocolMessage {
|
|
4
|
-
api_key: string
|
|
5
|
-
brand_key: string
|
|
6
|
-
ext_user_id: string
|
|
4
|
+
api_key: string;
|
|
5
|
+
brand_key: string;
|
|
6
|
+
ext_user_id: string;
|
|
7
7
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { BonusStatus } from './BonusStatus';
|
|
2
|
+
import { BonusTemplateMetaMap } from './BonusTemplateMetaMap';
|
|
3
|
+
import { BonusMetaMap } from './BonusMetaMap';
|
|
4
|
+
import { TBonus } from '../WSAPI/WSAPITypes';
|
|
5
|
+
|
|
6
|
+
export interface Bonus {
|
|
7
|
+
id: number;
|
|
8
|
+
redeemable?: boolean;
|
|
9
|
+
createDate?: string;
|
|
10
|
+
updateDate?: string;
|
|
11
|
+
redeemDate?: string;
|
|
12
|
+
engagementUid?: string;
|
|
13
|
+
labelBonusTemplateId?: number;
|
|
14
|
+
sourceProductRefId?: number;
|
|
15
|
+
sourceProductId?: number;
|
|
16
|
+
userId?: number;
|
|
17
|
+
bonusStatusId?: BonusStatus;
|
|
18
|
+
labelBonusTemplateMetaMap?: BonusTemplateMetaMap;
|
|
19
|
+
bonusMetaMap?: BonusMetaMap;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const BonusItemsTransform = (items: Bonus[]): TBonus[] => {
|
|
23
|
+
return items
|
|
24
|
+
.filter((r) => r.id >= 1)
|
|
25
|
+
.map((r) => {
|
|
26
|
+
const x: TBonus = {
|
|
27
|
+
|
|
28
|
+
bonus_id: r.id,
|
|
29
|
+
is_redeemable: r.redeemable,
|
|
30
|
+
create_date: r.createDate,
|
|
31
|
+
redeem_date: r.redeemDate,
|
|
32
|
+
label_bonus_template_id: r.labelBonusTemplateId,
|
|
33
|
+
bonus_status_id: r.bonusStatusId,
|
|
34
|
+
label_bonus_template_meta_map: r.labelBonusTemplateMetaMap,
|
|
35
|
+
bonus_meta_map: r.bonusMetaMap
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return x;
|
|
39
|
+
});
|
|
40
|
+
};
|
package/src/CookieStore.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { TSMap } from 'typescript-map'
|
|
1
|
+
import { TSMap } from 'typescript-map';
|
|
2
2
|
|
|
3
3
|
class CookieStore {
|
|
4
|
-
private static cookieStore = new TSMap<string, string[]>()
|
|
4
|
+
private static cookieStore = new TSMap<string, string[]>();
|
|
5
5
|
|
|
6
6
|
public static get(key: string): string[] | undefined {
|
|
7
|
-
return CookieStore.cookieStore.get(key)
|
|
7
|
+
return CookieStore.cookieStore.get(key);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
public static set(key: string, value: string[]) {
|
|
11
|
-
const v = value.map((v) => v.split(';')[0])
|
|
12
|
-
CookieStore.cookieStore.set(key, v)
|
|
11
|
+
const v = value.map((v) => v.split(';')[0]);
|
|
12
|
+
CookieStore.cookieStore.set(key, v);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export { CookieStore }
|
|
16
|
+
export { CookieStore };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ProtocolResponse } from '../Base/ProtocolResponse'
|
|
1
|
+
import { ProtocolResponse } from '../Base/ProtocolResponse';
|
|
2
2
|
|
|
3
3
|
export interface CheckSegmentMatchResponse extends ProtocolResponse {
|
|
4
4
|
segments: {
|
|
5
|
-
segment_id: number
|
|
6
|
-
is_matching: boolean
|
|
7
|
-
}[]
|
|
5
|
+
segment_id: number;
|
|
6
|
+
is_matching: boolean;
|
|
7
|
+
}[];
|
|
8
8
|
}
|
package/src/Core/CoreUtils.ts
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
class CoreUtils {
|
|
2
2
|
public static avatarUrl = (avatar_id: string, avatarDomain: string): string => {
|
|
3
|
-
if (
|
|
3
|
+
if (
|
|
4
|
+
avatarDomain &&
|
|
5
|
+
avatar_id !== null &&
|
|
6
|
+
avatar_id !== undefined &&
|
|
7
|
+
!(avatar_id.startsWith && avatar_id.startsWith('http'))
|
|
8
|
+
) {
|
|
4
9
|
if (avatarDomain.endsWith('/')) {
|
|
5
|
-
return avatarDomain.slice(0, -1) + '/avatar/' + avatar_id
|
|
10
|
+
return avatarDomain.slice(0, -1) + '/avatar/' + avatar_id;
|
|
6
11
|
} else {
|
|
7
|
-
return avatarDomain + '/avatar/' + avatar_id
|
|
12
|
+
return avatarDomain + '/avatar/' + avatar_id;
|
|
8
13
|
}
|
|
9
14
|
} else {
|
|
10
|
-
return avatar_id
|
|
15
|
+
return avatar_id;
|
|
11
16
|
}
|
|
12
|
-
}
|
|
17
|
+
};
|
|
13
18
|
|
|
14
19
|
public static currencySymbol(currency: string) {
|
|
15
20
|
return {
|
|
@@ -34,8 +39,8 @@ class CoreUtils {
|
|
|
34
39
|
RUB: '\u20BD', // Russian Ruble
|
|
35
40
|
BRL: 'R$', // Brazilian Real
|
|
36
41
|
ZAR: 'R', // South African Rand
|
|
37
|
-
}[currency?.toUpperCase()]
|
|
42
|
+
}[currency?.toUpperCase()];
|
|
38
43
|
}
|
|
39
44
|
}
|
|
40
45
|
|
|
41
|
-
export { CoreUtils }
|
|
46
|
+
export { CoreUtils };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ProtocolResponse } from '../Base/ProtocolResponse'
|
|
1
|
+
import { ProtocolResponse } from '../Base/ProtocolResponse';
|
|
2
2
|
|
|
3
3
|
export interface GetAchievementsUserInfoResponse extends ProtocolResponse {
|
|
4
|
-
level_counter_1?: number
|
|
5
|
-
level_counter_2?: number
|
|
4
|
+
level_counter_1?: number;
|
|
5
|
+
level_counter_2?: number;
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ProtocolResponse } from '../Base/ProtocolResponse'
|
|
1
|
+
import { ProtocolResponse } from '../Base/ProtocolResponse';
|
|
2
2
|
|
|
3
3
|
export interface GetLabelInfoResponse extends ProtocolResponse {
|
|
4
|
-
settings: { [key: string]: string }
|
|
5
|
-
label_id: string
|
|
4
|
+
settings: { [key: string]: string };
|
|
5
|
+
label_id: string;
|
|
6
6
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ProtocolRequest } from '../Base/ProtocolRequest'
|
|
2
|
-
import { TranslationArea } from './TranslationArea'
|
|
1
|
+
import { ProtocolRequest } from '../Base/ProtocolRequest';
|
|
2
|
+
import { TranslationArea } from './TranslationArea';
|
|
3
3
|
|
|
4
4
|
export interface GetTranslationsRequest extends ProtocolRequest {
|
|
5
|
-
hash_code: number
|
|
6
|
-
areas: TranslationArea[]
|
|
7
|
-
lang_code: string
|
|
5
|
+
hash_code: number;
|
|
6
|
+
areas: TranslationArea[];
|
|
7
|
+
lang_code: string;
|
|
8
8
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ProtocolResponse } from '../Base/ProtocolResponse'
|
|
1
|
+
import { ProtocolResponse } from '../Base/ProtocolResponse';
|
|
2
2
|
|
|
3
3
|
export interface GetTranslationsResponse extends ProtocolResponse {
|
|
4
|
-
hash_code: number
|
|
5
|
-
translations: { [key: string]: string }
|
|
4
|
+
hash_code: number;
|
|
5
|
+
translations: { [key: string]: string };
|
|
6
6
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export interface PublicProperties {
|
|
2
|
-
core_user_language?: string
|
|
3
|
-
ach_points_balance?: number
|
|
4
|
-
ach_points_ever?: number
|
|
5
|
-
ach_level_current_id?: number
|
|
6
|
-
ach_level_current?: string
|
|
7
|
-
core_is_test_account?: boolean
|
|
8
|
-
ach_gamification_in_control_group?: boolean
|
|
2
|
+
core_user_language?: string;
|
|
3
|
+
ach_points_balance?: number;
|
|
4
|
+
ach_points_ever?: number;
|
|
5
|
+
ach_level_current_id?: number;
|
|
6
|
+
ach_level_current?: string;
|
|
7
|
+
core_is_test_account?: boolean;
|
|
8
|
+
ach_gamification_in_control_group?: boolean;
|
|
9
9
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { ProtocolResponse } from '../Base/ProtocolResponse'
|
|
2
|
-
import { PublicProperties } from './PublicProperties'
|
|
1
|
+
import { ProtocolResponse } from '../Base/ProtocolResponse';
|
|
2
|
+
import { PublicProperties } from './PublicProperties';
|
|
3
3
|
|
|
4
4
|
interface ResponseIdentify extends ProtocolResponse {
|
|
5
|
-
user_id: number
|
|
6
|
-
ext_user_id: string
|
|
7
|
-
public_username: string
|
|
8
|
-
avatar_id: string
|
|
9
|
-
job: boolean
|
|
10
|
-
props?: PublicProperties
|
|
11
|
-
pubic_username_set: boolean
|
|
5
|
+
user_id: number;
|
|
6
|
+
ext_user_id: string;
|
|
7
|
+
public_username: string;
|
|
8
|
+
avatar_id: string;
|
|
9
|
+
job: boolean;
|
|
10
|
+
props?: PublicProperties;
|
|
11
|
+
pubic_username_set: boolean;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export { ResponseIdentify }
|
|
14
|
+
export { ResponseIdentify };
|
package/src/Core/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from './ActivityTypeLimited'
|
|
2
|
-
export * from './CoreUtils'
|
|
3
|
-
export * from './GetLabelInfoRequest'
|
|
4
|
-
export * from './GetLabelInfoResponse'
|
|
5
|
-
export * from './GetTranslationsRequest'
|
|
6
|
-
export * from './GetTranslationsResponse'
|
|
7
|
-
export * from './PublicLabelSettings'
|
|
8
|
-
export * from './ResponseIdentify'
|
|
9
|
-
export * from './TranslationArea'
|
|
1
|
+
export * from './ActivityTypeLimited';
|
|
2
|
+
export * from './CoreUtils';
|
|
3
|
+
export * from './GetLabelInfoRequest';
|
|
4
|
+
export * from './GetLabelInfoResponse';
|
|
5
|
+
export * from './GetTranslationsRequest';
|
|
6
|
+
export * from './GetTranslationsResponse';
|
|
7
|
+
export * from './PublicLabelSettings';
|
|
8
|
+
export * from './ResponseIdentify';
|
|
9
|
+
export * from './TranslationArea';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ProtocolResponse } from '../Base/ProtocolResponse'
|
|
2
|
-
import { UICustomSection } from './UICustomSection'
|
|
1
|
+
import { ProtocolResponse } from '../Base/ProtocolResponse';
|
|
2
|
+
import { UICustomSection } from './UICustomSection';
|
|
3
3
|
|
|
4
4
|
export interface GetCustomSectionsResponse extends ProtocolResponse {
|
|
5
|
-
customSections: { [key: string]: UICustomSection }
|
|
5
|
+
customSections: { [key: string]: UICustomSection };
|
|
6
6
|
}
|
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
import { TUICustomSection } from '../WSAPI/WSAPITypes'
|
|
2
|
-
import {
|
|
1
|
+
import { TUICustomSection } from '../WSAPI/WSAPITypes';
|
|
2
|
+
import {
|
|
3
|
+
AchCustomLayoutTheme,
|
|
4
|
+
AchCustomSectionType,
|
|
5
|
+
AchMissionsTabsOptions,
|
|
6
|
+
AchOverviewMissionsFilter,
|
|
7
|
+
} from './AchCustomSection';
|
|
3
8
|
|
|
4
9
|
export interface UICustomSection {
|
|
5
|
-
body?: string
|
|
6
|
-
menu_img?: string
|
|
7
|
-
menu_name?: string
|
|
8
|
-
custom_skin_images?: string
|
|
9
|
-
section_type_id?: AchCustomSectionType
|
|
10
|
-
theme?: AchCustomLayoutTheme
|
|
11
|
-
generic_custom_css?: string
|
|
12
|
-
mission_tabs_options?: AchMissionsTabsOptions
|
|
13
|
-
overview_missions_filter?: AchOverviewMissionsFilter
|
|
14
|
-
overview_missions_count?: number
|
|
10
|
+
body?: string;
|
|
11
|
+
menu_img?: string;
|
|
12
|
+
menu_name?: string;
|
|
13
|
+
custom_skin_images?: string;
|
|
14
|
+
section_type_id?: AchCustomSectionType;
|
|
15
|
+
theme?: AchCustomLayoutTheme;
|
|
16
|
+
generic_custom_css?: string;
|
|
17
|
+
mission_tabs_options?: AchMissionsTabsOptions;
|
|
18
|
+
overview_missions_filter?: AchOverviewMissionsFilter;
|
|
19
|
+
overview_missions_count?: number;
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
export const UICustomSectionTransform = (items: UICustomSection[]): TUICustomSection[] => {
|
|
@@ -29,7 +34,7 @@ export const UICustomSectionTransform = (items: UICustomSection[]): TUICustomSec
|
|
|
29
34
|
overview_missions_count: r.overview_missions_count,
|
|
30
35
|
overview_missions_filter: r.overview_missions_filter,
|
|
31
36
|
theme: r.theme,
|
|
32
|
-
}
|
|
33
|
-
return x
|
|
34
|
-
})
|
|
35
|
-
}
|
|
37
|
+
};
|
|
38
|
+
return x;
|
|
39
|
+
});
|
|
40
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './AchCustomSection'
|
|
2
|
-
export * from './UICustomSection'
|
|
3
|
-
export * from './GetCustomSectionsRequest'
|
|
4
|
-
export * from './GetCustomSectionsResponse'
|
|
1
|
+
export * from './AchCustomSection';
|
|
2
|
+
export * from './UICustomSection';
|
|
3
|
+
export * from './GetCustomSectionsRequest';
|
|
4
|
+
export * from './GetCustomSectionsResponse';
|
package/src/ErrorCodes.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const ErrorCodes_FatalStartingRange = 100000
|
|
1
|
+
export const ErrorCodes_FatalStartingRange = 100000;
|
|
2
2
|
|
|
3
3
|
export enum ErrorCodesGame {
|
|
4
4
|
OK = 0,
|
|
@@ -13,4 +13,4 @@ export enum ErrorCodesGame {
|
|
|
13
13
|
Fatal_Unhandled = ErrorCodes_FatalStartingRange + 4,
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export type ErrorCodes = ErrorCodesGame
|
|
16
|
+
export type ErrorCodes = ErrorCodesGame;
|