@kameleoon/javascript-sdk-core 1.1.1 → 2.1.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/dist/cacheManager/cacheManager.d.ts +38 -0
- package/dist/cacheManager/cacheManager.js +74 -0
- package/dist/cacheManager/cacheManager.js.map +1 -0
- package/dist/cacheManager/index.d.ts +2 -0
- package/dist/cacheManager/index.js +20 -0
- package/dist/cacheManager/index.js.map +1 -0
- package/dist/cacheManager/types.d.ts +14 -0
- package/dist/cacheManager/types.js +6 -0
- package/dist/cacheManager/types.js.map +1 -0
- package/dist/campaignConfiguration/campaignConfiguration.d.ts +2 -1
- package/dist/campaignConfiguration/campaignConfiguration.js +243 -196
- package/dist/campaignConfiguration/campaignConfiguration.js.map +1 -1
- package/dist/campaignConfiguration/constants.d.ts +3 -3
- package/dist/campaignConfiguration/constants.js +22 -16
- package/dist/campaignConfiguration/constants.js.map +1 -1
- package/dist/campaignConfiguration/index.d.ts +1 -0
- package/dist/campaignConfiguration/index.js +85 -6
- package/dist/campaignConfiguration/index.js.map +1 -1
- package/dist/campaignConfiguration/types.d.ts +7 -3
- package/dist/campaignConfiguration/types.js +53 -45
- package/dist/campaignConfiguration/types.js.map +1 -1
- package/dist/clientSettings/clientSettings.d.ts +1 -1
- package/dist/clientSettings/clientSettings.js +28 -21
- package/dist/clientSettings/clientSettings.js.map +1 -1
- package/dist/clientSettings/index.js +18 -4
- package/dist/clientSettings/index.js.map +1 -1
- package/dist/clientSettings/types.d.ts +1 -1
- package/dist/clientSettings/types.js +4 -1
- package/dist/clientSettings/types.js.map +1 -1
- package/dist/constants.d.ts +11 -0
- package/dist/constants.js +37 -14
- package/dist/constants.js.map +1 -1
- package/dist/eventSource/constants.js +6 -2
- package/dist/eventSource/constants.js.map +1 -1
- package/dist/eventSource/externalEventSource.js +28 -20
- package/dist/eventSource/externalEventSource.js.map +1 -1
- package/dist/eventSource/index.js +49 -6
- package/dist/eventSource/index.js.map +1 -1
- package/dist/eventSource/types.d.ts +1 -1
- package/dist/eventSource/types.js +4 -1
- package/dist/eventSource/types.js.map +1 -1
- package/dist/hasher/hasher.d.ts +1 -1
- package/dist/hasher/hasher.js +37 -26
- package/dist/hasher/hasher.js.map +1 -1
- package/dist/hasher/index.js +11 -4
- package/dist/hasher/index.js.map +1 -1
- package/dist/hasher/types.d.ts +1 -1
- package/dist/hasher/types.js +4 -1
- package/dist/hasher/types.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +309 -28
- package/dist/index.js.map +1 -1
- package/dist/kameleoonClient.d.ts +32 -19
- package/dist/kameleoonClient.js +353 -235
- package/dist/kameleoonClient.js.map +1 -1
- package/dist/kameleoonData/browser.js +37 -32
- package/dist/kameleoonData/browser.js.map +1 -1
- package/dist/kameleoonData/constants.js +6 -2
- package/dist/kameleoonData/constants.js.map +1 -1
- package/dist/kameleoonData/conversion.js +47 -40
- package/dist/kameleoonData/conversion.js.map +1 -1
- package/dist/kameleoonData/customData.js +62 -58
- package/dist/kameleoonData/customData.js.map +1 -1
- package/dist/kameleoonData/device.js +37 -32
- package/dist/kameleoonData/device.js.map +1 -1
- package/dist/kameleoonData/index.js +101 -18
- package/dist/kameleoonData/index.js.map +1 -1
- package/dist/kameleoonData/nonce.js +25 -13
- package/dist/kameleoonData/nonce.js.map +1 -1
- package/dist/kameleoonData/pageView.js +52 -44
- package/dist/kameleoonData/pageView.js.map +1 -1
- package/dist/kameleoonData/types.js +41 -26
- package/dist/kameleoonData/types.js.map +1 -1
- package/dist/kameleoonData/userAgent.js +33 -24
- package/dist/kameleoonData/userAgent.js.map +1 -1
- package/dist/kameleoonError/constants.d.ts +1 -1
- package/dist/kameleoonError/constants.js +25 -21
- package/dist/kameleoonError/constants.js.map +1 -1
- package/dist/kameleoonError/helpers.js +6 -4
- package/dist/kameleoonError/helpers.js.map +1 -1
- package/dist/kameleoonError/index.js +25 -8
- package/dist/kameleoonError/index.js.map +1 -1
- package/dist/kameleoonError/kameleoonError.d.ts +1 -1
- package/dist/kameleoonError/kameleoonError.js +64 -53
- package/dist/kameleoonError/kameleoonError.js.map +1 -1
- package/dist/kameleoonError/types.d.ts +1 -1
- package/dist/kameleoonError/types.js +26 -22
- package/dist/kameleoonError/types.js.map +1 -1
- package/dist/kameleoonUtils.js +34 -33
- package/dist/kameleoonUtils.js.map +1 -1
- package/dist/requester/constants.d.ts +6 -7
- package/dist/requester/constants.js +58 -45
- package/dist/requester/constants.js.map +1 -1
- package/dist/requester/index.d.ts +2 -2
- package/dist/requester/index.js +67 -8
- package/dist/requester/index.js.map +1 -1
- package/dist/requester/requester.d.ts +7 -7
- package/dist/requester/requester.js +90 -113
- package/dist/requester/requester.js.map +1 -1
- package/dist/requester/types.d.ts +38 -10
- package/dist/requester/types.js +14 -36
- package/dist/requester/types.js.map +1 -1
- package/dist/storage/constants.js +11 -7
- package/dist/storage/constants.js.map +1 -1
- package/dist/storage/externalStorage.js +33 -26
- package/dist/storage/externalStorage.js.map +1 -1
- package/dist/storage/index.js +55 -6
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/types.js +4 -1
- package/dist/storage/types.js.map +1 -1
- package/dist/targeting/conditions/conditionFactory.js +24 -19
- package/dist/targeting/conditions/conditionFactory.js.map +1 -1
- package/dist/targeting/conditions/customDataCondition.js +99 -88
- package/dist/targeting/conditions/customDataCondition.js.map +1 -1
- package/dist/targeting/conditions/exclusiveExperimentCondition.js +27 -15
- package/dist/targeting/conditions/exclusiveExperimentCondition.js.map +1 -1
- package/dist/targeting/conditions/index.js +45 -10
- package/dist/targeting/conditions/index.js.map +1 -1
- package/dist/targeting/conditions/targetExperimentCondition.js +54 -32
- package/dist/targeting/conditions/targetExperimentCondition.js.map +1 -1
- package/dist/targeting/conditions/types.js +4 -1
- package/dist/targeting/conditions/types.js.map +1 -1
- package/dist/targeting/index.js +79 -13
- package/dist/targeting/index.js.map +1 -1
- package/dist/targeting/targetingNode.js +41 -33
- package/dist/targeting/targetingNode.js.map +1 -1
- package/dist/targeting/targetingTree.js +125 -104
- package/dist/targeting/targetingTree.js.map +1 -1
- package/dist/targeting/types.js +99 -91
- package/dist/targeting/types.js.map +1 -1
- package/dist/types.d.ts +34 -2
- package/dist/types.js +58 -21
- package/dist/types.js.map +1 -1
- package/dist/utilities/constants.js +6 -2
- package/dist/utilities/constants.js.map +1 -1
- package/dist/utilities/index.js +11 -4
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/types.d.ts +9 -1
- package/dist/utilities/types.js +4 -1
- package/dist/utilities/types.js.map +1 -1
- package/dist/utilities/utilities.d.ts +6 -3
- package/dist/utilities/utilities.js +171 -105
- package/dist/utilities/utilities.js.map +1 -1
- package/dist/variationConfiguration/index.js +24 -4
- package/dist/variationConfiguration/index.js.map +1 -1
- package/dist/variationConfiguration/types.d.ts +1 -1
- package/dist/variationConfiguration/types.js +4 -1
- package/dist/variationConfiguration/types.js.map +1 -1
- package/dist/variationConfiguration/variation.js +35 -28
- package/dist/variationConfiguration/variation.js.map +1 -1
- package/dist/variationConfiguration/variationConfiguration.d.ts +5 -6
- package/dist/variationConfiguration/variationConfiguration.js +263 -230
- package/dist/variationConfiguration/variationConfiguration.js.map +1 -1
- package/package.json +6 -4
- package/dist/hasher/constants.d.ts +0 -1
- package/dist/hasher/constants.js +0 -5
- package/dist/hasher/constants.js.map +0 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { AddParametersType } from './types';
|
|
2
|
+
interface ICacheManager<T> {
|
|
3
|
+
/**
|
|
4
|
+
* Add item to cache
|
|
5
|
+
* @param {AddParametersType<T>} parameters - parameters for adding new item cache
|
|
6
|
+
* @returns {void}
|
|
7
|
+
*/
|
|
8
|
+
add({ key, data, lifetime }: AddParametersType<T>): void;
|
|
9
|
+
/**
|
|
10
|
+
* Get item that is not expired from cache
|
|
11
|
+
* @param {string} key - key of item
|
|
12
|
+
* @returns {T} an item that is not expired
|
|
13
|
+
*/
|
|
14
|
+
getAliveItem(key: string): T | null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* @class
|
|
18
|
+
* CacheManager - a class for managing cache
|
|
19
|
+
*/
|
|
20
|
+
export declare class CacheManager<T> implements ICacheManager<T> {
|
|
21
|
+
private cacheMap;
|
|
22
|
+
private intervalId;
|
|
23
|
+
private cleanupTimeout;
|
|
24
|
+
/**
|
|
25
|
+
* @param {number} cleanupTimeout - timeout for cleaning cache in seconds
|
|
26
|
+
* generic type `T` is a type of data that will be stored in cache
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* const cacheManager = new CacheManager<number>(60);
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
constructor(cleanupTimeout: number);
|
|
33
|
+
add({ key, data, lifetime }: AddParametersType<T>): void;
|
|
34
|
+
getAliveItem(key: string): T | null;
|
|
35
|
+
private activate;
|
|
36
|
+
private cleanupInterval;
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CacheManager = void 0;
|
|
7
|
+
var _types = require("../types");
|
|
8
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
10
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
|
+
/**
|
|
12
|
+
* @class
|
|
13
|
+
* CacheManager - a class for managing cache
|
|
14
|
+
*/
|
|
15
|
+
class CacheManager {
|
|
16
|
+
/**
|
|
17
|
+
* @param {number} cleanupTimeout - timeout for cleaning cache in seconds
|
|
18
|
+
* generic type `T` is a type of data that will be stored in cache
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* const cacheManager = new CacheManager<number>(60);
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
constructor(cleanupTimeout) {
|
|
25
|
+
_defineProperty(this, "cacheMap", new Map());
|
|
26
|
+
_defineProperty(this, "intervalId", null);
|
|
27
|
+
_defineProperty(this, "cleanupTimeout", void 0);
|
|
28
|
+
this.cleanupTimeout = cleanupTimeout * _types.Milliseconds.Second;
|
|
29
|
+
}
|
|
30
|
+
add({
|
|
31
|
+
key,
|
|
32
|
+
data,
|
|
33
|
+
lifetime
|
|
34
|
+
}) {
|
|
35
|
+
if (this.intervalId === null) {
|
|
36
|
+
this.activate();
|
|
37
|
+
}
|
|
38
|
+
const expirationTime = lifetime * _types.Milliseconds.Second;
|
|
39
|
+
const cacheItem = {
|
|
40
|
+
data,
|
|
41
|
+
expirationTime: Date.now() + expirationTime
|
|
42
|
+
};
|
|
43
|
+
this.cacheMap.set(key, cacheItem);
|
|
44
|
+
}
|
|
45
|
+
getAliveItem(key) {
|
|
46
|
+
const cacheItem = this.cacheMap.get(key);
|
|
47
|
+
if (cacheItem && cacheItem.expirationTime >= Date.now()) {
|
|
48
|
+
return cacheItem.data;
|
|
49
|
+
}
|
|
50
|
+
cacheItem && this.cacheMap.delete(key);
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
activate() {
|
|
54
|
+
this.intervalId = setInterval(() => {
|
|
55
|
+
const now = Date.now();
|
|
56
|
+
for (const [key, item] of this.cacheMap) {
|
|
57
|
+
if (item.expirationTime < now) {
|
|
58
|
+
this.cacheMap.delete(key);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (!this.cacheMap.size) {
|
|
62
|
+
this.cleanupInterval();
|
|
63
|
+
}
|
|
64
|
+
}, this.cleanupTimeout);
|
|
65
|
+
}
|
|
66
|
+
cleanupInterval() {
|
|
67
|
+
if (this.intervalId) {
|
|
68
|
+
clearInterval(this.intervalId);
|
|
69
|
+
this.intervalId = null;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.CacheManager = CacheManager;
|
|
74
|
+
//# sourceMappingURL=cacheManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cacheManager.js","names":["_types","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","CacheManager","constructor","cleanupTimeout","Map","Milliseconds","Second","add","data","lifetime","intervalId","activate","expirationTime","cacheItem","Date","now","cacheMap","set","getAliveItem","get","delete","setInterval","item","size","cleanupInterval","clearInterval","exports"],"sources":["../../src/cacheManager/cacheManager.ts"],"sourcesContent":["import { AddParametersType, CacheItemType } from './types';\nimport { Milliseconds } from '../types';\n\ninterface ICacheManager<T> {\n /**\n * Add item to cache\n * @param {AddParametersType<T>} parameters - parameters for adding new item cache\n * @returns {void}\n */\n add({ key, data, lifetime }: AddParametersType<T>): void;\n /**\n * Get item that is not expired from cache\n * @param {string} key - key of item\n * @returns {T} an item that is not expired\n */\n getAliveItem(key: string): T | null;\n}\n\n/**\n * @class\n * CacheManager - a class for managing cache\n */\nexport class CacheManager<T> implements ICacheManager<T> {\n private cacheMap = new Map<string, CacheItemType<T>>();\n private intervalId: NodeJS.Timeout | null = null;\n private cleanupTimeout: number;\n\n /**\n * @param {number} cleanupTimeout - timeout for cleaning cache in seconds\n * generic type `T` is a type of data that will be stored in cache\n * @example\n * ```typescript\n * const cacheManager = new CacheManager<number>(60);\n * ```\n */\n constructor(cleanupTimeout: number) {\n this.cleanupTimeout = cleanupTimeout * Milliseconds.Second;\n }\n\n public add({ key, data, lifetime }: AddParametersType<T>): void {\n if (this.intervalId === null) {\n this.activate();\n }\n\n const expirationTime = lifetime * Milliseconds.Second;\n\n const cacheItem: CacheItemType<T> = {\n data,\n expirationTime: Date.now() + expirationTime,\n };\n\n this.cacheMap.set(key, cacheItem);\n }\n\n public getAliveItem(key: string): T | null {\n const cacheItem = this.cacheMap.get(key);\n\n if (cacheItem && cacheItem.expirationTime >= Date.now()) {\n return cacheItem.data;\n }\n\n cacheItem && this.cacheMap.delete(key);\n\n return null;\n }\n\n private activate(): void {\n this.intervalId = setInterval(() => {\n const now = Date.now();\n\n for (const [key, item] of this.cacheMap) {\n if (item.expirationTime < now) {\n this.cacheMap.delete(key);\n }\n }\n\n if (!this.cacheMap.size) {\n this.cleanupInterval();\n }\n }, this.cleanupTimeout);\n }\n\n private cleanupInterval(): void {\n if (this.intervalId) {\n clearInterval(this.intervalId);\n this.intervalId = null;\n }\n }\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "AddParametersType", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _types.AddParametersType;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "CacheManager", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _cacheManager.CacheManager;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _cacheManager = require("./cacheManager");
|
|
19
|
+
var _types = require("./types");
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_cacheManager","require","_types"],"sources":["../../src/cacheManager/index.ts"],"sourcesContent":["export { CacheManager } from './cacheManager';\nexport { AddParametersType } from './types';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {string} key - key for adding new item cache, key must be unique otherwise the item will be overwritten
|
|
3
|
+
* @param {T} data - data for adding new item cache
|
|
4
|
+
* @param {number} lifetime - lifetime for adding new item cache in seconds
|
|
5
|
+
*/
|
|
6
|
+
export type AddParametersType<T> = {
|
|
7
|
+
key: string;
|
|
8
|
+
data: T;
|
|
9
|
+
lifetime: number;
|
|
10
|
+
};
|
|
11
|
+
export type CacheItemType<T> = {
|
|
12
|
+
data: T;
|
|
13
|
+
expirationTime: number;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/cacheManager/types.ts"],"sourcesContent":["/**\n * @param {string} key - key for adding new item cache, key must be unique otherwise the item will be overwritten\n * @param {T} data - data for adding new item cache\n * @param {number} lifetime - lifetime for adding new item cache in seconds\n */\nexport type AddParametersType<T> = {\n key: string;\n data: T;\n lifetime: number;\n};\n\nexport type CacheItemType<T> = {\n data: T;\n expirationTime: number;\n};\n"],"mappings":""}
|
|
@@ -27,7 +27,8 @@ export declare class CampaignConfiguration implements ICampaignConfiguration {
|
|
|
27
27
|
private storage;
|
|
28
28
|
private requester;
|
|
29
29
|
private eventSource?;
|
|
30
|
-
|
|
30
|
+
private externalClientConfiguration?;
|
|
31
|
+
constructor({ settings, storage, requester, externalClientConfiguration, targetingCleanupInterval, }: CampaignConfigurationParametersType);
|
|
31
32
|
initialize(externalEventSource: IExternalEventSourceConstructor): Promise<Result<void, KameleoonError>>;
|
|
32
33
|
addTargetingData(visitorCode: string, ...data: KameleoonDataType[]): Result<void, KameleoonError>;
|
|
33
34
|
getUnsentData(visitorCode: string): KameleoonDataType[];
|
|
@@ -1,217 +1,264 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
12
6
|
exports.CampaignConfiguration = void 0;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
var _tsRes = require("ts-res");
|
|
8
|
+
var _constants = require("./constants");
|
|
9
|
+
var _eventSource = require("../eventSource");
|
|
10
|
+
var _types = require("../types");
|
|
11
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
15
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
16
16
|
class CampaignConfiguration {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
17
|
+
constructor({
|
|
18
|
+
settings,
|
|
19
|
+
storage,
|
|
20
|
+
requester,
|
|
21
|
+
externalClientConfiguration,
|
|
22
|
+
targetingCleanupInterval
|
|
23
|
+
}) {
|
|
24
|
+
_defineProperty(this, "configurationUpdateCallback", void 0);
|
|
25
|
+
_defineProperty(this, "updateConfigurationIntervalId", null);
|
|
26
|
+
_defineProperty(this, "targetingDataIntervalId", null);
|
|
27
|
+
_defineProperty(this, "unsentTargetingData", {});
|
|
28
|
+
_defineProperty(this, "targetingData", _constants.DEFAULT_CAMPAIGN_CONFIGURATION.targetingData);
|
|
29
|
+
_defineProperty(this, "configurationData", _constants.DEFAULT_CAMPAIGN_CONFIGURATION.configurationData);
|
|
30
|
+
_defineProperty(this, "settings", void 0);
|
|
31
|
+
_defineProperty(this, "lastUpdate", void 0);
|
|
32
|
+
_defineProperty(this, "storage", void 0);
|
|
33
|
+
_defineProperty(this, "requester", void 0);
|
|
34
|
+
_defineProperty(this, "eventSource", void 0);
|
|
35
|
+
_defineProperty(this, "externalClientConfiguration", void 0);
|
|
36
|
+
this.requester = requester;
|
|
37
|
+
this.settings = settings;
|
|
38
|
+
this.lastUpdate = new Date();
|
|
39
|
+
this.storage = storage;
|
|
40
|
+
this.readStorageData();
|
|
41
|
+
this.externalClientConfiguration = externalClientConfiguration;
|
|
42
|
+
if (targetingCleanupInterval) {
|
|
43
|
+
const cleanupIntervalMinutes = targetingCleanupInterval < 0 ? 1 : targetingCleanupInterval;
|
|
44
|
+
|
|
45
|
+
// --- Note ---
|
|
46
|
+
// We can not make delayed code execution recoverable, as it might lead
|
|
47
|
+
// to targeting data storage size overflow
|
|
48
|
+
try {
|
|
49
|
+
this.targetingDataIntervalId = setInterval(() => this.cleanupOutdatedTargetingData.call(this, this.targetingData), cleanupIntervalMinutes * _types.Milliseconds.Minute);
|
|
50
|
+
} catch (err) {
|
|
51
|
+
if (this.targetingDataIntervalId) {
|
|
52
|
+
clearInterval(this.targetingDataIntervalId);
|
|
39
53
|
}
|
|
54
|
+
throw err;
|
|
55
|
+
}
|
|
40
56
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
// --- Note ---
|
|
52
|
-
// Interval is cleaned up in case real time update
|
|
53
|
-
// was activated while initialized client already exists
|
|
54
|
-
if (this.configurationData.configuration.realTimeUpdate) {
|
|
55
|
-
if (this.updateConfigurationIntervalId) {
|
|
56
|
-
clearInterval(this.updateConfigurationIntervalId);
|
|
57
|
-
}
|
|
58
|
-
this.eventSource = new eventSource_1.ExternalEventSource(this.settings.siteCode, externalEventSource);
|
|
59
|
-
const updateEventCallback = (_timeStamp) => {
|
|
60
|
-
this.updateClientConfiguration();
|
|
61
|
-
if (this.configurationUpdateCallback) {
|
|
62
|
-
this.configurationUpdateCallback();
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
this.eventSource.open(updateEventCallback);
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
// --- Note ---
|
|
69
|
-
// Event Source is cleaned up in case real time update
|
|
70
|
-
// was disabled while initialized client already exists
|
|
71
|
-
if (this.eventSource) {
|
|
72
|
-
this.eventSource.close();
|
|
73
|
-
}
|
|
74
|
-
if (this.updateConfigurationIntervalId) {
|
|
75
|
-
clearInterval(this.updateConfigurationIntervalId);
|
|
76
|
-
}
|
|
77
|
-
// --- Note ---
|
|
78
|
-
// Same as targeting data interval we don't want to make failed configuration
|
|
79
|
-
// retrieval recoverable
|
|
80
|
-
try {
|
|
81
|
-
this.updateConfigurationIntervalId = setInterval(this.updateClientConfiguration.bind(this), this.settings.updateInterval);
|
|
82
|
-
}
|
|
83
|
-
catch (err) {
|
|
84
|
-
if (this.updateConfigurationIntervalId) {
|
|
85
|
-
clearInterval(this.updateConfigurationIntervalId);
|
|
86
|
-
}
|
|
87
|
-
throw err;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return (0, ts_res_1.Ok)();
|
|
91
|
-
});
|
|
57
|
+
}
|
|
58
|
+
async initialize(externalEventSource) {
|
|
59
|
+
const shouldUpdate = this.checkShouldUpdate();
|
|
60
|
+
|
|
61
|
+
// --- Initial data fetch ---
|
|
62
|
+
if (shouldUpdate) {
|
|
63
|
+
const updateResult = await this.updateClientConfiguration();
|
|
64
|
+
if (!updateResult.ok) {
|
|
65
|
+
return updateResult;
|
|
66
|
+
}
|
|
92
67
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
// `targetingData` should not refresh `lastUpdate` time
|
|
107
|
-
const result = this.updateStorageData(this.lastUpdate);
|
|
108
|
-
if (result.ok) {
|
|
109
|
-
data.forEach((dataItem) => {
|
|
110
|
-
if (!this.unsentTargetingData[visitorCode]) {
|
|
111
|
-
this.unsentTargetingData[visitorCode] = [];
|
|
112
|
-
}
|
|
113
|
-
this.unsentTargetingData[visitorCode].push(dataItem);
|
|
114
|
-
});
|
|
68
|
+
|
|
69
|
+
// --- Note ---
|
|
70
|
+
// Interval is cleaned up in case real time update
|
|
71
|
+
// was activated while initialized client already exists
|
|
72
|
+
if (this.configurationData.configuration.realTimeUpdate && !this.externalClientConfiguration) {
|
|
73
|
+
if (this.updateConfigurationIntervalId) {
|
|
74
|
+
clearInterval(this.updateConfigurationIntervalId);
|
|
75
|
+
}
|
|
76
|
+
this.eventSource = new _eventSource.ExternalEventSource(this.settings.siteCode, externalEventSource);
|
|
77
|
+
const updateEventCallback = _timeStamp => {
|
|
78
|
+
this.updateClientConfiguration();
|
|
79
|
+
if (this.configurationUpdateCallback) {
|
|
80
|
+
this.configurationUpdateCallback();
|
|
115
81
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
82
|
+
};
|
|
83
|
+
this.eventSource.open(updateEventCallback);
|
|
84
|
+
} else {
|
|
85
|
+
// --- Note ---
|
|
86
|
+
// Event Source is cleaned up in case real time update
|
|
87
|
+
// was disabled while initialized client already exists
|
|
88
|
+
if (this.eventSource) {
|
|
89
|
+
this.eventSource.close();
|
|
90
|
+
}
|
|
91
|
+
if (this.updateConfigurationIntervalId) {
|
|
92
|
+
clearInterval(this.updateConfigurationIntervalId);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// --- Note ---
|
|
96
|
+
// Same as targeting data interval we don't want to make failed configuration
|
|
97
|
+
// retrieval recoverable
|
|
98
|
+
try {
|
|
99
|
+
this.updateConfigurationIntervalId = setInterval(this.updateClientConfiguration.bind(this), this.settings.updateInterval);
|
|
100
|
+
} catch (err) {
|
|
101
|
+
if (this.updateConfigurationIntervalId) {
|
|
102
|
+
clearInterval(this.updateConfigurationIntervalId);
|
|
122
103
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
clearUnsentData(visitorCode) {
|
|
126
|
-
this.unsentTargetingData[visitorCode] = [];
|
|
127
|
-
}
|
|
128
|
-
onConfigurationUpdate(callback) {
|
|
129
|
-
this.configurationUpdateCallback = callback;
|
|
104
|
+
throw err;
|
|
105
|
+
}
|
|
130
106
|
}
|
|
131
|
-
|
|
132
|
-
|
|
107
|
+
return (0, _tsRes.Ok)();
|
|
108
|
+
}
|
|
109
|
+
addTargetingData(visitorCode, ...data) {
|
|
110
|
+
if (!(visitorCode in this.targetingData)) {
|
|
111
|
+
this.targetingData[visitorCode] = [];
|
|
133
112
|
}
|
|
134
|
-
|
|
135
|
-
|
|
113
|
+
data.forEach(dataItem => {
|
|
114
|
+
// --- Note ---
|
|
115
|
+
// Previous check excludes the failure possibility
|
|
116
|
+
this.targetingData[visitorCode].push({
|
|
117
|
+
data: dataItem.data,
|
|
118
|
+
lastActivityTime: Date.now()
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
// --- Note ---
|
|
123
|
+
// `targetingData` should not refresh `lastUpdate` time
|
|
124
|
+
const result = this.updateStorageData(this.lastUpdate);
|
|
125
|
+
if (result.ok) {
|
|
126
|
+
data.forEach(dataItem => {
|
|
127
|
+
if (!this.unsentTargetingData[visitorCode]) {
|
|
128
|
+
this.unsentTargetingData[visitorCode] = [];
|
|
129
|
+
}
|
|
130
|
+
this.unsentTargetingData[visitorCode].push(dataItem);
|
|
131
|
+
});
|
|
136
132
|
}
|
|
137
|
-
|
|
138
|
-
|
|
133
|
+
return result;
|
|
134
|
+
}
|
|
135
|
+
getUnsentData(visitorCode) {
|
|
136
|
+
const unsentDataItem = this.unsentTargetingData[visitorCode];
|
|
137
|
+
if (!unsentDataItem) {
|
|
138
|
+
return [];
|
|
139
139
|
}
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
return unsentDataItem;
|
|
141
|
+
}
|
|
142
|
+
clearUnsentData(visitorCode) {
|
|
143
|
+
this.unsentTargetingData[visitorCode] = [];
|
|
144
|
+
}
|
|
145
|
+
onConfigurationUpdate(callback) {
|
|
146
|
+
this.configurationUpdateCallback = callback;
|
|
147
|
+
}
|
|
148
|
+
get storedTargetingData() {
|
|
149
|
+
return this.targetingData;
|
|
150
|
+
}
|
|
151
|
+
get experiments() {
|
|
152
|
+
return this.configurationData.experiments;
|
|
153
|
+
}
|
|
154
|
+
get featureFlags() {
|
|
155
|
+
return this.configurationData.featureFlags;
|
|
156
|
+
}
|
|
157
|
+
get configuration() {
|
|
158
|
+
return this.configurationData.configuration;
|
|
159
|
+
}
|
|
160
|
+
checkShouldUpdate() {
|
|
161
|
+
const {
|
|
162
|
+
featureFlags,
|
|
163
|
+
experiments,
|
|
164
|
+
configuration
|
|
165
|
+
} = this.configurationData;
|
|
166
|
+
const {
|
|
167
|
+
updateInterval
|
|
168
|
+
} = this.settings;
|
|
169
|
+
if (!featureFlags.length && !experiments.length) {
|
|
170
|
+
return true;
|
|
142
171
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
const { updateInterval } = this.settings;
|
|
146
|
-
if (!featureFlags.length && !experiments.length) {
|
|
147
|
-
return true;
|
|
148
|
-
}
|
|
149
|
-
if (configuration.realTimeUpdate) {
|
|
150
|
-
return true;
|
|
151
|
-
}
|
|
152
|
-
const lastUpdateTime = this.lastUpdate.getTime();
|
|
153
|
-
const updateWindowEdge = Date.now() - updateInterval;
|
|
154
|
-
return lastUpdateTime < updateWindowEdge;
|
|
172
|
+
if (configuration.realTimeUpdate) {
|
|
173
|
+
return true;
|
|
155
174
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
// `targetingData` should not refresh `lastUpdate` time
|
|
174
|
-
this.updateStorageData(this.lastUpdate).throw();
|
|
175
|
+
const lastUpdateTime = this.lastUpdate.getTime();
|
|
176
|
+
const updateWindowEdge = Date.now() - updateInterval;
|
|
177
|
+
return lastUpdateTime < updateWindowEdge;
|
|
178
|
+
}
|
|
179
|
+
cleanupOutdatedTargetingData(data) {
|
|
180
|
+
const currentTime = Date.now();
|
|
181
|
+
const resultTargetingData = _objectSpread({}, data);
|
|
182
|
+
for (const [key, value] of Object.entries(resultTargetingData)) {
|
|
183
|
+
if (value) {
|
|
184
|
+
const resultValue = value.filter(item => {
|
|
185
|
+
const isDataExpired = item.lastActivityTime + _constants.SESSION_DURATION < currentTime;
|
|
186
|
+
return isDataExpired;
|
|
187
|
+
});
|
|
188
|
+
resultTargetingData[key] = resultValue;
|
|
189
|
+
} else {
|
|
190
|
+
resultTargetingData[key] = [];
|
|
191
|
+
}
|
|
175
192
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
193
|
+
this.targetingData = resultTargetingData;
|
|
194
|
+
// --- Note ---
|
|
195
|
+
// `targetingData` should not refresh `lastUpdate` time
|
|
196
|
+
this.updateStorageData(this.lastUpdate).throw();
|
|
197
|
+
}
|
|
198
|
+
readStorageData() {
|
|
199
|
+
const result = this.storage.read();
|
|
200
|
+
if (result.ok) {
|
|
201
|
+
const {
|
|
202
|
+
kameleoonTargetingData,
|
|
203
|
+
kameleoonConfiguration,
|
|
204
|
+
lastUpdate
|
|
205
|
+
} = result.data;
|
|
206
|
+
this.configurationData = kameleoonConfiguration;
|
|
207
|
+
this.targetingData = kameleoonTargetingData;
|
|
208
|
+
this.lastUpdate = new Date(Date.parse(lastUpdate));
|
|
184
209
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
210
|
+
}
|
|
211
|
+
async updateClientConfiguration(timeStamp) {
|
|
212
|
+
// --- Note ---
|
|
213
|
+
// if `externalClientConfiguration` is passed, fetching is disabled and passed config is used instead
|
|
214
|
+
if (this.externalClientConfiguration) {
|
|
215
|
+
// --- Note ---
|
|
216
|
+
// `featureFlags` field is omitted (v1)
|
|
217
|
+
// instead `featureFlagConfigurations` is used (v2)
|
|
218
|
+
const {
|
|
219
|
+
configuration,
|
|
220
|
+
experiments,
|
|
221
|
+
featureFlagConfigurations
|
|
222
|
+
} = this.externalClientConfiguration;
|
|
223
|
+
this.configurationData = {
|
|
224
|
+
configuration,
|
|
225
|
+
experiments,
|
|
226
|
+
featureFlags: featureFlagConfigurations
|
|
227
|
+
};
|
|
228
|
+
} else {
|
|
229
|
+
const clientConfigurationResult = await this.requester.getClientConfiguration(timeStamp);
|
|
230
|
+
if (!clientConfigurationResult.ok) {
|
|
231
|
+
return clientConfigurationResult;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// --- Note ---
|
|
235
|
+
// `featureFlags` field is omitted (v1)
|
|
236
|
+
// instead `featureFlagConfigurations` is used (v2)
|
|
237
|
+
const {
|
|
238
|
+
configuration,
|
|
239
|
+
experiments,
|
|
240
|
+
featureFlagConfigurations
|
|
241
|
+
} = clientConfigurationResult.data;
|
|
242
|
+
this.configurationData = {
|
|
243
|
+
configuration,
|
|
244
|
+
experiments,
|
|
245
|
+
featureFlags: featureFlagConfigurations
|
|
246
|
+
};
|
|
206
247
|
}
|
|
207
|
-
updateStorageData(
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
kameleoonConfiguration: this.configurationData,
|
|
211
|
-
lastUpdate: lastUpdate.toString(),
|
|
212
|
-
};
|
|
213
|
-
return this.storage.write(data);
|
|
248
|
+
const result = this.updateStorageData(new Date());
|
|
249
|
+
if (!result.ok) {
|
|
250
|
+
return result;
|
|
214
251
|
}
|
|
252
|
+
return (0, _tsRes.Ok)(true);
|
|
253
|
+
}
|
|
254
|
+
updateStorageData(lastUpdate) {
|
|
255
|
+
const data = {
|
|
256
|
+
kameleoonTargetingData: this.targetingData,
|
|
257
|
+
kameleoonConfiguration: this.configurationData,
|
|
258
|
+
lastUpdate: lastUpdate.toString()
|
|
259
|
+
};
|
|
260
|
+
return this.storage.write(data);
|
|
261
|
+
}
|
|
215
262
|
}
|
|
216
263
|
exports.CampaignConfiguration = CampaignConfiguration;
|
|
217
264
|
//# sourceMappingURL=campaignConfiguration.js.map
|