fansunited-sdk-esm 1.3.2 → 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.
Files changed (45) hide show
  1. package/Core/Exception/FansUnitedSdkException.d.ts +5 -0
  2. package/Core/Global/Constants/Constants.d.ts +3 -0
  3. package/Core/Global/Constants/TestConstants.d.ts +163 -0
  4. package/Core/Global/LocalStorage.d.ts +7 -0
  5. package/Core/Global/Messages/Messages.d.ts +10 -0
  6. package/Core/Global/SDKIdsRemapper.d.ts +40 -0
  7. package/Core/Global/Types/GlobalTypes.d.ts +12 -0
  8. package/Core/Https/ActivityHttps.d.ts +1 -2
  9. package/Core/Https/ClientHttps.d.ts +9 -1
  10. package/Core/Https/PredictorHttps.d.ts +1 -2
  11. package/Core/Namespaces/Activity/Remapper/ActivityRemapper.d.ts +2 -0
  12. package/Core/Namespaces/Football/Facades/FootballFacade.d.ts +2 -5
  13. package/Core/Namespaces/Football/Facades/MatchFacade.d.ts +3 -1
  14. package/Core/Namespaces/Football/Facades/PlayerFacade.d.ts +3 -1
  15. package/Core/Namespaces/Football/Facades/TeamsFacade.d.ts +3 -1
  16. package/Core/Namespaces/Football/Models/Match/MatchBasicModel.d.ts +1 -0
  17. package/Core/Namespaces/Football/Models/Match/MatchFullModel.d.ts +1 -0
  18. package/Core/Namespaces/Football/Service/FootballService.d.ts +12 -0
  19. package/Core/Namespaces/Loyalty/Facade/LoyaltyFacade.d.ts +2 -3
  20. package/Core/Namespaces/Loyalty/Loyalty.d.ts +2 -2
  21. package/Core/Namespaces/Loyalty/Models/ClientFeatures/ClientFeaturesRemapper.d.ts +2 -2
  22. package/Core/Namespaces/Loyalty/Models/ClientFeatures/{ClientFeaturesModel.d.ts → LoyaltyConfigModel.d.ts} +1 -1
  23. package/Core/Namespaces/Loyalty/Models/Template/TemplateModel.d.ts +1 -0
  24. package/Core/Namespaces/MatchQuiz/Facade/MatchQuizFacade.d.ts +1 -2
  25. package/Core/Namespaces/MatchQuiz/MatchQuiz.d.ts +1 -1
  26. package/Core/Namespaces/Predictor/Enums/StatusEnum.d.ts +1 -1
  27. package/Core/Namespaces/Predictor/Facade/PredictorFacade.d.ts +9 -7
  28. package/Core/Namespaces/Predictor/Models/Config/FeatureConfigRemapper.d.ts +7 -0
  29. package/Core/Namespaces/Predictor/Models/Predictions/PredictionsFilters.d.ts +1 -0
  30. package/Core/Namespaces/Predictor/Predictor.d.ts +7 -5
  31. package/Core/Namespaces/Predictor/Service/PredictorService.d.ts +9 -4
  32. package/Core/Namespaces/Profile/Builders/OwnProfileBuilder.d.ts +9 -6
  33. package/Core/Namespaces/Profile/Builders/ProfileBuilder.d.ts +4 -2
  34. package/Core/Namespaces/Profile/Models/ProfileModel.d.ts +1 -0
  35. package/Core/Namespaces/Profile/Models/Stats/ProfileStatsModel.d.ts +2 -0
  36. package/Core/Namespaces/Profile/Models/Stats/SuccessRatePercent.d.ts +3 -0
  37. package/Core/Namespaces/Profile/Models/Stats/SuccessRates.d.ts +7 -0
  38. package/Core/Namespaces/Profile/Profile.d.ts +1 -0
  39. package/Core/Namespaces/Profile/Service/ProfileService.d.ts +34 -0
  40. package/Core/Namespaces/TopX/Facade/TopXFacade.d.ts +2 -2
  41. package/Core/Namespaces/TopX/TopX.d.ts +1 -1
  42. package/index.js +18 -16
  43. package/index.js.map +3 -3
  44. package/package.json +1 -1
  45. package/Core/Global/BulkBuilder.d.ts +0 -3
@@ -0,0 +1,5 @@
1
+ import { ErrorMessages } from "../Global/Messages/Messages";
2
+ export default class FansUnitedSdkException extends Error {
3
+ constructor(message: ErrorMessages);
4
+ errorMessage: () => string;
5
+ }
@@ -4,3 +4,6 @@ export declare const ID_TYPES: {
4
4
  sportal365: string;
5
5
  enetpulse: string;
6
6
  };
7
+ export declare const documentationLinks: {
8
+ PREDICTOR_USER_RELATED_OPERATION: string;
9
+ };
@@ -0,0 +1,163 @@
1
+ export declare const predictorConfigResponse: {
2
+ data: {
3
+ data: {
4
+ predictor: {
5
+ enabled: boolean;
6
+ markets: {
7
+ main: string[];
8
+ all: string[];
9
+ };
10
+ full_coverage_competitions: string[];
11
+ success_rate_scopes: any;
12
+ };
13
+ };
14
+ };
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
+ };
@@ -9,11 +9,10 @@ export default class ActivityHttps {
9
9
  private instance;
10
10
  private activityRemapper;
11
11
  private apiSignInUrl;
12
- private clientApiSignInUrl;
13
12
  constructor(config: SDKConfiguraitonModel);
14
13
  createActivity: (requestBody: CreateActivityRequestBody) => Promise<ActivityResponseBody>;
15
14
  deleteActivity: (activityId: string) => Promise<boolean>;
16
15
  getOwnActivities: (filters: ActivityFilters, disableCache: boolean) => Promise<PaginationActivities>;
17
16
  getActivitiesForUser: (userId: string, filters: ActivityFilters, disableCache: boolean) => Promise<PaginationActivities>;
18
- getStats: (userId?: string) => Promise<ProfileStatsModel>;
17
+ getStats: (userId?: string, disableCache?: boolean) => Promise<ProfileStatsModel>;
19
18
  }
@@ -1,7 +1,15 @@
1
1
  import SDKConfigurationModel from "../Configurator/Models/SDKConfiguraitonModel";
2
+ import { FeaturesConfigModels } from "../Global/Types/GlobalTypes";
3
+ export declare enum FeatureConfigType {
4
+ PREDICTOR = "predictor",
5
+ TOP_X = "topX",
6
+ MATCH_QUIZ = "matchQuiz",
7
+ LOYALTY = "loyalty"
8
+ }
2
9
  export default class ClientHttps {
3
10
  private instance;
4
11
  private apiSignInUrl;
12
+ private featureConfigRemapper;
5
13
  constructor(config: SDKConfigurationModel);
6
- getConfig: () => Promise<any>;
14
+ getConfig: (feature: FeatureConfigType) => Promise<FeaturesConfigModels>;
7
15
  }
@@ -12,14 +12,13 @@ export default class PredictorHttps {
12
12
  private instanceAuth;
13
13
  private instance;
14
14
  private apiSignInUrl;
15
- private clientApiSignInUrl;
16
15
  private predictionRemapper;
17
16
  private matchSummaryRemapper;
18
17
  private gamesRemapper;
19
18
  private metaRemapper;
20
19
  constructor(config: SDKConfiguraitonModel, idMapping: IdMappingService);
21
20
  makeFootballPrediction: (prediction: PredictionRequestModel | TopXPredictionRequestModel) => Promise<PredictionResponseModel>;
22
- getMatchSummary: (matchId: string) => Promise<MatchSummaryModel>;
21
+ getMatchSummary: (matchId: string, disableCache: boolean) => Promise<MatchSummaryModel>;
23
22
  deleteFootballPrediction: (predictionId: string) => Promise<boolean>;
24
23
  getMyPredictions: (filters?: PredictionsFilters) => Promise<PaginationModel>;
25
24
  getMyPredictionsNoRemap: (filters?: PredictionsFilters) => Promise<any>;
@@ -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
  }
@@ -16,18 +16,15 @@ import MatchFilters from "../Models/Match/MatchFilters";
16
16
  import PlayerFilters from "../Models/Player/PlayerFilters";
17
17
  import SearchFilters from "../Models/Search/SearchFilters";
18
18
  import FootballPaginationModel from "../Models/Pagination/FootballPaginationModel";
19
+ import SDKConfigurationModel from "../../../Configurator/Models/SDKConfiguraitonModel";
19
20
  export default class FootballFacade {
20
- private isBrowser;
21
- private localStorage;
22
- private https;
23
- private idMapping;
24
21
  private countriesFacade;
25
22
  private competitionsFacade;
26
23
  private teamsFacade;
27
24
  private playerFacade;
28
25
  private matchFacade;
29
26
  private searchFacade;
30
- constructor(localStorage: LocalStorage, https: FootballHttps, idMapping: IdMappingService);
27
+ constructor(config: SDKConfigurationModel, localStorage: LocalStorage, https: FootballHttps, idMapping: IdMappingService);
31
28
  getCountries: (disableCache?: boolean) => Promise<FootballCountryModel[]>;
32
29
  getCompetitions: (filters?: CompetitionFilters, disableCache?: boolean) => Promise<CompetitionBasicModel[]>;
33
30
  getCompetitionById: (id: string, disableCache?: boolean) => Promise<CompetitionFullModel>;
@@ -1,3 +1,4 @@
1
+ import SDKConfigurationModel from "../../../Configurator/Models/SDKConfiguraitonModel";
1
2
  import FootballHttps from "../../../Https/FootballHttps";
2
3
  import IdMappingService from "../../../IdMapping/IdMappingService";
3
4
  import MatchFilters from "../Models/Match/MatchFilters";
@@ -6,7 +7,8 @@ import FootballPaginationModel from "../Models/Pagination/FootballPaginationMode
6
7
  export default class MatchFacade {
7
8
  private https;
8
9
  private idMapping;
9
- constructor(https: FootballHttps, idMapping: IdMappingService);
10
+ private footballService;
11
+ constructor(config: SDKConfigurationModel, https: FootballHttps, idMapping: IdMappingService);
10
12
  getMatchesIdMapping: (filters?: MatchFilters, disableCache?: boolean) => Promise<FootballPaginationModel>;
11
13
  private getMatchesWithNativeIds;
12
14
  getMatchesMapWithNativeIds: (matchIds: string[]) => Promise<any>;
@@ -5,10 +5,12 @@ import PlayerFullModel from "../Models/Player/PlayerFullModel";
5
5
  import MatchFullModel from "../Models/Match/MatchFullModel";
6
6
  import PlayerFilters from "../Models/Player/PlayerFilters";
7
7
  import FootballPaginationModel from "../Models/Pagination/FootballPaginationModel";
8
+ import SDKConfigurationModel from "../../../Configurator/Models/SDKConfiguraitonModel";
8
9
  export default class PlayerFacade {
9
10
  private https;
11
+ private footballService;
10
12
  private idMapping;
11
- constructor(https: FootballHttps, idMapping: IdMappingService);
13
+ constructor(config: SDKConfigurationModel, https: FootballHttps, idMapping: IdMappingService);
12
14
  getPlayersIdMapping: (filters?: PlayerFilters, disableCache?: boolean) => Promise<FootballPaginationModel>;
13
15
  getPlayersWithNativeIds: (playerIds: string[]) => Promise<any>;
14
16
  getPlayersMapWithNativeIds: (playerIds: string[]) => Promise<any>;
@@ -5,10 +5,12 @@ import TeamFullModel from "../Models/Team/TeamFullModel";
5
5
  import MatchFullModel from "../Models/Match/MatchFullModel";
6
6
  import TeamFilters from "../Models/Team/TeamFilters";
7
7
  import FootballPaginationModel from "../Models/Pagination/FootballPaginationModel";
8
+ import SDKConfigurationModel from "../../../Configurator/Models/SDKConfiguraitonModel";
8
9
  export default class TeamsFacade {
10
+ private footballService;
9
11
  private https;
10
12
  private idMapping;
11
- constructor(https: FootballHttps, idMapping: IdMappingService);
13
+ constructor(config: SDKConfigurationModel, https: FootballHttps, idMapping: IdMappingService);
12
14
  getTeamsIdMapping: (filters?: TeamFilters, disableCache?: boolean) => Promise<FootballPaginationModel>;
13
15
  private getTeams;
14
16
  getTeamByIdIdMapping: (id: string, disableCache?: boolean) => Promise<TeamFullModel>;
@@ -5,6 +5,7 @@ export default class MatchBasicModel {
5
5
  kickoffAt: string;
6
6
  finishedAt: string;
7
7
  updatedAt: string;
8
+ availableMarkets: string[];
8
9
  homeTeam: TeamBasicModel;
9
10
  awayTeam: TeamBasicModel;
10
11
  lineupsConfirmed: boolean;
@@ -9,6 +9,7 @@ export default class MatchFullModel {
9
9
  kickoffAt: string;
10
10
  finishedAt: string;
11
11
  updatedAt: string;
12
+ availableMarkets: string[];
12
13
  homeTeam: TeamBasicModel;
13
14
  awayTeam: TeamBasicModel;
14
15
  lineupsConfirmed: boolean;
@@ -0,0 +1,12 @@
1
+ import SDKConfigurationModel from "../../../Configurator/Models/SDKConfiguraitonModel";
2
+ import MatchBasicModel from "../Models/Match/MatchBasicModel";
3
+ import MatchFullModel from "../Models/Match/MatchFullModel";
4
+ declare type MatchData = MatchBasicModel[] | MatchFullModel;
5
+ export default class FootballService {
6
+ private clientHttps;
7
+ constructor(config: SDKConfigurationModel);
8
+ setAvailableMarketsForMatch: (matchData: MatchData) => Promise<MatchData>;
9
+ private setAvailableMarkets;
10
+ private isMatchInCoverageCompetition;
11
+ }
12
+ export {};
@@ -3,17 +3,16 @@ import PaginationModel from "../../../Global/Models/Pagination/PaginationModel";
3
3
  import ClientHttps from "../../../Https/ClientHttps";
4
4
  import LoyaltyHttps from "../../../Https/LoyaltyHttps";
5
5
  import LoyaltyFilters from "../Models/Filters/LoyaltyFilters";
6
- import ClientFeaturesModel from "../Models/ClientFeatures/ClientFeaturesModel";
7
6
  import ClientBadges from "../Models/Badges/ClientBadges";
8
7
  import TemplateModel from "../Models/Template/TemplateModel";
8
+ import { FeaturesConfigModels } from "../../../Global/Types/GlobalTypes";
9
9
  export default class LoyaltyFacade {
10
10
  private config;
11
11
  private clientHttps;
12
12
  private loyaltyHttps;
13
- private loyaltyRemapper;
14
13
  private loyaltyService;
15
14
  constructor(config: SDKConfigurationModel, clientHttps: ClientHttps, loyaltyHttps: LoyaltyHttps);
16
- getConfig: () => Promise<ClientFeaturesModel>;
15
+ getConfig: () => Promise<FeaturesConfigModels>;
17
16
  getClientBadges: () => Promise<ClientBadges>;
18
17
  getTemplates: (disableCache?: boolean) => Promise<PaginationModel>;
19
18
  getTemplateById: (templateId: string, disableCache?: boolean) => Promise<TemplateModel>;
@@ -1,15 +1,15 @@
1
1
  import SDKConfigurationModel from "../../Configurator/Models/SDKConfiguraitonModel";
2
2
  import PaginationModel from "../../Global/Models/Pagination/PaginationModel";
3
3
  import LoyaltyFilters from "./Models/Filters/LoyaltyFilters";
4
- import ClientFeaturesModel from "./Models/ClientFeatures/ClientFeaturesModel";
5
4
  import ClientBadges from "./Models/Badges/ClientBadges";
6
5
  import TemplateModel from "./Models/Template/TemplateModel";
6
+ import { FeaturesConfigModels } from "../../Global/Types/GlobalTypes";
7
7
  export default class Loyalty {
8
8
  private clientHttps;
9
9
  private loyaltyHttps;
10
10
  private loyaltyFacade;
11
11
  constructor(config: SDKConfigurationModel);
12
- getConfig: () => Promise<ClientFeaturesModel>;
12
+ getConfig: () => Promise<FeaturesConfigModels>;
13
13
  getClientBadges: () => Promise<ClientBadges>;
14
14
  getTemplates: (disableCache?: boolean) => Promise<PaginationModel>;
15
15
  getTemplateById: (templateId: string, disableCache?: boolean) => Promise<TemplateModel>;
@@ -1,6 +1,6 @@
1
- import ClientFeaturesModel from "./ClientFeaturesModel";
1
+ import LoyaltyConfigModel from "./LoyaltyConfigModel";
2
2
  export default class ClientFeaturesRemapper {
3
- remapConfigResponse: (response: any) => ClientFeaturesModel;
3
+ remapConfigResponse: (response: any) => LoyaltyConfigModel;
4
4
  private remapRewards;
5
5
  private remapPoints;
6
6
  private remapBadges;
@@ -1,6 +1,6 @@
1
1
  import ActionsModel from "../Actions/ActionsModel";
2
2
  import RewardsModel from "../Rewards/RewardsModel";
3
- export default class ClientFeaturesModel {
3
+ export default class LoyaltyConfigModel {
4
4
  enabled: boolean;
5
5
  conditions: {
6
6
  list: string[];
@@ -1,6 +1,7 @@
1
1
  export default class TemplateModel {
2
2
  id: string;
3
3
  name: string;
4
+ description: string;
4
5
  type: string;
5
6
  fromDate: string;
6
7
  toDate: string;
@@ -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 "../../Predictor/Service/PredictorService";
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";
@@ -12,7 +12,6 @@ export default class MatchQuizFacade {
12
12
  private predictorService;
13
13
  private idMapping;
14
14
  private clientHttps;
15
- private featureConfigRemapper;
16
15
  readonly invalidPredictionModelErrorMessage = "The prediction is invalid. Please check again have you passed appropriate prediction model. For more information please visit our offical documentation: \n https://docs.fansunitedmedia.com/sdks/js/match.quiz#gamerelatedoperations";
17
16
  constructor(config: SDKConfigurationModel);
18
17
  getConfig: () => Promise<FeaturesConfigModels>;
@@ -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 "../Predictor/Service/PredictorService";
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";
@@ -5,4 +5,4 @@ export declare enum StatusEnum {
5
5
  PARTIALLY_WON = "PARTIALLY_WON",
6
6
  CANCELED = "CANCELED"
7
7
  }
8
- export declare const pastStatuses: string[];
8
+ export declare const pastStatuses: StatusEnum[];
@@ -2,17 +2,16 @@ import { MarketEnum } from "../Enums/MarketEnum";
2
2
  import ClientHttps from "../../../Https/ClientHttps";
3
3
  import PredictorHttps from "../../../Https/PredictorHttps";
4
4
  import IdMappingService from "../../../IdMapping/IdMappingService";
5
- import FeatureConfigRemapper from "../Models/Config/FeatureConfigRemapper";
6
5
  import MatchSummaryModel from "../Models/Summary/MatchSummaryModel";
7
- import PredictorService, { FeaturesConfigModels } from "../Service/PredictorService";
6
+ import PredictorService from "../Service/PredictorService";
8
7
  import PredictionsFilters from "../Models/Predictions/PredictionsFilters";
9
8
  import SDKConfigurationModel from "../../../Configurator/Models/SDKConfiguraitonModel";
10
9
  import PaginationModel from "../../../Global/Models/Pagination/PaginationModel";
10
+ import { FeaturesConfigModels } from "../../../Global/Types/GlobalTypes";
11
11
  export default class PredictorFacade {
12
12
  readonly predictorHttps: PredictorHttps;
13
13
  readonly clientHttps: ClientHttps;
14
14
  readonly idMapping: IdMappingService;
15
- readonly predictorConfigRemapper: FeatureConfigRemapper;
16
15
  readonly predictorService: PredictorService;
17
16
  readonly invalidPredictionMessage = "The prediction is invalid. Please check again have you passed appropriate prediction argument. For more information visit our official documentation: \n https://docs.fansunitedmedia.com/sdks/js/predictor#matchrelatedoperations";
18
17
  constructor(config: SDKConfigurationModel, predictorHttps: PredictorHttps, clientHttps: ClientHttps, idMapping: IdMappingService);
@@ -28,16 +27,19 @@ export default class PredictorFacade {
28
27
  * Using PredictorService to perform id mapping for matchId in request body. The response body contains all markets in property predictions.
29
28
  * In case there is prediction with player market, it property's name is the player id itself so it will be remaped to idSchema.
30
29
  * @param matchId
30
+ * @param disableCache
31
31
  * @returns Match summary with all predictions for it. Ids are remapped if idSchema is different from native.
32
32
  */
33
- getMatchSummary: (matchId: string) => Promise<MatchSummaryModel>;
34
- getMarketSummary: (matchId: string, market: MarketEnum, playerId?: string) => Promise<any>;
33
+ getMatchSummary: (matchId: string, disableCache: boolean) => Promise<MatchSummaryModel>;
34
+ getMarketSummary: (matchId: string, market: MarketEnum, playerId?: string, disableCache?: boolean) => Promise<any>;
35
35
  getConfig: () => Promise<FeaturesConfigModels>;
36
36
  deleteFootballPrediction: (predictionId: string) => Promise<boolean>;
37
37
  getMyPredictions: (filters?: PredictionsFilters) => Promise<PaginationModel>;
38
+ getMyPredictionsForMatches: (matchIds: string[], filters: PredictionsFilters) => Promise<PaginationModel>;
38
39
  getMyCurrentPredictions: (filters?: PredictionsFilters) => Promise<PaginationModel>;
39
40
  getMyPastPredictions: (filters?: PredictionsFilters) => Promise<PaginationModel>;
40
41
  getUserPredictions: (userId: string, filters?: PredictionsFilters, disableCache?: boolean) => Promise<PaginationModel>;
41
- getUserCurrentPredictions: (userId: string, filters?: PredictionsFilters) => Promise<PaginationModel>;
42
- 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>;
43
45
  }
@@ -1,3 +1,4 @@
1
+ import ClientFeaturesModel from "../../../Loyalty/Models/ClientFeatures/LoyaltyConfigModel";
1
2
  import MatchQuizConfigModel from "../../../MatchQuiz/Models/Config/MatchQuizConfigModel";
2
3
  import TopXConfigModel from "../../../TopX/Models/Config/TopXConfigModel";
3
4
  import PredictorConfigModel from "./PredictorConfigModel";
@@ -5,4 +6,10 @@ export default class FeatureConfigRemapper {
5
6
  remapPredictorConfig: (response: any) => PredictorConfigModel;
6
7
  remapTopXConfig: (response: any) => TopXConfigModel;
7
8
  remapMatchQuizConfig: (response: any) => MatchQuizConfigModel;
9
+ remapLoyaltyConfig: (response: any) => ClientFeaturesModel;
10
+ private remapRewards;
11
+ private remapPoints;
12
+ private remapBadges;
13
+ private remapBadgeValues;
14
+ private remapRequirements;
8
15
  }
@@ -5,6 +5,7 @@ export default class PredictionsFilters {
5
5
  startAfter: string;
6
6
  status: StatusEnum[];
7
7
  type: TypeGames;
8
+ matchIds: string[];
8
9
  constructor(filters: any);
9
10
  constructFiltersUrl: () => string;
10
11
  }
@@ -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 "./Service/PredictorService";
6
+ import { FeaturesConfigModels } from "../../Global/Types/GlobalTypes";
7
7
  export default class Predictor {
8
8
  private predictorHttps;
9
9
  private clientHttps;
@@ -11,14 +11,16 @@ export default class Predictor {
11
11
  private idMapping;
12
12
  constructor(config: SDKConfigurationModel);
13
13
  makeFootballPrediction: (matchId: string, market: MarketEnum, value: any, playerId?: string) => Promise<import("./Models/Predictions/PredictionResponseModel").default>;
14
- getMatchSummary: (matchId: string) => Promise<MatchSummaryModel>;
15
- getMarketSummary: (matchId: string, market: MarketEnum, playerId?: string) => Promise<any>;
14
+ getMatchSummary: (matchId: string, disableCache?: boolean) => Promise<MatchSummaryModel>;
15
+ getMarketSummary: (matchId: string, market: MarketEnum, playerId?: string, disableCache?: boolean) => Promise<any>;
16
16
  getConfig: () => Promise<FeaturesConfigModels>;
17
17
  deleteFootballPrediction: (predictionId: string) => Promise<boolean>;
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
  }