@kameleoon/javascript-sdk-core 1.1.1 → 2.0.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/campaignConfiguration/campaignConfiguration.d.ts +2 -1
- package/dist/campaignConfiguration/campaignConfiguration.js +239 -197
- package/dist/campaignConfiguration/campaignConfiguration.js.map +1 -1
- package/dist/campaignConfiguration/constants.js +20 -14
- package/dist/campaignConfiguration/constants.js.map +1 -1
- package/dist/campaignConfiguration/index.js +78 -6
- package/dist/campaignConfiguration/index.js.map +1 -1
- package/dist/campaignConfiguration/types.d.ts +3 -2
- 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.js +22 -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/constants.js +6 -2
- package/dist/hasher/constants.js.map +1 -1
- package/dist/hasher/hasher.js +35 -24
- 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.js +4 -1
- package/dist/hasher/types.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +297 -28
- package/dist/index.js.map +1 -1
- package/dist/kameleoonClient.d.ts +16 -16
- package/dist/kameleoonClient.js +307 -236
- 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.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.js +64 -53
- package/dist/kameleoonError/kameleoonError.js.map +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 +100 -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 +17 -2
- package/dist/types.js +50 -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 +1 -1
- package/dist/utilities/types.js +4 -1
- package/dist/utilities/types.js.map +1 -1
- package/dist/utilities/utilities.d.ts +2 -2
- package/dist/utilities/utilities.js +117 -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.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 -5
- package/dist/variationConfiguration/variationConfiguration.js +270 -228
- package/dist/variationConfiguration/variationConfiguration.js.map +1 -1
- package/package.json +6 -4
|
@@ -1,20 +1,103 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
Object.defineProperty(exports, "
|
|
19
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Browser", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _browser.Browser;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "BrowserType", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _types.BrowserType;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "Conversion", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _conversion.Conversion;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "ConversionParametersType", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _types.ConversionParametersType;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "CustomData", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _customData.CustomData;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "CustomDataType", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _types.CustomDataType;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "Device", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _device.Device;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "DeviceType", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _types.DeviceType;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "KameleoonData", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _types.KameleoonData;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "KameleoonDataItemType", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _types.KameleoonDataItemType;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "KameleoonDataType", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _types.KameleoonDataType;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "PageView", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _pageView.PageView;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "PageViewParametersType", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _types.PageViewParametersType;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "UserAgent", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _userAgent.UserAgent;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "UserAgentDataType", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _types.UserAgentDataType;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
var _customData = require("./customData");
|
|
97
|
+
var _conversion = require("./conversion");
|
|
98
|
+
var _device = require("./device");
|
|
99
|
+
var _browser = require("./browser");
|
|
100
|
+
var _pageView = require("./pageView");
|
|
101
|
+
var _userAgent = require("./userAgent");
|
|
102
|
+
var _types = require("./types");
|
|
20
103
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"index.js","names":["_customData","require","_conversion","_device","_browser","_pageView","_userAgent","_types"],"sources":["../../src/kameleoonData/index.ts"],"sourcesContent":["export { CustomData } from './customData';\nexport { Conversion } from './conversion';\nexport { Device } from './device';\nexport { Browser } from './browser';\nexport { PageView } from './pageView';\nexport { UserAgent } from './userAgent';\nexport {\n DeviceType,\n BrowserType,\n CustomDataType,\n KameleoonData,\n KameleoonDataType,\n KameleoonDataItemType,\n PageViewParametersType,\n ConversionParametersType,\n UserAgentDataType,\n} from './types';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA"}
|
|
@@ -1,20 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
3
6
|
exports.Nonce = void 0;
|
|
4
|
-
|
|
7
|
+
var _constants = require("./constants");
|
|
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); }
|
|
5
11
|
class Nonce {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
// --- Note ---
|
|
13
|
+
// nonce — «number that can only be used once»
|
|
14
|
+
// is a hex valid string for the one-time use, which helps
|
|
15
|
+
// tracking mechanism to differ one tracking event from another
|
|
16
|
+
|
|
17
|
+
constructor() {
|
|
18
|
+
_defineProperty(this, "nonce", void 0);
|
|
19
|
+
this.nonce = this.getNonce();
|
|
20
|
+
}
|
|
21
|
+
getNonce() {
|
|
22
|
+
const hexLength = _constants.HEX_CHARACTERS.length;
|
|
23
|
+
let nonce = '';
|
|
24
|
+
for (let i = 0; i < hexLength; i++) {
|
|
25
|
+
const randomNumber = Math.floor(Math.random() * hexLength);
|
|
26
|
+
nonce += _constants.HEX_CHARACTERS.substring(randomNumber, randomNumber + 1);
|
|
17
27
|
}
|
|
28
|
+
return nonce;
|
|
29
|
+
}
|
|
18
30
|
}
|
|
19
31
|
exports.Nonce = Nonce;
|
|
20
32
|
//# sourceMappingURL=nonce.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nonce.js","
|
|
1
|
+
{"version":3,"file":"nonce.js","names":["_constants","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","Nonce","constructor","nonce","getNonce","hexLength","HEX_CHARACTERS","length","i","randomNumber","Math","floor","random","substring","exports"],"sources":["../../src/kameleoonData/nonce.ts"],"sourcesContent":["import { HEX_CHARACTERS } from './constants';\n\nexport abstract class Nonce {\n // --- Note ---\n // nonce — «number that can only be used once»\n // is a hex valid string for the one-time use, which helps\n // tracking mechanism to differ one tracking event from another\n protected nonce: string;\n\n constructor() {\n this.nonce = this.getNonce();\n }\n\n private getNonce(): string {\n const hexLength = HEX_CHARACTERS.length;\n let nonce: string = '';\n\n for (let i = 0; i < hexLength; i++) {\n const randomNumber = Math.floor(Math.random() * hexLength);\n nonce += HEX_CHARACTERS.substring(randomNumber, randomNumber + 1);\n }\n\n return nonce;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAA6C,SAAAC,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,IAAA,2BAAAK,GAAA,sBAAAA,GAAA,YAAAE,SAAA,4DAAAP,IAAA,gBAAAF,MAAA,GAAAU,MAAA,EAAAT,KAAA;AAEtC,MAAeU,KAAK,CAAC;EAC1B;EACA;EACA;EACA;;EAGAC,WAAWA,CAAA,EAAG;IAAAxB,eAAA;IACZ,IAAI,CAACyB,KAAK,GAAG,IAAI,CAACC,QAAQ,EAAE;EAC9B;EAEQA,QAAQA,CAAA,EAAW;IACzB,MAAMC,SAAS,GAAGC,yBAAc,CAACC,MAAM;IACvC,IAAIJ,KAAa,GAAG,EAAE;IAEtB,KAAK,IAAIK,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,SAAS,EAAEG,CAAC,EAAE,EAAE;MAClC,MAAMC,YAAY,GAAGC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,MAAM,EAAE,GAAGP,SAAS,CAAC;MAC1DF,KAAK,IAAIG,yBAAc,CAACO,SAAS,CAACJ,YAAY,EAAEA,YAAY,GAAG,CAAC,CAAC;IACnE;IAEA,OAAON,KAAK;EACd;AACF;AAACW,OAAA,CAAAb,KAAA,GAAAA,KAAA"}
|
|
@@ -1,54 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
3
6
|
exports.PageView = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
var _requester = require("../requester");
|
|
8
|
+
var _nonce = require("./nonce");
|
|
9
|
+
var _types = require("./types");
|
|
10
|
+
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; }
|
|
11
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
12
|
+
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); }
|
|
7
13
|
/**
|
|
8
14
|
* @class
|
|
9
15
|
* PageView - a class for creating an instance of a page view data
|
|
10
16
|
* */
|
|
11
|
-
class PageView extends
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
17
|
+
class PageView extends _nonce.Nonce {
|
|
18
|
+
/**
|
|
19
|
+
* @param {PageViewParametersType} pageViewParameters - an object with page view parameters
|
|
20
|
+
* */
|
|
21
|
+
constructor({
|
|
22
|
+
urlAddress,
|
|
23
|
+
title,
|
|
24
|
+
referrers
|
|
25
|
+
}) {
|
|
26
|
+
super();
|
|
27
|
+
_defineProperty(this, "urlAddress", void 0);
|
|
28
|
+
_defineProperty(this, "title", void 0);
|
|
29
|
+
_defineProperty(this, "referrers", void 0);
|
|
30
|
+
this.urlAddress = urlAddress;
|
|
31
|
+
this.title = title;
|
|
32
|
+
this.referrers = referrers;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @property url - url for the current data type used for events tracking
|
|
37
|
+
* */
|
|
38
|
+
get url() {
|
|
39
|
+
return _requester.UrlEventType.Page + _requester.UrlParameter.Href + encodeURIComponent(this.urlAddress) + _requester.UrlParameter.Title + encodeURIComponent(this.title) + this.getReferresParameter(this.referrers) + _requester.UrlParameter.Nonce + this.nonce;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @property data - data of the current class instance
|
|
44
|
+
* */
|
|
45
|
+
get data() {
|
|
46
|
+
return {
|
|
47
|
+
urlAddress: this.urlAddress,
|
|
48
|
+
title: this.title,
|
|
49
|
+
referrers: this.referrers,
|
|
50
|
+
type: _types.KameleoonData.PageView,
|
|
51
|
+
nonce: this.nonce
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
getReferresParameter(referrers) {
|
|
55
|
+
if (referrers) {
|
|
56
|
+
return _requester.UrlParameter.ReferrersIndices + JSON.stringify(referrers);
|
|
51
57
|
}
|
|
58
|
+
return '';
|
|
59
|
+
}
|
|
52
60
|
}
|
|
53
61
|
exports.PageView = PageView;
|
|
54
62
|
//# sourceMappingURL=pageView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pageView.js","
|
|
1
|
+
{"version":3,"file":"pageView.js","names":["_requester","require","_nonce","_types","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","PageView","Nonce","constructor","urlAddress","title","referrers","url","UrlEventType","Page","UrlParameter","Href","encodeURIComponent","Title","getReferresParameter","nonce","data","type","KameleoonData","ReferrersIndices","JSON","stringify","exports"],"sources":["../../src/kameleoonData/pageView.ts"],"sourcesContent":["import { UrlEventType, UrlParameter } from '../requester';\nimport { Nonce } from './nonce';\nimport {\n IKameleoonData,\n KameleoonData,\n PageViewDataType,\n PageViewParametersType,\n} from './types';\n\n/**\n * @class\n * PageView - a class for creating an instance of a page view data\n * */\nexport class PageView extends Nonce implements IKameleoonData {\n private urlAddress: string;\n private title: string;\n private referrers?: number[];\n\n /**\n * @param {PageViewParametersType} pageViewParameters - an object with page view parameters\n * */\n constructor({ urlAddress, title, referrers }: PageViewParametersType) {\n super();\n\n this.urlAddress = urlAddress;\n this.title = title;\n this.referrers = referrers;\n }\n\n /**\n * @property url - url for the current data type used for events tracking\n * */\n get url(): string {\n return (\n UrlEventType.Page +\n UrlParameter.Href +\n encodeURIComponent(this.urlAddress) +\n UrlParameter.Title +\n encodeURIComponent(this.title) +\n this.getReferresParameter(this.referrers) +\n UrlParameter.Nonce +\n this.nonce\n );\n }\n\n /**\n * @property data - data of the current class instance\n * */\n get data(): PageViewDataType {\n return {\n urlAddress: this.urlAddress,\n title: this.title,\n referrers: this.referrers,\n type: KameleoonData.PageView,\n nonce: this.nonce,\n };\n }\n\n private getReferresParameter(\n referrers: PageViewParametersType['referrers'],\n ): string {\n if (referrers) {\n return UrlParameter.ReferrersIndices + JSON.stringify(referrers);\n }\n\n return '';\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAKiB,SAAAG,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,IAAA,2BAAAK,GAAA,sBAAAA,GAAA,YAAAE,SAAA,4DAAAP,IAAA,gBAAAF,MAAA,GAAAU,MAAA,EAAAT,KAAA;AAEjB;AACA;AACA;AACA;AACO,MAAMU,QAAQ,SAASC,YAAK,CAA2B;EAK5D;AACF;AACA;EACEC,WAAWA,CAAC;IAAEC,UAAU;IAAEC,KAAK;IAAEC;EAAkC,CAAC,EAAE;IACpE,KAAK,EAAE;IAAC5B,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAER,IAAI,CAAC0B,UAAU,GAAGA,UAAU;IAC5B,IAAI,CAACC,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,SAAS,GAAGA,SAAS;EAC5B;;EAEA;AACF;AACA;EACE,IAAIC,GAAGA,CAAA,EAAW;IAChB,OACEC,uBAAY,CAACC,IAAI,GACjBC,uBAAY,CAACC,IAAI,GACjBC,kBAAkB,CAAC,IAAI,CAACR,UAAU,CAAC,GACnCM,uBAAY,CAACG,KAAK,GAClBD,kBAAkB,CAAC,IAAI,CAACP,KAAK,CAAC,GAC9B,IAAI,CAACS,oBAAoB,CAAC,IAAI,CAACR,SAAS,CAAC,GACzCI,uBAAY,CAACR,KAAK,GAClB,IAAI,CAACa,KAAK;EAEd;;EAEA;AACF;AACA;EACE,IAAIC,IAAIA,CAAA,EAAqB;IAC3B,OAAO;MACLZ,UAAU,EAAE,IAAI,CAACA,UAAU;MAC3BC,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBC,SAAS,EAAE,IAAI,CAACA,SAAS;MACzBW,IAAI,EAAEC,oBAAa,CAACjB,QAAQ;MAC5Bc,KAAK,EAAE,IAAI,CAACA;IACd,CAAC;EACH;EAEQD,oBAAoBA,CAC1BR,SAA8C,EACtC;IACR,IAAIA,SAAS,EAAE;MACb,OAAOI,uBAAY,CAACS,gBAAgB,GAAGC,IAAI,CAACC,SAAS,CAACf,SAAS,CAAC;IAClE;IAEA,OAAO,EAAE;EACX;AACF;AAACgB,OAAA,CAAArB,QAAA,GAAAA,QAAA"}
|
|
@@ -1,36 +1,51 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.KameleoonData = exports.DeviceType = exports.BrowserType = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* @interface an interface of KameleoonData
|
|
9
|
+
* each class instance will have url getter method
|
|
10
|
+
* for handling url of different data types
|
|
11
|
+
* */
|
|
12
|
+
/**
|
|
13
|
+
* @type a tuple of each possible type of data for `addData` method
|
|
14
|
+
* of KameleoonClient
|
|
15
|
+
* */
|
|
16
|
+
let KameleoonData = /*#__PURE__*/function (KameleoonData) {
|
|
17
|
+
KameleoonData["CustomData"] = "customData";
|
|
18
|
+
KameleoonData["PageView"] = "pageView";
|
|
19
|
+
KameleoonData["Browser"] = "browser";
|
|
20
|
+
KameleoonData["Conversion"] = "conversion";
|
|
21
|
+
KameleoonData["Device"] = "device";
|
|
22
|
+
KameleoonData["UserAgent"] = "userAgent";
|
|
23
|
+
return KameleoonData;
|
|
24
|
+
}({});
|
|
25
|
+
exports.KameleoonData = KameleoonData;
|
|
13
26
|
/**
|
|
14
27
|
* @readonly
|
|
15
28
|
* @enum {string} an Enum containing all possible variants for device type
|
|
16
29
|
* */
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
30
|
+
let DeviceType = /*#__PURE__*/function (DeviceType) {
|
|
31
|
+
DeviceType["Phone"] = "PHONE";
|
|
32
|
+
DeviceType["Tablet"] = "TABLET";
|
|
33
|
+
DeviceType["Desktop"] = "DESKTOP";
|
|
34
|
+
return DeviceType;
|
|
35
|
+
}({});
|
|
23
36
|
/**
|
|
24
37
|
* @readonly
|
|
25
38
|
* @enum {number} an Enum containing all possible variants for browser type
|
|
26
39
|
* */
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
40
|
+
exports.DeviceType = DeviceType;
|
|
41
|
+
let BrowserType = /*#__PURE__*/function (BrowserType) {
|
|
42
|
+
BrowserType[BrowserType["Chrome"] = 0] = "Chrome";
|
|
43
|
+
BrowserType[BrowserType["InternetExplorer"] = 1] = "InternetExplorer";
|
|
44
|
+
BrowserType[BrowserType["Firefox"] = 2] = "Firefox";
|
|
45
|
+
BrowserType[BrowserType["Safari"] = 3] = "Safari";
|
|
46
|
+
BrowserType[BrowserType["Opera"] = 4] = "Opera";
|
|
47
|
+
BrowserType[BrowserType["Other"] = 5] = "Other";
|
|
48
|
+
return BrowserType;
|
|
49
|
+
}({});
|
|
50
|
+
exports.BrowserType = BrowserType;
|
|
36
51
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","
|
|
1
|
+
{"version":3,"file":"types.js","names":["KameleoonData","exports","DeviceType","BrowserType"],"sources":["../../src/kameleoonData/types.ts"],"sourcesContent":["import {\n Browser,\n Conversion,\n CustomData,\n Device,\n PageView,\n UserAgent,\n} from './';\n\nexport type KameleoonDataItemType =\n | BrowserDataType\n | ConversionDataType\n | CustomDataType\n | DeviceDataType\n | PageViewDataType\n | UserAgentDataType;\n\n/**\n * @interface an interface of KameleoonData\n * each class instance will have url getter method\n * for handling url of different data types\n * */\nexport interface IKameleoonData {\n readonly url: string;\n readonly data: KameleoonDataItemType;\n}\n\n/**\n * @type a tuple of each possible type of data for `addData` method\n * of KameleoonClient\n * */\nexport type KameleoonDataType =\n | Browser\n | Conversion\n | CustomData\n | Device\n | PageView\n | UserAgent;\n\nexport enum KameleoonData {\n CustomData = 'customData',\n PageView = 'pageView',\n Browser = 'browser',\n Conversion = 'conversion',\n Device = 'device',\n UserAgent = 'userAgent',\n}\n\nexport type BrowserDataType = {\n browser: BrowserType;\n type: KameleoonData;\n nonce: string;\n};\n\nexport type ConversionDataType = {\n goalId: number;\n revenue: number;\n negative: boolean;\n type: KameleoonData;\n nonce: string;\n};\n\nexport type CustomDataType = {\n index: number;\n value: string | string[];\n type: KameleoonData;\n nonce: string;\n};\n\nexport type DeviceDataType = {\n device: DeviceType;\n type: KameleoonData;\n nonce: string;\n};\n\nexport type PageViewDataType = {\n urlAddress: string;\n title: string;\n referrers?: number[];\n type: KameleoonData;\n nonce: string;\n};\n\nexport type UserAgentDataType = {\n value: string;\n type: KameleoonData;\n nonce: string;\n};\n\n/**\n * @param {number} goalId - an id of a goal to trac\n * @param {number | undefined} revenue - an optional parameter for revenue, default value is `0`\n * @param {boolean | undefined} negative - an optional parameteridentifying whether the conversion should be removed, default value is `false`\n * */\nexport type ConversionParametersType = {\n goalId: number;\n revenue?: number;\n negative?: boolean;\n};\n\n/**\n * @param {string} urlAddress - url address of the page to track\n * @param {string} title - title of the web page\n * @param {number[] | undefined} referrers - an optional parameter containing a list of refferesIndices, has no default value\n * */\nexport type PageViewParametersType = {\n urlAddress: string;\n title: string;\n referrers?: number[];\n};\n\n/**\n * @readonly\n * @enum {string} an Enum containing all possible variants for device type\n * */\nexport enum DeviceType {\n Phone = 'PHONE',\n Tablet = 'TABLET',\n Desktop = 'DESKTOP',\n}\n\n/**\n * @readonly\n * @enum {number} an Enum containing all possible variants for browser type\n * */\nexport enum BrowserType {\n Chrome,\n InternetExplorer,\n Firefox,\n Safari,\n Opera,\n Other,\n}\n"],"mappings":";;;;;;AAiBA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAHA,IAYYA,aAAa,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAAAC,OAAA,CAAAD,aAAA,GAAAA,aAAA;AAwEzB;AACA;AACA;AACA;AAHA,IAIYE,UAAU,0BAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAMtB;AACA;AACA;AACA;AAHAD,OAAA,CAAAC,UAAA,GAAAA,UAAA;AAAA,IAIYC,WAAW,0BAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAAAF,OAAA,CAAAE,WAAA,GAAAA,WAAA"}
|
|
@@ -1,33 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
3
6
|
exports.UserAgent = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
7
|
+
var _nonce = require("./nonce");
|
|
8
|
+
var _types = require("./types");
|
|
9
|
+
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; }
|
|
10
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
11
|
+
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); }
|
|
6
12
|
/**
|
|
7
13
|
* @class
|
|
8
14
|
* UserAgent - a class for creating an instance for user agent
|
|
9
15
|
* */
|
|
10
|
-
class UserAgent extends
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
class UserAgent extends _nonce.Nonce {
|
|
17
|
+
constructor(value) {
|
|
18
|
+
super();
|
|
19
|
+
_defineProperty(this, "value", void 0);
|
|
20
|
+
this.value = value;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @property url - url for the current data type used for events tracking
|
|
25
|
+
* */
|
|
26
|
+
get url() {
|
|
27
|
+
return '';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @property data - data of the current class instance
|
|
32
|
+
* */
|
|
33
|
+
get data() {
|
|
34
|
+
return {
|
|
35
|
+
value: this.value,
|
|
36
|
+
type: _types.KameleoonData.UserAgent,
|
|
37
|
+
nonce: this.nonce
|
|
38
|
+
};
|
|
39
|
+
}
|
|
31
40
|
}
|
|
32
41
|
exports.UserAgent = UserAgent;
|
|
33
42
|
//# sourceMappingURL=userAgent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userAgent.js","
|
|
1
|
+
{"version":3,"file":"userAgent.js","names":["_nonce","require","_types","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","UserAgent","Nonce","constructor","url","data","type","KameleoonData","nonce","exports"],"sources":["../../src/kameleoonData/userAgent.ts"],"sourcesContent":["import { Nonce } from './nonce';\nimport { UserAgentDataType, IKameleoonData, KameleoonData } from './types';\n\n/**\n * @class\n * UserAgent - a class for creating an instance for user agent\n * */\nexport class UserAgent extends Nonce implements IKameleoonData {\n private value: string;\n\n constructor(value: string) {\n super();\n\n this.value = value;\n }\n\n /**\n * @property url - url for the current data type used for events tracking\n * */\n get url(): string {\n return '';\n }\n\n /**\n * @property data - data of the current class instance\n * */\n get data(): UserAgentDataType {\n return {\n value: this.value,\n type: KameleoonData.UserAgent,\n nonce: this.nonce,\n };\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAA2E,SAAAE,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,IAAA,2BAAAK,GAAA,sBAAAA,GAAA,YAAAE,SAAA,4DAAAP,IAAA,gBAAAF,MAAA,GAAAU,MAAA,EAAAT,KAAA;AAE3E;AACA;AACA;AACA;AACO,MAAMU,SAAS,SAASC,YAAK,CAA2B;EAG7DC,WAAWA,CAACtB,KAAa,EAAE;IACzB,KAAK,EAAE;IAACH,eAAA;IAER,IAAI,CAACG,KAAK,GAAGA,KAAK;EACpB;;EAEA;AACF;AACA;EACE,IAAIuB,GAAGA,CAAA,EAAW;IAChB,OAAO,EAAE;EACX;;EAEA;AACF;AACA;EACE,IAAIC,IAAIA,CAAA,EAAsB;IAC5B,OAAO;MACLxB,KAAK,EAAE,IAAI,CAACA,KAAK;MACjByB,IAAI,EAAEC,oBAAa,CAACN,SAAS;MAC7BO,KAAK,EAAE,IAAI,CAACA;IACd,CAAC;EACH;AACF;AAACC,OAAA,CAAAR,SAAA,GAAAA,SAAA"}
|
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
3
6
|
exports.ERROR_MESSAGES = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
7
|
+
var _types = require("./types");
|
|
8
|
+
const ERROR_MESSAGES = {
|
|
9
|
+
[_types.KameleoonException.JSONParse]: err => `Couldn't parse JSON variable: ${err}`,
|
|
10
|
+
[_types.KameleoonException.NumberParse]: value => `It's not possible to parse value ${value} to Number`,
|
|
11
|
+
[_types.KameleoonException.Initialization]: () => "It seems that the client wasn't properly initialized, make sure to run `initialize` method before invoking other methods",
|
|
12
|
+
[_types.KameleoonException.StorageInitialization]: () => "There was an error while initializing React Native SDK storage, it seems that the storage library dependency wasn't installed",
|
|
13
|
+
[_types.KameleoonException.EventSourceInitialization]: () => "There was an error while initializing Real Time Update service, it seems that the event source library dependency wasn't installed",
|
|
14
|
+
[_types.KameleoonException.DataInconsistency]: () => "Variation was found in the storage, but the server data doesn't contain corresponding variation, try to reload the client",
|
|
15
|
+
[_types.KameleoonException.FeatureFlagConfigurationNotFound]: (featureKey, visitorCode) => `No feature flag with key ${featureKey} was found for ${visitorCode} visitorCode.`,
|
|
16
|
+
[_types.KameleoonException.ExperimentConfigurationNotFound]: (experimentId, visitorCode) => `No experiment with id ${experimentId} was found for ${visitorCode} visitorCode.`,
|
|
17
|
+
[_types.KameleoonException.NotTargeted]: visitorCode => `Visitor code ${visitorCode} is not targeted`,
|
|
18
|
+
[_types.KameleoonException.NotAllocated]: visitorCode => `Visitor with visitor code ${visitorCode} is in unallocated traffic, there is no variation id to be assigned to the visitor.`,
|
|
19
|
+
[_types.KameleoonException.VisitorCodeMaxLength]: () => 'Visitor code can not be more than 255 characters long',
|
|
20
|
+
[_types.KameleoonException.StorageWrite]: err => `Couldn't update storage for kameleoonClient: ${err}`,
|
|
21
|
+
[_types.KameleoonException.StorageRead]: key => `No data found in storage under ${key} key`,
|
|
22
|
+
[_types.KameleoonException.StorageParse]: (err, key) => `Couldn't parse ${key} storage data, the data may be corrupted. Error: ${err}`,
|
|
23
|
+
[_types.KameleoonException.ClientConfiguration]: () => "Couldn't retrieve client configuration from Kameleoon Api",
|
|
24
|
+
[_types.KameleoonException.TargetingCondition]: targetingType => `${targetingType} targeting condition is not yet supported.`,
|
|
25
|
+
[_types.KameleoonException.AmongValuesCheck]: (err, value) => `Couldn't parse value "${value}": ${err}`,
|
|
26
|
+
[_types.KameleoonException.RemoteData]: () => `Couldn't retrieve data from Kameleoon server`
|
|
24
27
|
};
|
|
28
|
+
exports.ERROR_MESSAGES = ERROR_MESSAGES;
|
|
25
29
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","
|
|
1
|
+
{"version":3,"file":"constants.js","names":["_types","require","ERROR_MESSAGES","KameleoonException","JSONParse","err","NumberParse","value","Initialization","StorageInitialization","EventSourceInitialization","DataInconsistency","FeatureFlagConfigurationNotFound","featureKey","visitorCode","ExperimentConfigurationNotFound","experimentId","NotTargeted","NotAllocated","VisitorCodeMaxLength","StorageWrite","StorageRead","key","StorageParse","ClientConfiguration","TargetingCondition","targetingType","AmongValuesCheck","RemoteData","exports"],"sources":["../../src/kameleoonError/constants.ts"],"sourcesContent":["import { KameleoonStorageKey } from '../storage';\nimport { TargetingType } from '../targeting';\nimport { KameleoonException } from './types';\n\nexport const ERROR_MESSAGES = {\n [KameleoonException.JSONParse]: (err: unknown) =>\n `Couldn't parse JSON variable: ${err}`,\n [KameleoonException.NumberParse]: (value: string) =>\n `It's not possible to parse value ${value} to Number`,\n [KameleoonException.Initialization]: () =>\n \"It seems that the client wasn't properly initialized, make sure to run `initialize` method before invoking other methods\",\n [KameleoonException.StorageInitialization]: () =>\n \"There was an error while initializing React Native SDK storage, it seems that the storage library dependency wasn't installed\",\n [KameleoonException.EventSourceInitialization]: () =>\n \"There was an error while initializing Real Time Update service, it seems that the event source library dependency wasn't installed\",\n [KameleoonException.DataInconsistency]: () =>\n \"Variation was found in the storage, but the server data doesn't contain corresponding variation, try to reload the client\",\n [KameleoonException.FeatureFlagConfigurationNotFound]: (\n featureKey: string,\n visitorCode: string,\n ) =>\n `No feature flag with key ${featureKey} was found for ${visitorCode} visitorCode.`,\n [KameleoonException.ExperimentConfigurationNotFound]: (\n experimentId: number,\n visitorCode: string,\n ) =>\n `No experiment with id ${experimentId} was found for ${visitorCode} visitorCode.`,\n [KameleoonException.NotTargeted]: (visitorCode: string) =>\n `Visitor code ${visitorCode} is not targeted`,\n [KameleoonException.NotAllocated]: (visitorCode: string) =>\n `Visitor with visitor code ${visitorCode} is in unallocated traffic, there is no variation id to be assigned to the visitor.`,\n [KameleoonException.VisitorCodeMaxLength]: () =>\n 'Visitor code can not be more than 255 characters long',\n [KameleoonException.StorageWrite]: (err: unknown) =>\n `Couldn't update storage for kameleoonClient: ${err}`,\n [KameleoonException.StorageRead]: (key: KameleoonStorageKey) =>\n `No data found in storage under ${key} key`,\n [KameleoonException.StorageParse]: (err: unknown, key: KameleoonStorageKey) =>\n `Couldn't parse ${key} storage data, the data may be corrupted. Error: ${err}`,\n [KameleoonException.ClientConfiguration]: () =>\n \"Couldn't retrieve client configuration from Kameleoon Api\",\n [KameleoonException.TargetingCondition]: (targetingType: TargetingType) =>\n `${targetingType} targeting condition is not yet supported.`,\n [KameleoonException.AmongValuesCheck]: (err: unknown, value: string) =>\n `Couldn't parse value \"${value}\": ${err}`,\n [KameleoonException.RemoteData]: () =>\n `Couldn't retrieve data from Kameleoon server`,\n};\n"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AAEO,MAAMC,cAAc,GAAG;EAC5B,CAACC,yBAAkB,CAACC,SAAS,GAAIC,GAAY,IAC1C,iCAAgCA,GAAI,EAAC;EACxC,CAACF,yBAAkB,CAACG,WAAW,GAAIC,KAAa,IAC7C,oCAAmCA,KAAM,YAAW;EACvD,CAACJ,yBAAkB,CAACK,cAAc,GAAG,MACnC,0HAA0H;EAC5H,CAACL,yBAAkB,CAACM,qBAAqB,GAAG,MAC1C,+HAA+H;EACjI,CAACN,yBAAkB,CAACO,yBAAyB,GAAG,MAC9C,oIAAoI;EACtI,CAACP,yBAAkB,CAACQ,iBAAiB,GAAG,MACtC,2HAA2H;EAC7H,CAACR,yBAAkB,CAACS,gCAAgC,GAAG,CACrDC,UAAkB,EAClBC,WAAmB,KAElB,4BAA2BD,UAAW,kBAAiBC,WAAY,eAAc;EACpF,CAACX,yBAAkB,CAACY,+BAA+B,GAAG,CACpDC,YAAoB,EACpBF,WAAmB,KAElB,yBAAwBE,YAAa,kBAAiBF,WAAY,eAAc;EACnF,CAACX,yBAAkB,CAACc,WAAW,GAAIH,WAAmB,IACnD,gBAAeA,WAAY,kBAAiB;EAC/C,CAACX,yBAAkB,CAACe,YAAY,GAAIJ,WAAmB,IACpD,6BAA4BA,WAAY,qFAAoF;EAC/H,CAACX,yBAAkB,CAACgB,oBAAoB,GAAG,MACzC,uDAAuD;EACzD,CAAChB,yBAAkB,CAACiB,YAAY,GAAIf,GAAY,IAC7C,gDAA+CA,GAAI,EAAC;EACvD,CAACF,yBAAkB,CAACkB,WAAW,GAAIC,GAAwB,IACxD,kCAAiCA,GAAI,MAAK;EAC7C,CAACnB,yBAAkB,CAACoB,YAAY,GAAG,CAAClB,GAAY,EAAEiB,GAAwB,KACvE,kBAAiBA,GAAI,oDAAmDjB,GAAI,EAAC;EAChF,CAACF,yBAAkB,CAACqB,mBAAmB,GAAG,MACxC,2DAA2D;EAC7D,CAACrB,yBAAkB,CAACsB,kBAAkB,GAAIC,aAA4B,IACnE,GAAEA,aAAc,4CAA2C;EAC9D,CAACvB,yBAAkB,CAACwB,gBAAgB,GAAG,CAACtB,GAAY,EAAEE,KAAa,KAChE,yBAAwBA,KAAM,MAAKF,GAAI,EAAC;EAC3C,CAACF,yBAAkB,CAACyB,UAAU,GAAG,MAC9B;AACL,CAAC;AAACC,OAAA,CAAA3B,cAAA,GAAAA,cAAA"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
exports
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.exhaustCheck = exhaustCheck;
|
|
4
7
|
function exhaustCheck(option) {
|
|
5
|
-
|
|
8
|
+
throw new Error(`Reaching an impossible state because of ${option}`);
|
|
6
9
|
}
|
|
7
|
-
exports.exhaustCheck = exhaustCheck;
|
|
8
10
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","
|
|
1
|
+
{"version":3,"file":"helpers.js","names":["exhaustCheck","option","Error"],"sources":["../../src/kameleoonError/helpers.ts"],"sourcesContent":["export function exhaustCheck(option: never): never {\n throw new Error(`Reaching an impossible state because of ${option}`);\n}\n"],"mappings":";;;;;;AAAO,SAASA,YAAYA,CAACC,MAAa,EAAS;EACjD,MAAM,IAAIC,KAAK,CAAE,2CAA0CD,MAAO,EAAC,CAAC;AACtE"}
|