fansunited-sdk-esm 1.22.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.
- package/Core/Configurator/Enums/LangEnum.d.ts +2 -1
- package/Core/Configurator/Types/ConfiguratorTypes.d.ts +4 -4
- package/Core/Global/LocalStorage.d.ts +8 -1
- package/Core/Https/IdMappingHttps.d.ts +2 -0
- package/Core/IdMapping/IdMappingFacade.d.ts +5 -0
- package/Core/IdMapping/Models/IdMappingModel.d.ts +7 -0
- package/README.md +1 -1
- package/index.js +9 -9
- package/index.js.map +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare type LangType =
|
|
2
|
-
export declare type IdSchemaType =
|
|
3
|
-
export declare type EnvironmentType =
|
|
4
|
-
export declare type ErrorHandlingModeType =
|
|
1
|
+
export declare type LangType = "bg" | "en" | "ro" | "el";
|
|
2
|
+
export declare type IdSchemaType = "native" | "enetpulse" | "sportal365" | "sportradar";
|
|
3
|
+
export declare type EnvironmentType = "dev" | "prod" | "staging";
|
|
4
|
+
export declare type ErrorHandlingModeType = "default" | "standard";
|
|
@@ -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
|
-
|
|
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
|
}
|
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@ const fansUnitedSdk = FansUnitedSDK({
|
|
|
44
44
|
"apiKey": "your-api-key-here",
|
|
45
45
|
"environment": "dev|prod|staging", // default: prod
|
|
46
46
|
"clientId": "your-client-id-here",
|
|
47
|
-
"lang": "
|
|
47
|
+
"lang": "bg|en|ro|el", // default: en
|
|
48
48
|
"idSchema": "native|enetpulse|sportradar|sportal365", // default: native
|
|
49
49
|
"errorHandlingMode": "default|standard", // default: default
|
|
50
50
|
"authProvider": new myTokenProvider()
|