fansunited-sdk-esm 1.23.0 → 1.24.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.
@@ -5,12 +5,14 @@ import ProfileCountryModel from "../Namespaces/Profile/Models/ProfileCountryMode
5
5
  import CompetitionBasicModel from "../Namespaces/Football/Models/Competition/CompetitionBasicModel";
6
6
  import CompetitionFilters from "../Namespaces/Football/Models/Competition/CompetitionFilters";
7
7
  import ProfileStatsModel from "../Namespaces/Profile/Models/Stats/ProfileStatsModel";
8
- export declare type ExparationType = "profile" | "statistics" | "badges" | "features";
8
+ import IdMappingModel from "../IdMapping/Models/IdMappingModel";
9
+ export declare type ExparationType = "profile" | "statistics" | "badges" | "features" | "ids";
9
10
  export default class LocalStorage {
10
11
  private idSchema;
11
12
  readonly expirationProfileTimeout: number;
12
13
  readonly expirationBadgesTimeout: number;
13
14
  readonly expirationClientFeaturesTimeout: number;
15
+ readonly expirationFootballIdsTimeout: number;
14
16
  constructor(configuration: SDKConfigurationModel);
15
17
  clearData: () => void;
16
18
  getEntityById: (type?: string, id?: string) => any;
@@ -25,6 +27,11 @@ export default class LocalStorage {
25
27
  getIdsByType: (typeIdsObj: any, configSchema: string, toSchema: string) => {};
26
28
  addIdMapping: (idMapping: any) => void;
27
29
  addIdMappings: (idMappings: any[]) => void;
30
+ /**
31
+ * When we have already fetched the top id mappings, remove the old matches and store the new ones
32
+ * @param topIdMappings Top id mappings from Id Mapping API
33
+ */
34
+ addTopIdMappings: (topIdMappings: IdMappingModel[]) => void;
28
35
  setOwnProfile: (profile: ProfileModel) => void;
29
36
  getOwnProfile: () => any;
30
37
  getProfileCountries: () => any;
@@ -1,5 +1,6 @@
1
1
  import { AxiosResponse } from "axios";
2
2
  import SDKConfiguraitonModel from "../Configurator/Models/SDKConfiguraitonModel";
3
+ import IdMappingModel from "../IdMapping/Models/IdMappingModel";
3
4
  import Https from "./Https";
4
5
  export default class IdMappingHttps extends Https {
5
6
  constructor(config: SDKConfiguraitonModel);
@@ -18,4 +19,5 @@ export default class IdMappingHttps extends Https {
18
19
  * @returns Entities ids
19
20
  */
20
21
  getEntitiesByIdObjs: (entityIdsObj: any, schemaId?: string) => Promise<any[]>;
22
+ getTopEntities: () => Promise<IdMappingModel[]>;
21
23
  }
@@ -12,4 +12,9 @@ export default class IdMappingFacade {
12
12
  */
13
13
  private splitForRequestAndExisting;
14
14
  private requestEntity;
15
+ /**
16
+ * Fetches top id mappings and store them in local storage whether they don't exist or their
17
+ * expiration time has passed
18
+ */
19
+ private setTopIdMappings;
15
20
  }
@@ -0,0 +1,7 @@
1
+ export default class IdMappingModel {
2
+ id: string;
3
+ enetpulse_id: string;
4
+ sportal365_id: string;
5
+ sportradar_id: string;
6
+ resource: string;
7
+ }