fansunited-sdk-esm 1.5.1 → 1.6.0

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 (27) hide show
  1. package/Core/Exception/ErrorCodes.d.ts +3 -0
  2. package/Core/Exception/ErrorStatuses.d.ts +8 -0
  3. package/Core/Exception/FansUnitedSdkException.d.ts +5 -2
  4. package/Core/Global/Constants/Constants.d.ts +1 -0
  5. package/Core/Global/Messages/Messages.d.ts +8 -1
  6. package/Core/Namespaces/Football/Facades/FootballFacade.d.ts +2 -0
  7. package/Core/Namespaces/Loyalty/Models/Points/PointsModel.d.ts +5 -4
  8. package/Core/Namespaces/Loyalty/Models/Points/PointsValueModel.d.ts +5 -0
  9. package/Core/Namespaces/MatchQuiz/Facade/MatchQuizFacade.d.ts +1 -0
  10. package/Core/Namespaces/MatchQuiz/Models/Games/GamesMatchQuizListModel.d.ts +1 -0
  11. package/Core/Namespaces/Predictor/Facade/PredictorFacade.d.ts +1 -1
  12. package/Core/Namespaces/Predictor/Models/Fixtures/Markets/CorrectScoreFixtureModel.d.ts +1 -0
  13. package/Core/Namespaces/Predictor/Models/Fixtures/Markets/{FullTimeOneXTwoFixtureModel.d.ts → OneXTwoFixtureModel.d.ts} +2 -2
  14. package/Core/Namespaces/Predictor/Service/PredictorService.d.ts +1 -19
  15. package/Core/Namespaces/Predictor/Validator/PredictorValidator.d.ts +111 -0
  16. package/Core/Namespaces/Profile/Builders/OwnProfileBuilder.d.ts +1 -2
  17. package/Core/Namespaces/Profile/Builders/ProfileBuilder.d.ts +2 -5
  18. package/Core/Namespaces/TopX/Facade/TopXFacade.d.ts +2 -0
  19. package/Core/Namespaces/TopX/Models/Games/GamesTopXListModel.d.ts +1 -0
  20. package/Core/Remapper/Profile/ProfileOperations.d.ts +20 -1
  21. package/Core/Remapper/SDKIdsRemapper.d.ts +2 -1
  22. package/index.js +15 -17
  23. package/index.js.map +3 -3
  24. package/package.json +1 -1
  25. package/Core/Namespaces/Loyalty/Models/ClientFeatures/ClientFeaturesRemapper.d.ts +0 -9
  26. package/Core/Namespaces/Predictor/Models/Fixtures/Markets/HalfTimeOneXTwoFixtureModel.d.ts +0 -10
  27. package/Core/Namespaces/Profile/Interests/InterestsService.d.ts +0 -26
@@ -0,0 +1,3 @@
1
+ export declare enum ErrorCodes {
2
+ BAD_METHOD_CALL = 400
3
+ }
@@ -0,0 +1,8 @@
1
+ export declare enum ErrorStatuses {
2
+ INVALID_TEMPLATE = "INVALID_TEMPLATE",
3
+ INVALID_PREDICTION = "INVALID_PREDICTION",
4
+ INVALID_MARKET = "INVALID_MARKET",
5
+ INVALID_FIELD = "INVALID_FIELD",
6
+ INVALID_TYPE = "INVALID_TYPE",
7
+ EXCEEDED_LENGTH = "EXCEEDED_LENGTH"
8
+ }
@@ -1,5 +1,8 @@
1
- import { ErrorMessages } from "../Global/Messages/Messages";
1
+ import { ErrorStatuses } from "./ErrorStatuses";
2
2
  export default class FansUnitedSdkException extends Error {
3
- constructor(message: ErrorMessages);
3
+ code: number;
4
+ status: ErrorStatuses;
5
+ message: string;
6
+ constructor(code: number, status: ErrorStatuses, message: string);
4
7
  errorMessage: () => string;
5
8
  }
@@ -7,3 +7,4 @@ export declare const ID_TYPES: {
7
7
  export declare const documentationLinks: {
8
8
  PREDICTOR_USER_RELATED_OPERATION: string;
9
9
  };
10
+ export declare const validFixtureFields: string[];
@@ -1,11 +1,18 @@
1
+ import { MarketEnum } from "../../Namespaces/Predictor/Enums/MarketEnum";
1
2
  export declare enum ErrorMessages {
2
3
  LOYALTY_INVALID_TEMPLATE_ID = "Provided template ID does NOT exist! Try again with existing template ID.",
3
4
  INVALID_MATCH_ID = "Match id is invalid!",
4
5
  INVALID_PLAYER_ID = "Player id is invalid!",
5
6
  QUERY_PARAM_MATCH_IDS_EXCEEDED = "Maximum matchIds in PredictionFilters should be 10 or less.",
6
- INVALID_PREDICTION_MODEL = "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"
7
+ INVALID_PREDICTION_FIELD = "Prediction field is invalid. For more information please visit our documentation"
7
8
  }
8
9
  export declare const WarningMessages: {
9
10
  UNEXPECTED_STATUS_PROP: string;
10
11
  UNEXPECTED_TYPE_PROP: string;
11
12
  };
13
+ export declare const invalidPredictionMessage: (prediction: string, market: MarketEnum) => string;
14
+ export declare const invalidMarketMessage: (market: string) => string;
15
+ export declare const invalidMarketTopXMessage: (market: string) => string;
16
+ export declare const invalidFieldMessage: (fields: string[]) => string;
17
+ export declare const missingFieldsMessage: (field: string, missingFields: string[]) => string;
18
+ export declare const invalidTypeMessage: (field: string, correctType: string) => string;
@@ -17,6 +17,7 @@ import PlayerFilters from "../Models/Player/PlayerFilters";
17
17
  import SearchFilters from "../Models/Search/SearchFilters";
18
18
  import FootballPaginationModel from "../Models/Pagination/FootballPaginationModel";
19
19
  import SDKConfigurationModel from "../../../Configurator/Models/SDKConfiguraitonModel";
20
+ import PlayerBasicModel from "../Models/Player/PlayerBasicModel";
20
21
  export default class FootballFacade {
21
22
  private countriesFacade;
22
23
  private competitionsFacade;
@@ -41,6 +42,7 @@ export default class FootballFacade {
41
42
  getTopPlayers: (disableCache?: boolean) => Promise<TopPlayerModel[]>;
42
43
  getNextMatchForPlayer: (id: string, disableCache?: boolean) => Promise<MatchFullModel>;
43
44
  getPrevMatchForPlayer: (id: string, disableCache?: boolean) => Promise<MatchFullModel>;
45
+ getPlayersMapWithNativeIds: (playerIds: string[]) => Promise<Map<string, PlayerBasicModel>>;
44
46
  getMatches: (filters?: MatchFilters, disableCache?: boolean) => Promise<FootballPaginationModel>;
45
47
  getMatchById: (id: string, disableCache?: boolean) => Promise<MatchFullModel>;
46
48
  search: (filters: SearchFilters, disableCache?: boolean) => Promise<SearchModel>;
@@ -1,9 +1,10 @@
1
- import ActionValueModel from "../Actions/ActionValueModel";
2
1
  import Points from "./Points";
2
+ import PointsValueModel from "./PointsValueModel";
3
3
  export default class PointsModel {
4
4
  general: Points[];
5
5
  comments: any[];
6
- predictor: ActionValueModel[];
7
- activity: ActionValueModel[];
8
- topX: ActionValueModel[];
6
+ predictor: PointsValueModel[];
7
+ activity: PointsValueModel[];
8
+ topX: PointsValueModel[];
9
+ matchQuiz: PointsValueModel[];
9
10
  }
@@ -0,0 +1,5 @@
1
+ import ActionValueModel from "../Actions/ActionValueModel";
2
+ export default class PointsValueModel extends ActionValueModel {
3
+ points: number;
4
+ constructor();
5
+ }
@@ -13,6 +13,7 @@ export default class MatchQuizFacade {
13
13
  private predictorService;
14
14
  private idMapping;
15
15
  private clientHttps;
16
+ private predictorValidator;
16
17
  constructor(config: SDKConfigurationModel);
17
18
  getConfig: () => Promise<FeaturesConfigModels>;
18
19
  play: (matchQuizPrediction: PredictionRequestModel) => Promise<PredictionResponseModel>;
@@ -8,6 +8,7 @@ export default class GamesMatchQuizListModel {
8
8
  outcome: string;
9
9
  predictionsCutoff: string;
10
10
  fixtures: FixturesMatchQuizModel[];
11
+ predictionId: string;
11
12
  rules: string;
12
13
  flags: string[];
13
14
  points: number;
@@ -13,7 +13,7 @@ export default class PredictorFacade {
13
13
  readonly clientHttps: ClientHttps;
14
14
  readonly idMapping: IdMappingService;
15
15
  readonly predictorService: PredictorService;
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";
16
+ private predictorValidator;
17
17
  constructor(config: SDKConfigurationModel, predictorHttps: PredictorHttps, clientHttps: ClientHttps, idMapping: IdMappingService);
18
18
  /**
19
19
  * Exposing PredictorService for two operations:
@@ -4,6 +4,7 @@ import FixturesModel from "../FixturesModel";
4
4
  export default class CorrectScoreFixtureModel implements FixturesModel {
5
5
  matchId: string;
6
6
  market: MarketEnum;
7
+ matchType: string;
7
8
  prediction: ValueCorrectScore;
8
9
  constructor(matchId: string, value: string);
9
10
  }
@@ -2,9 +2,9 @@ import FixturesModel from "../FixturesModel";
2
2
  import ValueOneXTwo from "../../Value/ValueOneXTwo";
3
3
  import { MarketEnum } from "../../../Enums/MarketEnum";
4
4
  import { OneXTwoEnum } from "../../../Enums/ValueEnums";
5
- export default class FullTimeOneXTwoFixtureModel implements FixturesModel {
5
+ export default class OneXTwoFixtureModel implements FixturesModel {
6
6
  matchId: string;
7
7
  market: MarketEnum;
8
8
  prediction: ValueOneXTwo;
9
- constructor(matchId: string, value: OneXTwoEnum);
9
+ constructor(matchId: string, market: MarketEnum, value: OneXTwoEnum);
10
10
  }
@@ -1,19 +1,6 @@
1
1
  import { MarketEnum } from "../Enums/MarketEnum";
2
2
  import IdMappingService from "../../../IdMapping/IdMappingService";
3
3
  import PredictionsModel from "../Models/Predictions/PredictionsModel";
4
- import HalfTimeFullTimeFixtureModel from "../Models/Fixtures/Markets/HalfTimeFullTimeFixtureModel";
5
- import DoubleChanceFixtureModel from "../Models/Fixtures/Markets/DoubleChanceFixtureModel";
6
- import FullTimeOneXTwoFixtureModel from "../Models/Fixtures/Markets/FullTimeOneXTwoFixtureModel";
7
- import CorrectScoreFixtureModel from "../Models/Fixtures/Markets/CorrectScoreFixtureModel";
8
- import HalfTimeOneXTwoFixtureModel from "../Models/Fixtures/Markets/HalfTimeOneXTwoFixtureModel";
9
- import CornersFixtureModel from "../Models/Fixtures/Markets/CornersFixtureModel";
10
- import PlayerFixtureModel from "../Models/Fixtures/Markets/PlayerFixtureModel";
11
- import BothTeamsFixtureModel from "../Models/Fixtures/Markets/BothTeamsFixtureModel";
12
- import RedCardFixtureModel from "../Models/Fixtures/Markets/RedCardFixtureModel";
13
- import PenaltyMatchFixtureModel from "../Models/Fixtures/Markets/PenaltyMatchFixtureModel";
14
- import OverGoalsFixtureModel from "../Models/Fixtures/Markets/OverGoalsFixtureModel";
15
- import OverCornersFixtureModel from "../Models/Fixtures/Markets/OverCornersFixtureModel";
16
- import MatchSummaryModel from "../Models/Summary/MatchSummaryModel";
17
4
  import SDKConfigurationModel from "../../../Configurator/Models/SDKConfiguraitonModel";
18
5
  import PredictionsFilters from "../Models/Predictions/PredictionsFilters";
19
6
  import { TypeGames } from "../../TopX/Types/TypeGames";
@@ -21,6 +8,7 @@ import GamesFilters from "../../TopX/Models/Games/GamesFilters";
21
8
  import PaginationModel from "../../../Global/Models/Pagination/PaginationModel";
22
9
  import { FeaturesConfigModels, FilterCase } from "../../../Global/Types/GlobalTypes";
23
10
  import GameMarketsResults from "../../MatchQuiz/Models/GameMarketsResults/GameMarketsResults";
11
+ import MatchSummaryModel from "../Models/Summary/MatchSummaryModel";
24
12
  export default class PredictorService {
25
13
  private footballHttps;
26
14
  private idMapping;
@@ -48,12 +36,6 @@ export default class PredictorService {
48
36
  * @returns Market that fits response model
49
37
  */
50
38
  convertMarketForResponseModel: (market: any, target: number) => string;
51
- /**
52
- * Checks market of the fixture and returns new object type.
53
- * @param fixture
54
- * @returns Fixture model.
55
- */
56
- validateFixture: (matchId: string, market: MarketEnum, value: any, playerId?: string) => PlayerFixtureModel | CorrectScoreFixtureModel | OverCornersFixtureModel | OverGoalsFixtureModel | HalfTimeFullTimeFixtureModel | DoubleChanceFixtureModel | FullTimeOneXTwoFixtureModel | HalfTimeOneXTwoFixtureModel | CornersFixtureModel | BothTeamsFixtureModel | RedCardFixtureModel | PenaltyMatchFixtureModel;
57
39
  getMarketSummary: (matchSummary: MatchSummaryModel, market: MarketEnum, playerId?: string) => any;
58
40
  remapCompetitionsFromConfig: (config: FeaturesConfigModels) => Promise<FeaturesConfigModels>;
59
41
  /**
@@ -0,0 +1,111 @@
1
+ import { MarketEnum } from "../Enums/MarketEnum";
2
+ import BothTeamsFixtureModel from "../Models/Fixtures/Markets/BothTeamsFixtureModel";
3
+ import CornersFixtureModel from "../Models/Fixtures/Markets/CornersFixtureModel";
4
+ import CorrectScoreFixtureModel from "../Models/Fixtures/Markets/CorrectScoreFixtureModel";
5
+ import DoubleChanceFixtureModel from "../Models/Fixtures/Markets/DoubleChanceFixtureModel";
6
+ import OneXTwoFixtureModel from "../Models/Fixtures/Markets/OneXTwoFixtureModel";
7
+ import HalfTimeFullTimeFixtureModel from "../Models/Fixtures/Markets/HalfTimeFullTimeFixtureModel";
8
+ import OverCornersFixtureModel from "../Models/Fixtures/Markets/OverCornersFixtureModel";
9
+ import OverGoalsFixtureModel from "../Models/Fixtures/Markets/OverGoalsFixtureModel";
10
+ import PenaltyMatchFixtureModel from "../Models/Fixtures/Markets/PenaltyMatchFixtureModel";
11
+ import PlayerFixtureModel from "../Models/Fixtures/Markets/PlayerFixtureModel";
12
+ import RedCardFixtureModel from "../Models/Fixtures/Markets/RedCardFixtureModel";
13
+ import PredictionRequestModel from "../Models/Predictions/PredictionRequestModel";
14
+ import { TypeGames } from "../../TopX/Types/TypeGames";
15
+ import TopXPredictionRequestModel from "../../TopX/Models/Prediction/TopXPredictionRequestModel";
16
+ export default class PredictorValidator {
17
+ /**
18
+ * Validate all field for game prediction (Top X and Match Quiz). The following cases are covered:
19
+ * 1. Unsupported field is provided (Top X and Match Quiz)
20
+ * 2. Validates tiebreak if is provided (Top X)
21
+ * 3. Validates missing required fields for game request body
22
+ * 4. Validates fixtures
23
+ * @param gameType MATCH_QUIZ, TOP_X and SINGLE. In our case we will use only MATCH_QUIZ and TOP_X.
24
+ * @param param Game request body.
25
+ * @returns Game request body if is valid. If not throws specific message.
26
+ */
27
+ validateBodyFields: (gameType: TypeGames, param: PredictionRequestModel | TopXPredictionRequestModel) => PredictionRequestModel | TopXPredictionRequestModel;
28
+ /**
29
+ * Constructs object types for specific markets. This is done for easier reconstructing when sending the request
30
+ * body to API. Validates the following cases:
31
+ * 1. Market is valid.
32
+ * 2. Prediction is a valid one for the specific market
33
+ * 3. Regex test for CORRECT_SCORE market prediction (String(int:int))
34
+ * 4. Validates playerId except for nobody market (PLAYER_SCORE_FIRST_GOAL)
35
+ * @param matchId Match ID to predict.
36
+ * @param market Market to predict
37
+ * @param prediction The value of prediction.
38
+ * @param playerId Optional. Used only for player markets.
39
+ * @returns Specific type of fixture.
40
+ */
41
+ validateFixture: (matchId: string, market: MarketEnum, prediction: any, playerId?: string) => PlayerFixtureModel | CorrectScoreFixtureModel | OverCornersFixtureModel | OverGoalsFixtureModel | BothTeamsFixtureModel | CornersFixtureModel | DoubleChanceFixtureModel | OneXTwoFixtureModel | HalfTimeFullTimeFixtureModel | PenaltyMatchFixtureModel | RedCardFixtureModel;
42
+ /**
43
+ * Validate fixture fields. Throws exception for the following cases:
44
+ * 1. When invalid field is provided
45
+ * 2. When required field is missing
46
+ * @param fixture Fixture fields to validate.
47
+ */
48
+ private validateFixtureFields;
49
+ /**
50
+ * Validates tiebreaker if provided (Top X). Throws exception for the following cases:
51
+ * 1. If tiebreaker is not an object
52
+ * 2. If the keys in tiebreaker object are incorrect
53
+ * 3. If the required key is missing
54
+ * 4. If the required key is invalid type
55
+ * @param tiebreaker Tiebreaker for Top X prediciton.
56
+ */
57
+ private validateTiebreaker;
58
+ /**
59
+ * Validates prediction in every fixture. Throws for the following cases:
60
+ * 1. When prediction is rather than object type
61
+ * 2. When field 'value' is missing
62
+ * 3. When field rather than 'value' is provided
63
+ * 4. When invalid fields are provided
64
+ * @param market Market of fixture
65
+ * @param prediction Prediction of fixture
66
+ */
67
+ private validatePredictionKey;
68
+ /**
69
+ * Validates player ID for all related player markets EXCEPT PLAYER_SCORE_FIRST_GOAL. The following cases are covered:
70
+ * 1. playerId is falsy value
71
+ * 2. playerId is invalid type
72
+ * @param market Player market.
73
+ * @param playerId Player ID.
74
+ */
75
+ private validatePlayerId;
76
+ /**
77
+ * Validates the market of every fixture. The market should contain in the enumerated list.
78
+ * @param market Market of fixture.
79
+ */
80
+ private validateMarket;
81
+ /**
82
+ * Validates the market for Top X Game.
83
+ */
84
+ private validateMarketTopX;
85
+ /**
86
+ * Used for type check for prediction field in fixture.
87
+ * @param prediction Fixture's prediction
88
+ * @returns True or false.
89
+ */
90
+ private isPredictionBoolean;
91
+ /**
92
+ * Throws exception for invalid prediction for specific market.
93
+ */
94
+ private throwInvalidPredictionException;
95
+ /**
96
+ * Throws exception when provided market is not supported from Fans United.
97
+ */
98
+ private throwInvalidMarketException;
99
+ /**
100
+ * Throws exception for invalid fields.
101
+ */
102
+ private throwInvalidParamException;
103
+ /**
104
+ * Throws exception for missing fields.
105
+ */
106
+ private throwMissingFieldsException;
107
+ /**
108
+ * Throws exception for field invalid type.
109
+ */
110
+ private throwInvalidType;
111
+ }
@@ -17,7 +17,6 @@ export default class OwnProfileBuilder {
17
17
  private profileService;
18
18
  private localStorage;
19
19
  private profileFacade;
20
- private interestsService;
21
20
  private ownProfile;
22
21
  private modified;
23
22
  private expireAt;
@@ -29,7 +28,7 @@ export default class OwnProfileBuilder {
29
28
  private setOwnProfile;
30
29
  getInfo: () => Promise<ProfileModel>;
31
30
  showInterests: () => Promise<InterestModel[]>;
32
- showFullInterests: () => Promise<any[]>;
31
+ showFullInterests: () => Promise<InterestModel[]>;
33
32
  getFollowers: (filters?: FollowFilters) => Promise<PaginationModel>;
34
33
  getFollowing: (filters?: FollowFilters) => Promise<PaginationModel>;
35
34
  follow: (profiles: string[]) => Promise<FollowingModel[]>;
@@ -3,8 +3,6 @@ import PaginationModel from "../../../Global/Models/Pagination/PaginationModel";
3
3
  import SDKIdsRemapper from "../../../Remapper/SDKIdsRemapper";
4
4
  import ActivityHttps from "../../../Https/ActivityHttps";
5
5
  import ProfileHttps from "../../../Https/ProfileHttps";
6
- import IdMappingService from "../../../IdMapping/IdMappingService";
7
- import FootballFacade from "../../Football/Facades/FootballFacade";
8
6
  import FollowFilters from "../Models/FollowFilters";
9
7
  import FullnessProfile from "../Models/FullnessProfile/FullnessProfile";
10
8
  import InterestModel from "../Models/InterestModel";
@@ -15,14 +13,13 @@ export default class ProfileBuilder {
15
13
  private profileHttps;
16
14
  private activityHttps;
17
15
  private profileFacade;
18
- private interestsService;
19
16
  private profileId;
20
- constructor(idsRemapper: SDKIdsRemapper, localStorage: LocalStorage, profileHttps: ProfileHttps, activityHttps: ActivityHttps, idMapping: IdMappingService, footballFacade: FootballFacade);
17
+ constructor(idsRemapper: SDKIdsRemapper, localStorage: LocalStorage, profileHttps: ProfileHttps, activityHttps: ActivityHttps);
21
18
  setId: (id: string) => this;
22
19
  private getProfile;
23
20
  getInfo: () => Promise<ProfileModel>;
24
21
  showInterests: () => Promise<InterestModel[]>;
25
- showFullInterests: () => Promise<any[]>;
22
+ showFullInterests: () => Promise<InterestModel[]>;
26
23
  getFollowers: (filters?: FollowFilters) => Promise<PaginationModel>;
27
24
  getFollowing: (filters?: FollowFilters) => Promise<PaginationModel>;
28
25
  showFullnessProfile: () => Promise<FullnessProfile>;
@@ -10,10 +10,12 @@ import TopXPredictionRequestModel from "../Models/Prediction/TopXPredictionReque
10
10
  import PredictionsFilters from "../../Predictor/Models/Predictions/PredictionsFilters";
11
11
  import { FeaturesConfigModels } from "../../../Global/Types/GlobalTypes";
12
12
  import GameMarketsResults from "../../MatchQuiz/Models/GameMarketsResults/GameMarketsResults";
13
+ import PredictorValidator from "../../Predictor/Validator/PredictorValidator";
13
14
  export default class TopXFacade {
14
15
  readonly idMapping: IdMappingService;
15
16
  readonly predictorHttps: PredictorHttps;
16
17
  readonly predictorService: PredictorService;
18
+ readonly predictorValidator: PredictorValidator;
17
19
  private clientHttps;
18
20
  constructor(config: SDKConfigurationModel, idMapping: IdMappingService);
19
21
  getConfig: () => Promise<FeaturesConfigModels>;
@@ -8,6 +8,7 @@ export default class GamesTopXListModel {
8
8
  outcome: string;
9
9
  predictionsCutoff: string;
10
10
  fixtures: FixturesTopXModel[];
11
+ predictionId: string;
11
12
  rules: string;
12
13
  flags: string[];
13
14
  points: number;
@@ -42,11 +42,30 @@ export default class ProfileOperations {
42
42
  remapInterestToNative: (interest: InterestModel) => Promise<InterestModel>;
43
43
  /**
44
44
  * Extracting custom interests from list of interests in profile.
45
+ * @param interests
46
+ * @returns Custom interests.
47
+ */
48
+ private inquiryCustomInterests;
49
+ /**
45
50
  * We are using this function when we want to show interests from profile.
46
51
  * @param interests
47
52
  * @returns Utilizing @function remapInterestsToIdSchema for remapping to idSchema.
48
53
  */
49
- inquiryCustomInterests: (interests: InterestModel[]) => Promise<InterestModel[]>;
54
+ remapInterests: (interests: InterestModel[]) => Promise<InterestModel[]>;
55
+ /**
56
+ * In case we have custom interest we don't remap the id. When the id for the entity is not remaped successfully or
57
+ * is not found in Football API, the model is set to null.
58
+ * @param interests
59
+ * @returns Details for each interest in profile
60
+ */
61
+ showFullInterests: (interests: InterestModel[]) => Promise<any[]>;
62
+ /**
63
+ * Using FootballFacade to get information for teams, players or competitions with remapped ids.
64
+ * Fetch entities models from Football Facade and return them as type: { entityId: model }.
65
+ * @param interests Profile interests containing entitie native ids.
66
+ * @returns A Map value of key entity native ID and value entity model.
67
+ */
68
+ private getInterestsEntitiesMap;
50
69
  /**
51
70
  * Calls id mapping facade to fetch id entities from storage or Id Mapping API.
52
71
  * @param idsObj Object which key is entity and value is string array of ids.
@@ -8,5 +8,6 @@ export default class SDKIdsRemapper {
8
8
  constructor(config: SDKConfigurationModel, footballFacade: FootballFacade);
9
9
  remapSuccessRatesEntities: (profileStats: ProfileStatsModel) => Promise<ProfileStatsModel>;
10
10
  remapInterestToNative: (interest: InterestModel) => Promise<InterestModel>;
11
- inquiryCustomInterests: (interests: InterestModel[]) => Promise<InterestModel[]>;
11
+ remapInterests: (interests: InterestModel[]) => Promise<InterestModel[]>;
12
+ showFullInterests: (interests: InterestModel[]) => Promise<InterestModel[]>;
12
13
  }