@kameleoon/javascript-sdk 4.15.0 → 4.16.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.
@@ -10,6 +10,17 @@ export declare class KameleoonClient extends KameleoonCore {
10
10
  private externalVisitorCodeManager;
11
11
  private customDataManager?;
12
12
  constructor({ siteCode, configuration, externals, _internals, stubMode, }: SDKParameters);
13
+ /**
14
+ * @method initialize - an asynchronous method for KameleoonClient initialization by fetching Kameleoon SDK related data from server or by retrieving data from local source if data is up-to-date or update interval has not been reached
15
+ * @returns {Promise<boolean>} Promise resolved into boolean field indicating success or fail
16
+ * @throws `KameleoonError` with one of the following `type` s:
17
+ *
18
+ * - `KameleoonException.StorageWrite` Couldn't update storage data
19
+ * - `KameleoonException.StorageRead` - Couldn't read storage data
20
+ * - `KameleoonException.ClientConfiguration` Couldn't retrieve client configuration from Kameleoon Api
21
+ * - `KameleoonException.MaximumRetriesReached` Maximum retries reached, request failed
22
+ */
23
+ initialize(): Promise<boolean>;
13
24
  /**
14
25
  * @method getVisitorCode - obtains visitor code from the browser cookie, if the visitor code doesn't yet exist generates a random visitor code (or uses a provided default) and sets a new visitor code to cookie
15
26
  * @param {string | undefined} defaultVisitorCode - visitor code to be used in case there is no visitor code in cookies *Note*: if not passed visitor code will be randomly generated
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { InternalsType as CoreInternalsType, IExternalEventSource, IExternalRequester, IExternalStorage, SDKConfigurationType, IExternalLogger } from '@kameleoon/javascript-sdk-core/browser';
2
- import { IPlatformAnalyzer } from 'src/utils';
2
+ import { IPlatformAnalyzer } from './utils';
3
3
  /**
4
4
  * @param {IExternalStorage | undefined} storage - external storage implementation
5
5
  * @param {IExternalEventSource | undefined} eventSource - external event source implementation
@@ -1,4 +1,4 @@
1
- import { PlatformAnalysisResult } from 'src/utils/types';
1
+ import { PlatformAnalysisResult } from '../utils/types';
2
2
  export declare class Utils {
3
3
  static getFirstMatch(regex: RegExp, userAgent: string): string;
4
4
  static getSecondMatch(regex: RegExp, userAgent: string): string;
@@ -1,5 +1,5 @@
1
- import { ITracker } from "@kameleoon/javascript-sdk-core/browser";
2
- import { ClientDataManager } from "src/dataManager";
1
+ import { ITracker } from '@kameleoon/javascript-sdk-core/browser';
2
+ import { ClientDataManager } from '../dataManager';
3
3
  export interface VisitorActivityManagerType {
4
4
  }
5
5
  export declare class VisitorActivityManager implements VisitorActivityManagerType {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kameleoon/javascript-sdk",
3
- "version": "4.15.0",
3
+ "version": "4.16.0",
4
4
  "description": "Kameleoon JavaScript SDK",
5
5
  "main": "dist/javascript-sdk.cjs.min.js",
6
6
  "module": "dist/javascript-sdk.es.min.js",
@@ -14,7 +14,7 @@
14
14
  "dev": "npm run clean && tsc -w -p tsconfig.watch.json",
15
15
  "build": "npm run clean && npm run build:types && npm run build:bundle",
16
16
  "build:test": "npm run clean && npm run build:js-source-maps",
17
- "build:types": "tsc --emitDeclarationOnly",
17
+ "build:types": "tsc --emitDeclarationOnly && tsc-alias",
18
18
  "build:bundle": "rollup -c",
19
19
  "build:js": "babel src --out-dir dist --extensions \".ts,.tsx\"",
20
20
  "build:js-source-maps": "babel src --out-dir dist --extensions \".ts,.tsx\" --source-maps true",
@@ -43,14 +43,15 @@
43
43
  ],
44
44
  "license": "ISC",
45
45
  "dependencies": {
46
- "@kameleoon/javascript-sdk-core": "5.15.0"
46
+ "@kameleoon/javascript-sdk-core": "5.16.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/crypto-js": "^4.1.1",
50
50
  "rimraf": "^3.0.2",
51
51
  "typescript": "^4.4.4",
52
52
  "jest": "^27.3.1",
53
- "ts-jest": "^27.0.7"
53
+ "ts-jest": "^27.0.7",
54
+ "tsc-alias": "^1.8.7"
54
55
  },
55
56
  "commitlint": {
56
57
  "extends": "@commitlint/config-conventional"