fansunited-sdk-esm 1.3.3 → 1.3.4
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/Core/Exception/FansUnitedSdkException.d.ts +1 -1
- package/Core/Global/Constants/Constants.d.ts +3 -0
- package/Core/Global/Constants/TestConstants.d.ts +148 -0
- package/Core/Global/LocalStorage.d.ts +7 -0
- package/Core/Global/Messages/Messages.d.ts +10 -0
- package/Core/Global/SDKIdsRemapper.d.ts +40 -0
- package/Core/Global/Types/GlobalTypes.d.ts +12 -0
- package/Core/Https/ActivityHttps.d.ts +1 -1
- package/Core/Https/ClientHttps.d.ts +1 -1
- package/Core/Namespaces/Activity/Remapper/ActivityRemapper.d.ts +2 -0
- package/Core/Namespaces/Loyalty/Facade/LoyaltyFacade.d.ts +1 -1
- package/Core/Namespaces/Loyalty/Loyalty.d.ts +1 -1
- package/Core/Namespaces/MatchQuiz/Facade/MatchQuizFacade.d.ts +1 -1
- package/Core/Namespaces/MatchQuiz/MatchQuiz.d.ts +1 -1
- package/Core/Namespaces/Predictor/Enums/StatusEnum.d.ts +1 -1
- package/Core/Namespaces/Predictor/Facade/PredictorFacade.d.ts +6 -3
- package/Core/Namespaces/Predictor/Models/Predictions/PredictionsFilters.d.ts +1 -0
- package/Core/Namespaces/Predictor/Predictor.d.ts +5 -3
- package/Core/Namespaces/Predictor/Service/PredictorService.d.ts +10 -6
- package/Core/Namespaces/Profile/Builders/OwnProfileBuilder.d.ts +3 -1
- package/Core/Namespaces/Profile/Builders/ProfileBuilder.d.ts +4 -2
- package/Core/Namespaces/Profile/Models/Stats/ProfileStatsModel.d.ts +2 -0
- package/Core/Namespaces/Profile/Models/Stats/SuccessRatePercent.d.ts +3 -0
- package/Core/Namespaces/Profile/Models/Stats/SuccessRates.d.ts +7 -0
- package/Core/Namespaces/Profile/Profile.d.ts +1 -0
- package/Core/Namespaces/TopX/Facade/TopXFacade.d.ts +2 -1
- package/Core/Namespaces/TopX/TopX.d.ts +1 -1
- package/index.js +18 -16
- package/index.js.map +3 -3
- package/package.json +1 -1
- package/Core/Exception/ErrorMessages.d.ts +0 -3
- package/Core/Global/BulkBuilder.d.ts +0 -3
|
@@ -13,3 +13,151 @@ export declare const predictorConfigResponse: {
|
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
+
export declare const EFBET_MATCH: {
|
|
17
|
+
data: {
|
|
18
|
+
meta: {
|
|
19
|
+
pagination: {
|
|
20
|
+
current_page: number;
|
|
21
|
+
items_per_page: number;
|
|
22
|
+
total_items: number;
|
|
23
|
+
number_of_pages: number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
data: {
|
|
27
|
+
id: string;
|
|
28
|
+
kickoff_at: string;
|
|
29
|
+
finished_at: any;
|
|
30
|
+
updated_at: string;
|
|
31
|
+
home_team: {
|
|
32
|
+
id: string;
|
|
33
|
+
country: {
|
|
34
|
+
id: string;
|
|
35
|
+
alias: any;
|
|
36
|
+
country_code: string;
|
|
37
|
+
assets: {
|
|
38
|
+
flag: string;
|
|
39
|
+
};
|
|
40
|
+
name: string;
|
|
41
|
+
};
|
|
42
|
+
assets: {
|
|
43
|
+
logo: string;
|
|
44
|
+
};
|
|
45
|
+
national: boolean;
|
|
46
|
+
code: string;
|
|
47
|
+
gender: string;
|
|
48
|
+
name: string;
|
|
49
|
+
full_name: any;
|
|
50
|
+
short_name: any;
|
|
51
|
+
};
|
|
52
|
+
away_team: {
|
|
53
|
+
id: string;
|
|
54
|
+
country: {
|
|
55
|
+
id: string;
|
|
56
|
+
alias: any;
|
|
57
|
+
country_code: string;
|
|
58
|
+
assets: {
|
|
59
|
+
flag: string;
|
|
60
|
+
};
|
|
61
|
+
name: string;
|
|
62
|
+
};
|
|
63
|
+
assets: {
|
|
64
|
+
logo: string;
|
|
65
|
+
};
|
|
66
|
+
national: boolean;
|
|
67
|
+
code: any;
|
|
68
|
+
gender: string;
|
|
69
|
+
name: string;
|
|
70
|
+
full_name: any;
|
|
71
|
+
short_name: any;
|
|
72
|
+
};
|
|
73
|
+
lineups_confirmed: any;
|
|
74
|
+
started_at: any;
|
|
75
|
+
minute: any;
|
|
76
|
+
scores: {
|
|
77
|
+
ft_score: {
|
|
78
|
+
home_goals: any;
|
|
79
|
+
away_goals: any;
|
|
80
|
+
};
|
|
81
|
+
ht_score: {
|
|
82
|
+
home_goals: any;
|
|
83
|
+
away_goals: any;
|
|
84
|
+
};
|
|
85
|
+
aet_score: {
|
|
86
|
+
home_goals: any;
|
|
87
|
+
away_goals: any;
|
|
88
|
+
};
|
|
89
|
+
agg_score: {
|
|
90
|
+
home_goals: any;
|
|
91
|
+
away_goals: any;
|
|
92
|
+
};
|
|
93
|
+
pen_score: {
|
|
94
|
+
home_goals: any;
|
|
95
|
+
away_goals: any;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
context: {
|
|
99
|
+
competition: {
|
|
100
|
+
id: string;
|
|
101
|
+
country: {
|
|
102
|
+
id: string;
|
|
103
|
+
alias: any;
|
|
104
|
+
country_code: string;
|
|
105
|
+
assets: {
|
|
106
|
+
flag: string;
|
|
107
|
+
};
|
|
108
|
+
name: string;
|
|
109
|
+
};
|
|
110
|
+
gender: string;
|
|
111
|
+
assets: {
|
|
112
|
+
logo: string;
|
|
113
|
+
};
|
|
114
|
+
type: string;
|
|
115
|
+
name: string;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
status: {
|
|
119
|
+
type: string;
|
|
120
|
+
sub_type: string;
|
|
121
|
+
};
|
|
122
|
+
}[];
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
export declare const FOOTBALL_COMPETITIONS: {
|
|
126
|
+
data: {
|
|
127
|
+
data: ({
|
|
128
|
+
id: string;
|
|
129
|
+
country: {
|
|
130
|
+
id: string;
|
|
131
|
+
alias: any;
|
|
132
|
+
country_code: string;
|
|
133
|
+
assets: {
|
|
134
|
+
flag: string;
|
|
135
|
+
};
|
|
136
|
+
name: string;
|
|
137
|
+
};
|
|
138
|
+
gender: string;
|
|
139
|
+
assets: {
|
|
140
|
+
logo: string;
|
|
141
|
+
};
|
|
142
|
+
type: string;
|
|
143
|
+
name: string;
|
|
144
|
+
} | {
|
|
145
|
+
id: string;
|
|
146
|
+
country: {
|
|
147
|
+
id: string;
|
|
148
|
+
alias: string;
|
|
149
|
+
country_code: string;
|
|
150
|
+
assets: {
|
|
151
|
+
flag: string;
|
|
152
|
+
};
|
|
153
|
+
name: string;
|
|
154
|
+
};
|
|
155
|
+
gender: string;
|
|
156
|
+
assets: {
|
|
157
|
+
logo: any;
|
|
158
|
+
};
|
|
159
|
+
type: string;
|
|
160
|
+
name: string;
|
|
161
|
+
})[];
|
|
162
|
+
};
|
|
163
|
+
};
|
|
@@ -29,7 +29,14 @@ export default class LocalStorage {
|
|
|
29
29
|
setFootballCountries: (countries: FootballCountryModel[]) => void;
|
|
30
30
|
getCompetitions: (filters?: CompetitionFilters) => any;
|
|
31
31
|
setCompetitions: (competitions: CompetitionBasicModel[]) => void;
|
|
32
|
+
getCompetitionsLength: () => number;
|
|
32
33
|
getExpirationProfile: () => number;
|
|
34
|
+
/**
|
|
35
|
+
* The purpose of this method is to avoid the posibility of having same competitions store in Local Storage.
|
|
36
|
+
* @param competitions Cached competitions.
|
|
37
|
+
* @returns Unique competitions.
|
|
38
|
+
*/
|
|
39
|
+
private makeCompetitionsUnique;
|
|
33
40
|
private getData;
|
|
34
41
|
private setData;
|
|
35
42
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare enum ErrorMessages {
|
|
2
|
+
LOYALTY_INVALID_TEMPLATE_ID = "Provided template ID does NOT exist! Try again with existing template ID.",
|
|
3
|
+
INVALID_MATCH_ID = "Match id is invalid!",
|
|
4
|
+
INVALID_PLAYER_ID = "Player id is invalid!",
|
|
5
|
+
QUERY_PARAM_MATCH_IDS_EXCEEDED = "Maximum matchIds in PredictionFilters should be 10 or less."
|
|
6
|
+
}
|
|
7
|
+
export declare const WarningMessages: {
|
|
8
|
+
UNEXPECTED_STATUS_PROP: string;
|
|
9
|
+
UNEXPECTED_TYPE_PROP: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import SDKConfigurationModel from "../Configurator/Models/SDKConfiguraitonModel";
|
|
2
|
+
import ProfileStatsModel from "../Namespaces/Profile/Models/Stats/ProfileStatsModel";
|
|
3
|
+
export default class SDKIdsRemapper {
|
|
4
|
+
private idMapping;
|
|
5
|
+
private idSchema;
|
|
6
|
+
private readonly native;
|
|
7
|
+
constructor(config: SDKConfigurationModel);
|
|
8
|
+
/**
|
|
9
|
+
* Method is used to remaped competition and team ids from entities in successRates field.
|
|
10
|
+
* @param profileStats Profile stats from Loyalty API.
|
|
11
|
+
* @returns A new successRates with remaped ids keys.
|
|
12
|
+
*/
|
|
13
|
+
remapSuccessRatesEntities: (profileStats: ProfileStatsModel) => Promise<ProfileStatsModel>;
|
|
14
|
+
/**
|
|
15
|
+
* Keys for success rates entiteis are ids. This method extracts them in string array.
|
|
16
|
+
* @param record The record containing native ids keys.
|
|
17
|
+
* @returns New list of native ids.
|
|
18
|
+
*/
|
|
19
|
+
private getIdsKeys;
|
|
20
|
+
/**
|
|
21
|
+
* Makes a new Map contating key-value native-remapped id.
|
|
22
|
+
* @param nativeIds Native ids from success rates API response.
|
|
23
|
+
* @param idSchemaIds New remapped ids for success rates.
|
|
24
|
+
* @returns New map containing key-value ids.
|
|
25
|
+
*/
|
|
26
|
+
private getIdsMap;
|
|
27
|
+
/**
|
|
28
|
+
* Constructs new record with remapped ids for success rates.
|
|
29
|
+
* @param record Old record with native ids keys.
|
|
30
|
+
* @param idsMap Ids map with native ids keys and remapped ids values.
|
|
31
|
+
* @returns New Record with remapped ids keys.
|
|
32
|
+
*/
|
|
33
|
+
private setNewRecord;
|
|
34
|
+
/**
|
|
35
|
+
* Calls id mapping facade to fetch id entities from storage or Id Mapping API.
|
|
36
|
+
* @param idsObj Object which key is entity and value is string array of ids.
|
|
37
|
+
* @returns Remapped ids by entities.
|
|
38
|
+
*/
|
|
39
|
+
private remapIdsObj;
|
|
40
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import LoyaltyConfigModel from "../../Namespaces/Loyalty/Models/ClientFeatures/LoyaltyConfigModel";
|
|
2
|
+
import MatchQuizConfigModel from "../../Namespaces/MatchQuiz/Models/Config/MatchQuizConfigModel";
|
|
3
|
+
import TopXConfigModel from "../../Namespaces/TopX/Models/Config/TopXConfigModel";
|
|
4
|
+
import PredictorConfigModel from "../../Namespaces/Predictor/Models/Config/PredictorConfigModel";
|
|
5
|
+
export declare type FeaturesConfigModels = PredictorConfigModel | TopXConfigModel | MatchQuizConfigModel | LoyaltyConfigModel;
|
|
6
|
+
export declare type FilterCase = "user" | "current" | "past" | "matches";
|
|
7
|
+
export declare type IdEntities = {
|
|
8
|
+
competition?: string[];
|
|
9
|
+
team?: string[];
|
|
10
|
+
player?: string[];
|
|
11
|
+
match?: string[];
|
|
12
|
+
};
|
|
@@ -14,5 +14,5 @@ export default class ActivityHttps {
|
|
|
14
14
|
deleteActivity: (activityId: string) => Promise<boolean>;
|
|
15
15
|
getOwnActivities: (filters: ActivityFilters, disableCache: boolean) => Promise<PaginationActivities>;
|
|
16
16
|
getActivitiesForUser: (userId: string, filters: ActivityFilters, disableCache: boolean) => Promise<PaginationActivities>;
|
|
17
|
-
getStats: (userId?: string) => Promise<ProfileStatsModel>;
|
|
17
|
+
getStats: (userId?: string, disableCache?: boolean) => Promise<ProfileStatsModel>;
|
|
18
18
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import SDKConfigurationModel from "../Configurator/Models/SDKConfiguraitonModel";
|
|
2
|
-
import { FeaturesConfigModels } from "../
|
|
2
|
+
import { FeaturesConfigModels } from "../Global/Types/GlobalTypes";
|
|
3
3
|
export declare enum FeatureConfigType {
|
|
4
4
|
PREDICTOR = "predictor",
|
|
5
5
|
TOP_X = "topX",
|
|
@@ -5,4 +5,6 @@ export default class ActivityRemapper {
|
|
|
5
5
|
remapSingleResponse: (response: any) => ActivityResponseBody;
|
|
6
6
|
remapActivitiesResponse: (response: any) => PaginationActivities;
|
|
7
7
|
remapStatsReponse: (response: any) => ProfileStatsModel;
|
|
8
|
+
private constructNewRecord;
|
|
9
|
+
private remapSuccessRatePercent;
|
|
8
10
|
}
|
|
@@ -5,7 +5,7 @@ import LoyaltyHttps from "../../../Https/LoyaltyHttps";
|
|
|
5
5
|
import LoyaltyFilters from "../Models/Filters/LoyaltyFilters";
|
|
6
6
|
import ClientBadges from "../Models/Badges/ClientBadges";
|
|
7
7
|
import TemplateModel from "../Models/Template/TemplateModel";
|
|
8
|
-
import { FeaturesConfigModels } from "
|
|
8
|
+
import { FeaturesConfigModels } from "../../../Global/Types/GlobalTypes";
|
|
9
9
|
export default class LoyaltyFacade {
|
|
10
10
|
private config;
|
|
11
11
|
private clientHttps;
|
|
@@ -3,7 +3,7 @@ import PaginationModel from "../../Global/Models/Pagination/PaginationModel";
|
|
|
3
3
|
import LoyaltyFilters from "./Models/Filters/LoyaltyFilters";
|
|
4
4
|
import ClientBadges from "./Models/Badges/ClientBadges";
|
|
5
5
|
import TemplateModel from "./Models/Template/TemplateModel";
|
|
6
|
-
import { FeaturesConfigModels } from "
|
|
6
|
+
import { FeaturesConfigModels } from "../../Global/Types/GlobalTypes";
|
|
7
7
|
export default class Loyalty {
|
|
8
8
|
private clientHttps;
|
|
9
9
|
private loyaltyHttps;
|
|
@@ -3,7 +3,7 @@ import PaginationModel from "../../../Global/Models/Pagination/PaginationModel";
|
|
|
3
3
|
import PredictionRequestModel from "../../Predictor/Models/Predictions/PredictionRequestModel";
|
|
4
4
|
import PredictionResponseModel from "../../Predictor/Models/Predictions/PredictionResponseModel";
|
|
5
5
|
import PredictionsFilters from "../../Predictor/Models/Predictions/PredictionsFilters";
|
|
6
|
-
import { FeaturesConfigModels } from "
|
|
6
|
+
import { FeaturesConfigModels } from "../../../Global/Types/GlobalTypes";
|
|
7
7
|
import GameModel from "../../TopX/Models/Games/GameModel";
|
|
8
8
|
import GamesFilters from "../../TopX/Models/Games/GamesFilters";
|
|
9
9
|
import GamesListModel from "../../TopX/Models/Games/GamesListModel";
|
|
@@ -3,7 +3,7 @@ import PaginationModel from "../../Global/Models/Pagination/PaginationModel";
|
|
|
3
3
|
import PredictionRequestModel from "../Predictor/Models/Predictions/PredictionRequestModel";
|
|
4
4
|
import PredictionResponseModel from "../Predictor/Models/Predictions/PredictionResponseModel";
|
|
5
5
|
import PredictionsFilters from "../Predictor/Models/Predictions/PredictionsFilters";
|
|
6
|
-
import { FeaturesConfigModels } from "
|
|
6
|
+
import { FeaturesConfigModels } from "../../Global/Types/GlobalTypes";
|
|
7
7
|
import GameModel from "../TopX/Models/Games/GameModel";
|
|
8
8
|
import GamesFilters from "../TopX/Models/Games/GamesFilters";
|
|
9
9
|
import GamesListModel from "../TopX/Models/Games/GamesListModel";
|
|
@@ -3,10 +3,11 @@ import ClientHttps from "../../../Https/ClientHttps";
|
|
|
3
3
|
import PredictorHttps from "../../../Https/PredictorHttps";
|
|
4
4
|
import IdMappingService from "../../../IdMapping/IdMappingService";
|
|
5
5
|
import MatchSummaryModel from "../Models/Summary/MatchSummaryModel";
|
|
6
|
-
import PredictorService
|
|
6
|
+
import PredictorService from "../Service/PredictorService";
|
|
7
7
|
import PredictionsFilters from "../Models/Predictions/PredictionsFilters";
|
|
8
8
|
import SDKConfigurationModel from "../../../Configurator/Models/SDKConfiguraitonModel";
|
|
9
9
|
import PaginationModel from "../../../Global/Models/Pagination/PaginationModel";
|
|
10
|
+
import { FeaturesConfigModels } from "../../../Global/Types/GlobalTypes";
|
|
10
11
|
export default class PredictorFacade {
|
|
11
12
|
readonly predictorHttps: PredictorHttps;
|
|
12
13
|
readonly clientHttps: ClientHttps;
|
|
@@ -34,9 +35,11 @@ export default class PredictorFacade {
|
|
|
34
35
|
getConfig: () => Promise<FeaturesConfigModels>;
|
|
35
36
|
deleteFootballPrediction: (predictionId: string) => Promise<boolean>;
|
|
36
37
|
getMyPredictions: (filters?: PredictionsFilters) => Promise<PaginationModel>;
|
|
38
|
+
getMyPredictionsForMatches: (matchIds: string[], filters: PredictionsFilters) => Promise<PaginationModel>;
|
|
37
39
|
getMyCurrentPredictions: (filters?: PredictionsFilters) => Promise<PaginationModel>;
|
|
38
40
|
getMyPastPredictions: (filters?: PredictionsFilters) => Promise<PaginationModel>;
|
|
39
41
|
getUserPredictions: (userId: string, filters?: PredictionsFilters, disableCache?: boolean) => Promise<PaginationModel>;
|
|
40
|
-
getUserCurrentPredictions: (userId: string, filters?: PredictionsFilters) => Promise<PaginationModel>;
|
|
41
|
-
getUserPastPredictions: (userId: string, filters?: PredictionsFilters) => Promise<PaginationModel>;
|
|
42
|
+
getUserCurrentPredictions: (userId: string, filters?: PredictionsFilters, disableCache?: boolean) => Promise<PaginationModel>;
|
|
43
|
+
getUserPastPredictions: (userId: string, filters?: PredictionsFilters, disableCache?: boolean) => Promise<PaginationModel>;
|
|
44
|
+
getUserPredictionsForMatches: (userId: string, matchIds: string[], filters?: PredictionsFilters, disableCache?: boolean) => Promise<PaginationModel>;
|
|
42
45
|
}
|
|
@@ -3,7 +3,7 @@ import MatchSummaryModel from "./Models/Summary/MatchSummaryModel";
|
|
|
3
3
|
import { MarketEnum } from "./Enums/MarketEnum";
|
|
4
4
|
import PredictionsFilters from "./Models/Predictions/PredictionsFilters";
|
|
5
5
|
import PaginationModel from "../../Global/Models/Pagination/PaginationModel";
|
|
6
|
-
import { FeaturesConfigModels } from "
|
|
6
|
+
import { FeaturesConfigModels } from "../../Global/Types/GlobalTypes";
|
|
7
7
|
export default class Predictor {
|
|
8
8
|
private predictorHttps;
|
|
9
9
|
private clientHttps;
|
|
@@ -18,7 +18,9 @@ export default class Predictor {
|
|
|
18
18
|
getMyPredictions: (filters?: PredictionsFilters) => Promise<PaginationModel>;
|
|
19
19
|
getMyCurrentPredictions: (filters?: PredictionsFilters) => Promise<PaginationModel>;
|
|
20
20
|
getMyPastPredictions: (filters?: PredictionsFilters) => Promise<PaginationModel>;
|
|
21
|
+
getMyPredictionsForMatches: (matchIds: string[], filters?: PredictionsFilters) => Promise<PaginationModel>;
|
|
21
22
|
getUserPredictions: (userId: string, filters?: PredictionsFilters, disableCache?: boolean) => Promise<PaginationModel>;
|
|
22
|
-
getUserCurrentPredictions: (userId: string, filters?: PredictionsFilters) => Promise<PaginationModel>;
|
|
23
|
-
getUserPastPredictions: (userId: string, filters?: PredictionsFilters) => Promise<PaginationModel>;
|
|
23
|
+
getUserCurrentPredictions: (userId: string, filters?: PredictionsFilters, disableCache?: boolean) => Promise<PaginationModel>;
|
|
24
|
+
getUserPastPredictions: (userId: string, filters?: PredictionsFilters, disableCache?: boolean) => Promise<PaginationModel>;
|
|
25
|
+
getUserPredictionsForMatches: (userId: string, matchIds: string[], filters?: PredictionsFilters, disableCache?: boolean) => Promise<PaginationModel>;
|
|
24
26
|
}
|
|
@@ -14,16 +14,12 @@ import PenaltyMatchFixtureModel from "../Models/Fixtures/Markets/PenaltyMatchFix
|
|
|
14
14
|
import OverGoalsFixtureModel from "../Models/Fixtures/Markets/OverGoalsFixtureModel";
|
|
15
15
|
import OverCornersFixtureModel from "../Models/Fixtures/Markets/OverCornersFixtureModel";
|
|
16
16
|
import MatchSummaryModel from "../Models/Summary/MatchSummaryModel";
|
|
17
|
-
import PredictorConfigModel from "../Models/Config/PredictorConfigModel";
|
|
18
17
|
import SDKConfigurationModel from "../../../Configurator/Models/SDKConfiguraitonModel";
|
|
19
18
|
import PredictionsFilters from "../Models/Predictions/PredictionsFilters";
|
|
20
19
|
import { TypeGames } from "../../TopX/Types/TypeGames";
|
|
21
20
|
import GamesFilters from "../../TopX/Models/Games/GamesFilters";
|
|
22
21
|
import PaginationModel from "../../../Global/Models/Pagination/PaginationModel";
|
|
23
|
-
import
|
|
24
|
-
import MatchQuizConfigModel from "../../MatchQuiz/Models/Config/MatchQuizConfigModel";
|
|
25
|
-
import LoyaltyConfigModel from "../../Loyalty/Models/ClientFeatures/LoyaltyConfigModel";
|
|
26
|
-
export declare type FeaturesConfigModels = PredictorConfigModel | TopXConfigModel | MatchQuizConfigModel | LoyaltyConfigModel;
|
|
22
|
+
import { FeaturesConfigModels, FilterCase } from "../../../Global/Types/GlobalTypes";
|
|
27
23
|
export default class PredictorService {
|
|
28
24
|
private footballHttps;
|
|
29
25
|
private idMapping;
|
|
@@ -56,7 +52,7 @@ export default class PredictorService {
|
|
|
56
52
|
* @param fixture
|
|
57
53
|
* @returns Fixture model.
|
|
58
54
|
*/
|
|
59
|
-
validateFixture: (matchId: string, market: MarketEnum, value: any, playerId?: string) =>
|
|
55
|
+
validateFixture: (matchId: string, market: MarketEnum, value: any, playerId?: string) => PlayerFixtureModel | CorrectScoreFixtureModel | OverCornersFixtureModel | OverGoalsFixtureModel | HalfTimeFullTimeFixtureModel | DoubleChanceFixtureModel | FullTimeOneXTwoFixtureModel | HalfTimeOneXTwoFixtureModel | CornersFixtureModel | BothTeamsFixtureModel | RedCardFixtureModel | PenaltyMatchFixtureModel;
|
|
60
56
|
getMarketSummary: (matchSummary: MatchSummaryModel, market: MarketEnum, playerId?: string) => any;
|
|
61
57
|
remapCompetitionsFromConfig: (config: FeaturesConfigModels) => Promise<FeaturesConfigModels>;
|
|
62
58
|
/**
|
|
@@ -87,4 +83,12 @@ export default class PredictorService {
|
|
|
87
83
|
initGameFilters: (gameType: TypeGames, filters?: GamesFilters, gameIds?: string[]) => GamesFilters;
|
|
88
84
|
addPredictionProp: (predictions: any[], paginatedGames: PaginationModel) => Promise<any>;
|
|
89
85
|
private remapResult;
|
|
86
|
+
/**
|
|
87
|
+
* Checks whether the length of array is more than the declared limit.
|
|
88
|
+
* @param ids String array for which length is limited.
|
|
89
|
+
* @returns True/false result from ternary operator.
|
|
90
|
+
*/
|
|
91
|
+
areIdsExceeded: (ids: string[]) => boolean;
|
|
92
|
+
initPredictionsFilters: (filters: PredictionsFilters, filtersFor: FilterCase, matchIds?: string[]) => PredictionsFilters;
|
|
93
|
+
private deleteUnexpectedProperties;
|
|
90
94
|
}
|
|
@@ -10,7 +10,9 @@ import FollowFilters from "../Models/FollowFilters";
|
|
|
10
10
|
import PaginationModel from "../../../Global/Models/Pagination/PaginationModel";
|
|
11
11
|
import ProfileStatsModel from "../Models/Stats/ProfileStatsModel";
|
|
12
12
|
import ActivityHttps from "../../../Https/ActivityHttps";
|
|
13
|
+
import SDKIdsRemapper from "../../../Global/SDKIdsRemapper";
|
|
13
14
|
export default class OwnProfileBuilder {
|
|
15
|
+
private idsRemapper;
|
|
14
16
|
private profileHttps;
|
|
15
17
|
private profileService;
|
|
16
18
|
private activityHttps;
|
|
@@ -22,7 +24,7 @@ export default class OwnProfileBuilder {
|
|
|
22
24
|
private expireAt;
|
|
23
25
|
private promises;
|
|
24
26
|
private isFetching;
|
|
25
|
-
constructor(localStorage: LocalStorage, profileHttps: ProfileHttps, activityHttps: ActivityHttps, idMapping: IdMappingService, footballFacade: FootballFacade);
|
|
27
|
+
constructor(idsRemapper: SDKIdsRemapper, localStorage: LocalStorage, profileHttps: ProfileHttps, activityHttps: ActivityHttps, idMapping: IdMappingService, footballFacade: FootballFacade);
|
|
26
28
|
private getOwnProfile;
|
|
27
29
|
private delay;
|
|
28
30
|
private setOwnProfile;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import LocalStorage from "../../../Global/LocalStorage";
|
|
2
2
|
import PaginationModel from "../../../Global/Models/Pagination/PaginationModel";
|
|
3
|
+
import SDKIdsRemapper from "../../../Global/SDKIdsRemapper";
|
|
3
4
|
import ActivityHttps from "../../../Https/ActivityHttps";
|
|
4
5
|
import ProfileHttps from "../../../Https/ProfileHttps";
|
|
5
6
|
import IdMappingService from "../../../IdMapping/IdMappingService";
|
|
@@ -10,6 +11,7 @@ import InterestModel from "../Models/InterestModel";
|
|
|
10
11
|
import ProfileModel from "../Models/ProfileModel";
|
|
11
12
|
import ProfileStatsModel from "../Models/Stats/ProfileStatsModel";
|
|
12
13
|
export default class ProfileBuilder {
|
|
14
|
+
private idsRemapper;
|
|
13
15
|
private profileHttps;
|
|
14
16
|
private activityHttps;
|
|
15
17
|
private footballFacade;
|
|
@@ -18,7 +20,7 @@ export default class ProfileBuilder {
|
|
|
18
20
|
private profileFacade;
|
|
19
21
|
private interestsService;
|
|
20
22
|
private profileId;
|
|
21
|
-
constructor(localStorage: LocalStorage, profileHttps: ProfileHttps, activityHttps: ActivityHttps, idMapping: IdMappingService, footballFacade: FootballFacade);
|
|
23
|
+
constructor(idsRemapper: SDKIdsRemapper, localStorage: LocalStorage, profileHttps: ProfileHttps, activityHttps: ActivityHttps, idMapping: IdMappingService, footballFacade: FootballFacade);
|
|
22
24
|
setId: (id: string) => this;
|
|
23
25
|
private getProfile;
|
|
24
26
|
getInfo: () => Promise<ProfileModel>;
|
|
@@ -27,6 +29,6 @@ export default class ProfileBuilder {
|
|
|
27
29
|
getFollowers: (filters?: FollowFilters) => Promise<PaginationModel>;
|
|
28
30
|
getFollowing: (filters?: FollowFilters) => Promise<PaginationModel>;
|
|
29
31
|
showFullnessProfile: () => Promise<FullnessProfile>;
|
|
30
|
-
getStats: () => Promise<ProfileStatsModel>;
|
|
32
|
+
getStats: (disableCache?: boolean) => Promise<ProfileStatsModel>;
|
|
31
33
|
getBadges: () => Promise<string[]>;
|
|
32
34
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import SuccessRatePercent from "./SuccessRatePercent";
|
|
2
|
+
export default class SuccessRates {
|
|
3
|
+
overallPercent: number;
|
|
4
|
+
byFootballCompetition: Record<string, SuccessRatePercent>;
|
|
5
|
+
byFootballTeam: Record<string, SuccessRatePercent>;
|
|
6
|
+
byFootballMarket: Record<string, SuccessRatePercent>;
|
|
7
|
+
}
|
|
@@ -2,6 +2,7 @@ import OwnProfileBuilder from "./Builders/OwnProfileBuilder";
|
|
|
2
2
|
import ProfileBuilder from "./Builders/ProfileBuilder";
|
|
3
3
|
import SDKConfigurationModel from "../../Configurator/Models/SDKConfiguraitonModel";
|
|
4
4
|
export default class Profile {
|
|
5
|
+
private idsRemapper;
|
|
5
6
|
private profileHttps;
|
|
6
7
|
private activityHttps;
|
|
7
8
|
private footballHttps;
|
|
@@ -2,12 +2,13 @@ import SDKConfigurationModel from "../../../Configurator/Models/SDKConfiguraiton
|
|
|
2
2
|
import PredictorHttps from "../../../Https/PredictorHttps";
|
|
3
3
|
import IdMappingService from "../../../IdMapping/IdMappingService";
|
|
4
4
|
import PredictionResponseModel from "../../Predictor/Models/Predictions/PredictionResponseModel";
|
|
5
|
-
import PredictorService
|
|
5
|
+
import PredictorService from "../../Predictor/Service/PredictorService";
|
|
6
6
|
import GamesFilters from "../Models/Games/GamesFilters";
|
|
7
7
|
import GamesListModel from "../Models/Games/GamesListModel";
|
|
8
8
|
import PaginationModel from "../../../Global/Models/Pagination/PaginationModel";
|
|
9
9
|
import TopXPredictionRequestModel from "../Models/Prediction/TopXPredictionRequestModel";
|
|
10
10
|
import PredictionsFilters from "../../Predictor/Models/Predictions/PredictionsFilters";
|
|
11
|
+
import { FeaturesConfigModels } from "../../../Global/Types/GlobalTypes";
|
|
11
12
|
export default class TopXFacade {
|
|
12
13
|
readonly idMapping: IdMappingService;
|
|
13
14
|
readonly predictorHttps: PredictorHttps;
|
|
@@ -10,7 +10,7 @@ export default class TopX {
|
|
|
10
10
|
private topXFacade;
|
|
11
11
|
private idMapping;
|
|
12
12
|
constructor(config: SDKConfigurationModel);
|
|
13
|
-
getConfig: () => Promise<import("
|
|
13
|
+
getConfig: () => Promise<import("../../Global/Types/GlobalTypes").FeaturesConfigModels>;
|
|
14
14
|
getGames: (filters?: GamesFilters, disableCache?: boolean) => Promise<PaginationModel>;
|
|
15
15
|
getGameById: (gameId: string, disableCache?: boolean) => Promise<GamesListModel>;
|
|
16
16
|
getGamePredictions: (gameId: string, filters?: PredictionsFilters, disableCache?: boolean) => Promise<PaginationModel>;
|