@kameleoon/javascript-sdk 4.14.2 → 4.14.4
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/CHANGELOG.md +32 -8
- package/dist/dataManager.d.ts +8 -2
- package/dist/index.d.ts +5 -4
- package/dist/javascript-sdk.cjs.min.js +1 -1
- package/dist/javascript-sdk.cjs.min.js.map +1 -1
- package/dist/javascript-sdk.es.min.js +1 -1
- package/dist/javascript-sdk.es.min.js.map +1 -1
- package/dist/javascript-sdk.umd.min.js +1 -1
- package/dist/javascript-sdk.umd.min.js.map +1 -1
- package/dist/types.d.ts +8 -1
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/platformAnalyzer.d.ts +21 -0
- package/dist/utils/types.d.ts +18 -0
- package/package.json +2 -2
- package/dist/utils/browserAnalyse.d.ts +0 -42
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { InternalsType, IExternalEventSource, IExternalRequester, IExternalStorage, SDKConfigurationType, IExternalLogger } from '@kameleoon/javascript-sdk-core/browser';
|
|
1
|
+
import { InternalsType as CoreInternalsType, IExternalEventSource, IExternalRequester, IExternalStorage, SDKConfigurationType, IExternalLogger } from '@kameleoon/javascript-sdk-core/browser';
|
|
2
|
+
import { IPlatformAnalyzer } from 'src/utils';
|
|
2
3
|
/**
|
|
3
4
|
* @param {IExternalStorage | undefined} storage - external storage implementation
|
|
4
5
|
* @param {IExternalEventSource | undefined} eventSource - external event source implementation
|
|
@@ -13,6 +14,12 @@ export type ExternalsType = {
|
|
|
13
14
|
visitorCodeManager?: IExternalVisitorCodeManager;
|
|
14
15
|
logger?: IExternalLogger;
|
|
15
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* @param {IPlatformAnalyzer | undefined} platformAnalyzer - external platform analyzer implementation
|
|
19
|
+
*/
|
|
20
|
+
export type InternalsType = CoreInternalsType & {
|
|
21
|
+
platformAnalyzer?: IPlatformAnalyzer;
|
|
22
|
+
};
|
|
16
23
|
/**
|
|
17
24
|
* @param {string} siteCode - client's siteCode defined on Kameleoon platform
|
|
18
25
|
* @param {Partial<SDKConfigurationType> | undefined} configuration - client's configuration
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PlatformAnalysisResult } from 'src/utils/types';
|
|
2
|
+
export declare class Utils {
|
|
3
|
+
static getFirstMatch(regex: RegExp, userAgent: string): string;
|
|
4
|
+
static getSecondMatch(regex: RegExp, userAgent: string): string;
|
|
5
|
+
static assign<T extends object>(target: T, ...sources: Partial<T>[]): T;
|
|
6
|
+
}
|
|
7
|
+
export interface IPlatformAnalyzer {
|
|
8
|
+
getResult(): PlatformAnalysisResult;
|
|
9
|
+
}
|
|
10
|
+
export declare class PlatformAnalyzer implements IPlatformAnalyzer {
|
|
11
|
+
private userAgent;
|
|
12
|
+
private parsedResult;
|
|
13
|
+
constructor();
|
|
14
|
+
private parseBrowser;
|
|
15
|
+
private parseOS;
|
|
16
|
+
private parsePlatform;
|
|
17
|
+
private parse;
|
|
18
|
+
private getBrowserVersion;
|
|
19
|
+
parseWebView(): void;
|
|
20
|
+
getResult(): PlatformAnalysisResult;
|
|
21
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BrowserType, DeviceType, OperatingSystemType, PageView } from '@kameleoon/javascript-sdk-core/browser';
|
|
2
|
+
export type BrowserResult = {
|
|
3
|
+
name?: BrowserType;
|
|
4
|
+
version?: number;
|
|
5
|
+
};
|
|
6
|
+
export type OSResult = {
|
|
7
|
+
name?: OperatingSystemType;
|
|
8
|
+
version?: string;
|
|
9
|
+
};
|
|
10
|
+
export type PlatformResult = {
|
|
11
|
+
type?: DeviceType;
|
|
12
|
+
};
|
|
13
|
+
export type PlatformAnalysisResult = {
|
|
14
|
+
browser?: BrowserResult;
|
|
15
|
+
os?: OSResult;
|
|
16
|
+
platform?: PlatformResult;
|
|
17
|
+
pageView?: PageView;
|
|
18
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kameleoon/javascript-sdk",
|
|
3
|
-
"version": "4.14.
|
|
3
|
+
"version": "4.14.4",
|
|
4
4
|
"description": "Kameleoon JavaScript SDK",
|
|
5
5
|
"main": "dist/javascript-sdk.cjs.min.js",
|
|
6
6
|
"module": "dist/javascript-sdk.es.min.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
],
|
|
43
43
|
"license": "ISC",
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@kameleoon/javascript-sdk-core": "5.14.
|
|
45
|
+
"@kameleoon/javascript-sdk-core": "5.14.4"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/crypto-js": "^4.1.1",
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { BrowserType, DeviceType, OperatingSystemType, PageView } from '@kameleoon/javascript-sdk-core/browser';
|
|
2
|
-
export type BrowserResult = {
|
|
3
|
-
name?: BrowserType;
|
|
4
|
-
version?: string;
|
|
5
|
-
};
|
|
6
|
-
export type OSResult = {
|
|
7
|
-
name?: OperatingSystemType;
|
|
8
|
-
version?: string;
|
|
9
|
-
};
|
|
10
|
-
export type PlatformResult = {
|
|
11
|
-
type?: DeviceType;
|
|
12
|
-
};
|
|
13
|
-
export type ParsedResult = {
|
|
14
|
-
browser?: BrowserResult;
|
|
15
|
-
os?: OSResult;
|
|
16
|
-
platform?: PlatformResult;
|
|
17
|
-
pageView?: PageView;
|
|
18
|
-
};
|
|
19
|
-
export declare class Utils {
|
|
20
|
-
static getFirstMatch(regex: RegExp, userAgent: string): string;
|
|
21
|
-
static getSecondMatch(regex: RegExp, userAgent: string): string;
|
|
22
|
-
static assign<T extends object>(target: T, ...sources: Partial<T>[]): T;
|
|
23
|
-
}
|
|
24
|
-
export declare class BrowserParser {
|
|
25
|
-
private userAgent;
|
|
26
|
-
private parsedResult;
|
|
27
|
-
constructor(userAgent: string);
|
|
28
|
-
private parseBrowser;
|
|
29
|
-
private parseOS;
|
|
30
|
-
private parsePlatform;
|
|
31
|
-
private parseOsName;
|
|
32
|
-
private parseOsVersion;
|
|
33
|
-
private parse;
|
|
34
|
-
parseWebView(): void;
|
|
35
|
-
private parseReactNative;
|
|
36
|
-
getResult(): ParsedResult;
|
|
37
|
-
}
|
|
38
|
-
export default class BrowserAnalyse {
|
|
39
|
-
static browserParser: BrowserParser | null;
|
|
40
|
-
static parse(): ParsedResult;
|
|
41
|
-
static getBrowserVersion(version: string | undefined): number | undefined;
|
|
42
|
-
}
|