fansunited-sdk-esm 1.4.0 → 1.4.1

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,8 +1,8 @@
1
1
  export declare enum ValidationMessageEnum {
2
2
  API_KEY = "The field apiKey with valid value must be provided to use Fans United JS SDK",
3
3
  CLIENT_ID = "The field clientId must be provided to use Fans United JS SDK",
4
- LANG_MISSING = "If no lang is passed the default one will be set which is: EN",
5
- LANG_INVALID = "This lang value is not supported, the default one will be set which is: EN",
4
+ LANG_MISSING = "If no lang is passed the default one will be set which is: en",
5
+ LANG_INVALID = "This lang value is not supported, the default one will be set which is: en",
6
6
  ID_SCHEMA_MISSING = "If no idSchema is passed the default one will be set which is: native",
7
7
  ID_SCHEMA_INVALID = "This idSchema value is not supported, the default one will be set which is: native",
8
8
  ENVIRONMENT_MISSING = "If no environment is passed the default one will be set which is: prod",
@@ -4,9 +4,12 @@ import FootballCountryModel from "../Namespaces/Football/Models/Country/Football
4
4
  import ProfileCountryModel from "../Namespaces/Profile/Models/ProfileCountryModel";
5
5
  import CompetitionBasicModel from "../Namespaces/Football/Models/Competition/CompetitionBasicModel";
6
6
  import CompetitionFilters from "../Namespaces/Football/Models/Competition/CompetitionFilters";
7
+ import ProfileStatsModel from "../Namespaces/Profile/Models/Stats/ProfileStatsModel";
8
+ export declare type ExparationType = "profile" | "statistics" | "badges";
7
9
  export default class LocalStorage {
8
10
  private idSchema;
9
- private expirationTimeout;
11
+ readonly expirationTimeout: number;
12
+ readonly expirationBadgesTimeout: number;
10
13
  constructor(configuration: SDKConfigurationModel);
11
14
  clearData: () => void;
12
15
  getEntityById: (type?: string, id?: string) => any;
@@ -25,12 +28,16 @@ export default class LocalStorage {
25
28
  getOwnProfile: () => any;
26
29
  getProfileCountries: () => any;
27
30
  setProfileCountries: (countries: ProfileCountryModel[]) => void;
31
+ getProfileStats: () => any;
32
+ setProfileStats: (stats: ProfileStatsModel) => void;
33
+ getProfileBadges: () => any;
34
+ setProfileBadges: (badges: string[]) => void;
28
35
  getFootballCountries: () => any;
29
36
  setFootballCountries: (countries: FootballCountryModel[]) => void;
30
37
  getCompetitions: (filters?: CompetitionFilters) => any;
31
38
  setCompetitions: (competitions: CompetitionBasicModel[]) => void;
32
39
  getCompetitionsLength: () => number;
33
- getExpirationProfile: () => number;
40
+ getExpiration: (type: ExparationType) => number;
34
41
  /**
35
42
  * The purpose of this method is to avoid the posibility of having same competitions store in Local Storage.
36
43
  * @param competitions Cached competitions.
@@ -39,4 +46,5 @@ export default class LocalStorage {
39
46
  private makeCompetitionsUnique;
40
47
  private getData;
41
48
  private setData;
49
+ private initialNewSchema;
42
50
  }
@@ -5,11 +5,14 @@ import ProfileCountryModel from "../Models/ProfileCountryModel";
5
5
  import FullnessProfile from "../Models/FullnessProfile/FullnessProfile";
6
6
  import FollowFilters from "../Models/FollowFilters";
7
7
  import PaginationModel from "../../../Global/Models/Pagination/PaginationModel";
8
+ import ProfileStatsModel from "../Models/Stats/ProfileStatsModel";
9
+ import ActivityHttps from "../../../Https/ActivityHttps";
8
10
  export default class ProfileFacade {
9
11
  private isBrowser;
10
12
  private localStorage;
11
- private https;
12
- constructor(localStorage: LocalStorage, https: ProfileHttps);
13
+ private profileHttps;
14
+ private activityHttps;
15
+ constructor(localStorage: LocalStorage, profileHttps: ProfileHttps, activityHttps?: ActivityHttps);
13
16
  getOwn: () => Promise<ProfileModel>;
14
17
  updateOwnProfile: () => Promise<ProfileModel>;
15
18
  getByIds: (ids: string[], disableCache?: boolean) => Promise<ProfileModel[]>;
@@ -20,4 +23,7 @@ export default class ProfileFacade {
20
23
  follow: (ids: string[]) => Promise<import("../Models/Following/FollowingModel").default[]>;
21
24
  unfollow: (ids: string[]) => Promise<boolean>;
22
25
  showFullnessProfile: (profile: ProfileModel) => FullnessProfile;
26
+ getStats: () => Promise<ProfileStatsModel>;
27
+ getBadges: () => Promise<string[]>;
28
+ private getLocalStorageData;
23
29
  }