fansunited-sdk-esm 1.18.4 → 1.20.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.
@@ -1,4 +1,4 @@
1
- export default class RelatedGame {
1
+ export default class RelatedEntity {
2
2
  entityId: string;
3
3
  entityType: string;
4
4
  }
@@ -10,6 +10,7 @@ import GamesListModel from "../Namespaces/TopX/Models/Games/GamesListModel";
10
10
  import PaginationModel from "../Global/Models/Pagination/PaginationModel";
11
11
  import MainFiltersBQ from "../Global/Models/Filters/MainFiltersBQ";
12
12
  import Https from "./Https";
13
+ import ContestWinners from "../Namespaces/TopX/Models/Games/Winners/ContestWinners";
13
14
  export default class PredictorHttps extends Https {
14
15
  private apiSignInUrl;
15
16
  private predictionRemapper;
@@ -30,4 +31,5 @@ export default class PredictorHttps extends Https {
30
31
  getUserGameEditions: (filters: GamesFilters, disableCache: boolean) => Promise<PaginationModel>;
31
32
  getGameResults: (gameId: string, disableCache: boolean, filters?: MainFiltersBQ) => Promise<PaginationModel>;
32
33
  getMarketResultsForGame: (gameId: string, disableCache: boolean) => Promise<import("../Namespaces/MatchQuiz/Models/GameMarketsResults/GameMarketsResults").default>;
34
+ getContestWinners: (gameId: string) => Promise<ContestWinners>;
33
35
  }
@@ -11,6 +11,7 @@ import FootballPaginationModel from "../../Football/Models/Pagination/FootballPa
11
11
  import ProfileHttps from "../../../Https/ProfileHttps";
12
12
  import LocalStorage from "../../../Global/LocalStorage";
13
13
  import HighestSuccessRateModel from "../Models/HighestSuccessRate/HighestSuccessRateModel";
14
+ import ContestWinners from "../../TopX/Models/Games/Winners/ContestWinners";
14
15
  export default class LoyaltyFacade {
15
16
  private config;
16
17
  private clientHttps;
@@ -21,6 +22,7 @@ export default class LoyaltyFacade {
21
22
  private idMapping;
22
23
  private topXFacade;
23
24
  private matchQuizFacade;
25
+ private predictorHttps;
24
26
  constructor(config: SDKConfigurationModel, clientHttps: ClientHttps, loyaltyHttps: LoyaltyHttps, profileHttps: ProfileHttps, localStorage: LocalStorage);
25
27
  getConfig: () => Promise<FeaturesConfigModels>;
26
28
  getClientBadges: () => Promise<ClientBadges>;
@@ -31,5 +33,6 @@ export default class LoyaltyFacade {
31
33
  getOwnRankings: (filters?: RankingsFilters, disableCache?: boolean) => Promise<FootballPaginationModel>;
32
34
  getUserRankings: (userId: string, filters?: RankingsFilters, disableCache?: boolean) => Promise<FootballPaginationModel>;
33
35
  getHighestSuccessRate: (market: string, disableCache: boolean) => Promise<HighestSuccessRateModel[]>;
36
+ getTemplateWinners: (templateId: string) => Promise<ContestWinners>;
34
37
  private getModelsForUserRankings;
35
38
  }
@@ -6,6 +6,7 @@ import TemplateModel from "./Models/Template/TemplateModel";
6
6
  import { FeaturesConfigModels } from "../../Global/Types/GlobalTypes";
7
7
  import RankingsFilters from "./Models/Filters/RankingsFilters";
8
8
  import HighestSuccessRateModel from "./Models/HighestSuccessRate/HighestSuccessRateModel";
9
+ import ContestWinners from "../TopX/Models/Games/Winners/ContestWinners";
9
10
  export default class Loyalty {
10
11
  private clientHttps;
11
12
  private profileHttps;
@@ -22,4 +23,5 @@ export default class Loyalty {
22
23
  getOwnRankings: (filters?: RankingsFilters, disableCache?: boolean) => Promise<import("../Football/Models/Pagination/FootballPaginationModel").default>;
23
24
  getUserRankings: (userId: string, filters?: RankingsFilters, disableCache?: boolean) => Promise<import("../Football/Models/Pagination/FootballPaginationModel").default>;
24
25
  getHighestSuccessRate: (market?: string, disableCache?: boolean) => Promise<HighestSuccessRateModel[]>;
26
+ getTemplateWinners: (templateId: string) => Promise<ContestWinners>;
25
27
  }
@@ -1,4 +1,5 @@
1
1
  import ImagesModel from "../../../../Global/Models/Images/ImagesModel";
2
+ import RelatedEntity from "../../../../Global/Models/Related/RelatedEntity";
2
3
  import { LeaderboardStatus } from "../../Types/LoyaltyTypes";
3
4
  export default class TemplateModel {
4
5
  id: string;
@@ -19,4 +20,7 @@ export default class TemplateModel {
19
20
  images: ImagesModel;
20
21
  status: LeaderboardStatus;
21
22
  automaticallyChangeStatus: boolean;
23
+ createdAt: string;
24
+ updatedAt: string;
25
+ related: RelatedEntity[];
22
26
  }
@@ -2,4 +2,5 @@ import TemplateModel from "./TemplateModel";
2
2
  export default class TemplateRemapper {
3
3
  remapResponse: (response: any[]) => TemplateModel[];
4
4
  remapMeta: (meta: any) => any;
5
+ private remapRelated;
5
6
  }
@@ -1,6 +1,7 @@
1
1
  import SDKConfigurationModel from "../../../Configurator/Models/SDKConfiguraitonModel";
2
2
  import FootballPaginationModel from "../../Football/Models/Pagination/FootballPaginationModel";
3
3
  import GamesListModel from "../../TopX/Models/Games/GamesListModel";
4
+ import ContestWinners from "../../TopX/Models/Games/Winners/ContestWinners";
4
5
  import BadgesModel from "../Models/Badges/BadgesModel";
5
6
  import ClientBadges from "../Models/Badges/ClientBadges";
6
7
  import HighestSuccessRateModel from "../Models/HighestSuccessRate/HighestSuccessRateModel";
@@ -19,5 +20,6 @@ export default class LoyaltyService {
19
20
  addProfileModelToHighestSuccessRate: (highestSuccessRate: HighestSuccessRateModel[]) => Promise<HighestSuccessRateModel[]>;
20
21
  extractRankingsIdsMap: (rankings: RankingsModel[]) => string[][];
21
22
  setModelsForUserRankings: (topXGames: GamesListModel[], matchQuizGames: GamesListModel[], templates: TemplateModel[], userRankings: FootballPaginationModel) => FootballPaginationModel;
23
+ completeContestWinners: (contestWinners: ContestWinners) => Promise<ContestWinners>;
22
24
  private extractEnabledBadgesId;
23
25
  }
@@ -9,6 +9,7 @@ import GamesFilters from "../../TopX/Models/Games/GamesFilters";
9
9
  import GamesListModel from "../../TopX/Models/Games/GamesListModel";
10
10
  import GameMarketsResults from "../Models/GameMarketsResults/GameMarketsResults";
11
11
  import MainFiltersBQ from "../../../Global/Models/Filters/MainFiltersBQ";
12
+ import ContestWinners from "../../TopX/Models/Games/Winners/ContestWinners";
12
13
  export default class MatchQuizFacade {
13
14
  private predictorHttps;
14
15
  private predictorService;
@@ -29,6 +30,7 @@ export default class MatchQuizFacade {
29
30
  getUserGameEditions: (userId: string, filters?: MainFiltersBQ, disableCache?: boolean) => Promise<PaginationModel>;
30
31
  getUserGamePrediction: (userId: string, gameId: string, disableCache?: boolean) => Promise<PredictionResponseModel>;
31
32
  getMarketsResultsForGame: (gameId: string, disableCache?: boolean) => Promise<GameMarketsResults>;
33
+ getGameWinners: (gameId: string) => Promise<ContestWinners>;
32
34
  /**
33
35
  * To prevent passing too long URL for fetching data from Predictor API, the maximum limit is set to 50
34
36
  */
@@ -9,6 +9,7 @@ import GamesFilters from "../TopX/Models/Games/GamesFilters";
9
9
  import GamesListModel from "../TopX/Models/Games/GamesListModel";
10
10
  import GameMarketsResults from "./Models/GameMarketsResults/GameMarketsResults";
11
11
  import MainFiltersBQ from "../../Global/Models/Filters/MainFiltersBQ";
12
+ import ContestWinners from "../TopX/Models/Games/Winners/ContestWinners";
12
13
  export default class MatchQuiz {
13
14
  private matchQuizFacade;
14
15
  constructor(config: SDKConfigurationModel);
@@ -25,4 +26,5 @@ export default class MatchQuiz {
25
26
  getUserGameEditions: (userId: string, filters?: MainFiltersBQ, disableCache?: boolean) => Promise<PaginationModel>;
26
27
  getUserGamePrediction: (userId: string, gameId: string, disableCache?: boolean) => Promise<PredictionResponseModel>;
27
28
  getMarketsResultsForGame: (gameId: string, disableCache?: boolean) => Promise<GameMarketsResults>;
29
+ getGameWinners: (gameId: string) => Promise<ContestWinners>;
28
30
  }
@@ -1,5 +1,5 @@
1
1
  import ImagesModel from "../../../../Global/Models/Images/ImagesModel";
2
- import RelatedGame from "../../../TopX/Models/Games/RelatedGame";
2
+ import RelatedEntity from "../../../../Global/Models/Related/RelatedEntity";
3
3
  import TimeTiebreaker from "../../../TopX/Models/Games/TimeTiebreaker";
4
4
  import FixturesMatchQuizModel from "../Fixtures/FixturesMatchQuizModel";
5
5
  export default class GamesMatchQuizListModel {
@@ -14,7 +14,7 @@ export default class GamesMatchQuizListModel {
14
14
  tiebreaker: TimeTiebreaker;
15
15
  predictionId: string;
16
16
  participantsCount: number;
17
- related: RelatedGame[];
17
+ related: RelatedEntity[];
18
18
  excludedProfileIds: string[];
19
19
  rules: string;
20
20
  flags: string[];
@@ -32,6 +32,7 @@ export default class PredictorFacade {
32
32
  */
33
33
  getMatchSummary: (matchId: string, disableCache: boolean) => Promise<MatchSummaryModel>;
34
34
  getMarketSummary: (matchId: string, market: MarketEnum, playerId?: string, disableCache?: boolean) => Promise<any>;
35
+ private getMatchSummaryBase;
35
36
  getConfig: () => Promise<FeaturesConfigModels>;
36
37
  deleteFootballPrediction: (predictionId: string) => Promise<boolean>;
37
38
  getMyPredictions: (filters?: PredictionsFilters) => Promise<PaginationModel>;
@@ -10,11 +10,13 @@ import { FeaturesConfigModels, FilterCase } from "../../../Global/Types/GlobalTy
10
10
  import GameMarketsResults from "../../MatchQuiz/Models/GameMarketsResults/GameMarketsResults";
11
11
  import MatchSummaryModel from "../Models/Summary/MatchSummaryModel";
12
12
  import MainFiltersBQ from "../../../Global/Models/Filters/MainFiltersBQ";
13
+ import ContestWinners from "../../TopX/Models/Games/Winners/ContestWinners";
13
14
  export default class PredictorService {
14
15
  private footballHttps;
15
16
  private idMapping;
16
17
  private matchFacade;
17
18
  private playerFacade;
19
+ private profileNamespace;
18
20
  constructor(config: SDKConfigurationModel, idMapping: IdMappingService);
19
21
  remapMatchIdToNative: (matchIds: string[]) => Promise<string[]>;
20
22
  remapPlayerIdToNative: (playerIds: string[]) => Promise<any>;
@@ -37,7 +39,7 @@ export default class PredictorService {
37
39
  * @returns Market that fits response model
38
40
  */
39
41
  convertMarketForResponseModel: (market: any, target: number) => string;
40
- getMarketSummary: (matchSummary: MatchSummaryModel, market: MarketEnum, playerId?: string) => any;
42
+ getMarketSummary: (matchSummary: MatchSummaryModel, market: MarketEnum, playerId?: string) => Promise<any>;
41
43
  remapCompetitionsFromConfig: (config: FeaturesConfigModels) => Promise<FeaturesConfigModels>;
42
44
  /**
43
45
  * Verifying parameter games for array or object type.
@@ -75,5 +77,6 @@ export default class PredictorService {
75
77
  areIdsExceeded: (ids: string[]) => boolean;
76
78
  initPredictionsFilters: (filters: PredictionsFilters, filtersFor: FilterCase, matchIds?: string[]) => PredictionsFilters;
77
79
  completeGameMarketResults: (gameMarketResults: GameMarketsResults, gameType: TypeGames) => Promise<GameMarketsResults>;
80
+ completeContestWinners: (contestWinners: ContestWinners) => Promise<ContestWinners>;
78
81
  private deleteUnexpectedProperties;
79
82
  }
@@ -12,6 +12,7 @@ import { FeaturesConfigModels } from "../../../Global/Types/GlobalTypes";
12
12
  import GameMarketsResults from "../../MatchQuiz/Models/GameMarketsResults/GameMarketsResults";
13
13
  import PredictorValidator from "../../Predictor/Validator/PredictorValidator";
14
14
  import MainFiltersBQ from "../../../Global/Models/Filters/MainFiltersBQ";
15
+ import ContestWinners from "../Models/Games/Winners/ContestWinners";
15
16
  export default class TopXFacade {
16
17
  readonly idMapping: IdMappingService;
17
18
  readonly predictorHttps: PredictorHttps;
@@ -32,6 +33,7 @@ export default class TopXFacade {
32
33
  getUserGameEditions: (userId: string, filters?: MainFiltersBQ, disableCache?: boolean) => Promise<PaginationModel>;
33
34
  getUserGamePrediction: (userId: string, gameId: string, disableCache?: boolean) => Promise<PredictionResponseModel>;
34
35
  getMarketsResultsForGame: (gameId: string, disableCache?: boolean) => Promise<GameMarketsResults>;
36
+ getGameWinners: (gameId: string) => Promise<ContestWinners>;
35
37
  /**
36
38
  * To prevent passing too long URL for fetching data from Predictor API, the maximum limit is set to 50
37
39
  */
@@ -1,6 +1,6 @@
1
1
  import ImagesModel from "../../../../Global/Models/Images/ImagesModel";
2
2
  import FixturesGamesModel from "../Fixtures/FixturesGamesModel";
3
- import RelatedGame from "./RelatedGame";
3
+ import RelatedEntity from "../../../../Global/Models/Related/RelatedEntity";
4
4
  import TimeTiebreaker from "./TimeTiebreaker";
5
5
  export default class GamesListModel {
6
6
  id: string;
@@ -13,7 +13,7 @@ export default class GamesListModel {
13
13
  fixtures: FixturesGamesModel[];
14
14
  tiebreaker: TimeTiebreaker;
15
15
  participantsCount: number;
16
- related: RelatedGame[];
16
+ related: RelatedEntity[];
17
17
  excludedProfileIds: string[];
18
18
  rules: string;
19
19
  flags: string[];
@@ -4,6 +4,7 @@ import GamesMatchQuizListModel from "../../../MatchQuiz/Models/Games/GamesMatchQ
4
4
  import GamesTopXListModel from "./GamesTopXListModel";
5
5
  import PaginationModel from "../../../../Global/Models/Pagination/PaginationModel";
6
6
  import GameMarketsResults from "../../../MatchQuiz/Models/GameMarketsResults/GameMarketsResults";
7
+ import ContestWinners from "./Winners/ContestWinners";
7
8
  export default class GamesRemapper {
8
9
  remapPaginatedGames: (paginatedGames: any) => PaginationModel;
9
10
  remapGamesListResponse: (gamesList: any) => GamesListModel;
@@ -17,6 +18,8 @@ export default class GamesRemapper {
17
18
  remapPaginatedGameResults: (gameResultsResponse: any) => PaginationModel;
18
19
  remapGameResults: (gameResults: any) => GameModel;
19
20
  remapGameMarketsResults: (gameMarketsResultsResponse: any) => GameMarketsResults;
21
+ remapContestWinners: (contestWinnersResponse: any) => ContestWinners;
22
+ private remapUserListWinners;
20
23
  private remapTieBreakers;
21
24
  private remapMarketsResults;
22
25
  private remapMarketResult;
@@ -1,6 +1,6 @@
1
1
  import ImagesModel from "../../../../Global/Models/Images/ImagesModel";
2
2
  import FixturesTopXModel from "../Fixtures/FixturesTopXModel";
3
- import RelatedGame from "./RelatedGame";
3
+ import RelatedEntity from "../../../../Global/Models/Related/RelatedEntity";
4
4
  import TimeTiebreaker from "./TimeTiebreaker";
5
5
  export default class GamesTopXListModel {
6
6
  id: string;
@@ -14,7 +14,7 @@ export default class GamesTopXListModel {
14
14
  tiebreaker: TimeTiebreaker;
15
15
  predictionId: string;
16
16
  participantsCount: number;
17
- related: RelatedGame[];
17
+ related: RelatedEntity[];
18
18
  excludedProfileIds: string[];
19
19
  rules: string;
20
20
  flags: string[];
@@ -0,0 +1,10 @@
1
+ import TemplateModel from "../../../../Loyalty/Models/Template/TemplateModel";
2
+ import GamesListModel from "../GamesListModel";
3
+ import UserListWinners from "./UserListWinners";
4
+ export default class ContestWinners {
5
+ contestId: string;
6
+ contestType: "GAME" | "TEMPLATE";
7
+ contestModel: GamesListModel | TemplateModel;
8
+ description: string;
9
+ userList: UserListWinners[];
10
+ }
@@ -0,0 +1,8 @@
1
+ import ProfileModel from "../../../../Profile/Models/ProfileModel";
2
+ export default class UserListWinners {
3
+ position: string;
4
+ profileId: string;
5
+ profileModel: ProfileModel;
6
+ note: string;
7
+ tags: string[];
8
+ }
@@ -8,6 +8,7 @@ import TopXPredictionRequestModel from "./Models/Prediction/TopXPredictionReques
8
8
  import PredictionsFilters from "../Predictor/Models/Predictions/PredictionsFilters";
9
9
  import GameMarketsResults from "../MatchQuiz/Models/GameMarketsResults/GameMarketsResults";
10
10
  import MainFiltersBQ from "../../Global/Models/Filters/MainFiltersBQ";
11
+ import ContestWinners from "./Models/Games/Winners/ContestWinners";
11
12
  export default class TopX {
12
13
  private topXFacade;
13
14
  private idMapping;
@@ -25,4 +26,5 @@ export default class TopX {
25
26
  getUserGameEditions: (userId: string, filters?: MainFiltersBQ, disableCache?: boolean) => Promise<PaginationModel>;
26
27
  getUserGamePrediction: (userId: string, gameId: string, disableCache?: boolean) => Promise<PredictionResponseModel>;
27
28
  getMarketsResultsForGame: (gameId: string, disableCache?: boolean) => Promise<GameMarketsResults>;
29
+ getGameWinners: (gameId: string) => Promise<ContestWinners>;
28
30
  }