@kameleoon/javascript-sdk-core 2.9.0 → 2.10.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/package.json +2 -2
- package/dist/cacheManager/cacheManager.d.ts +0 -38
- package/dist/cacheManager/cacheManager.js +0 -12
- package/dist/cacheManager/cacheManager.js.map +0 -1
- package/dist/cacheManager/index.d.ts +0 -2
- package/dist/cacheManager/index.js +0 -2
- package/dist/cacheManager/index.js.map +0 -1
- package/dist/cacheManager/types.d.ts +0 -14
- package/dist/cacheManager/types.js +0 -2
- package/dist/cacheManager/types.js.map +0 -1
- package/dist/campaignConfiguration/campaignConfiguration.d.ts +0 -71
- package/dist/campaignConfiguration/campaignConfiguration.js +0 -24
- package/dist/campaignConfiguration/campaignConfiguration.js.map +0 -1
- package/dist/campaignConfiguration/constants.d.ts +0 -6
- package/dist/campaignConfiguration/constants.js +0 -4
- package/dist/campaignConfiguration/constants.js.map +0 -1
- package/dist/campaignConfiguration/index.d.ts +0 -3
- package/dist/campaignConfiguration/index.js +0 -2
- package/dist/campaignConfiguration/index.js.map +0 -1
- package/dist/campaignConfiguration/types.d.ts +0 -155
- package/dist/campaignConfiguration/types.js +0 -2
- package/dist/campaignConfiguration/types.js.map +0 -1
- package/dist/clientSettings/clientSettings.d.ts +0 -12
- package/dist/clientSettings/clientSettings.js +0 -2
- package/dist/clientSettings/clientSettings.js.map +0 -1
- package/dist/clientSettings/index.d.ts +0 -2
- package/dist/clientSettings/index.js +0 -2
- package/dist/clientSettings/index.js.map +0 -1
- package/dist/clientSettings/types.d.ts +0 -6
- package/dist/clientSettings/types.js +0 -2
- package/dist/clientSettings/types.js.map +0 -1
- package/dist/constants.d.ts +0 -32
- package/dist/constants.js +0 -5
- package/dist/constants.js.map +0 -1
- package/dist/eventSource/constants.d.ts +0 -1
- package/dist/eventSource/constants.js +0 -2
- package/dist/eventSource/constants.js.map +0 -1
- package/dist/eventSource/externalEventSource.d.ts +0 -12
- package/dist/eventSource/externalEventSource.js +0 -2
- package/dist/eventSource/externalEventSource.js.map +0 -1
- package/dist/eventSource/index.d.ts +0 -3
- package/dist/eventSource/index.js +0 -2
- package/dist/eventSource/index.js.map +0 -1
- package/dist/eventSource/types.d.ts +0 -47
- package/dist/eventSource/types.js +0 -2
- package/dist/eventSource/types.js.map +0 -1
- package/dist/hasher/hasher.d.ts +0 -6
- package/dist/hasher/hasher.js +0 -7
- package/dist/hasher/hasher.js.map +0 -1
- package/dist/hasher/index.d.ts +0 -1
- package/dist/hasher/index.js +0 -2
- package/dist/hasher/index.js.map +0 -1
- package/dist/hasher/types.d.ts +0 -12
- package/dist/hasher/types.js +0 -2
- package/dist/hasher/types.js.map +0 -1
- package/dist/index.d.ts +0 -12
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -1
- package/dist/kameleoonClient.d.ts +0 -253
- package/dist/kameleoonClient.js +0 -19
- package/dist/kameleoonClient.js.map +0 -1
- package/dist/kameleoonData/browser.d.ts +0 -26
- package/dist/kameleoonData/browser.js +0 -18
- package/dist/kameleoonData/browser.js.map +0 -1
- package/dist/kameleoonData/conversion.d.ts +0 -23
- package/dist/kameleoonData/conversion.js +0 -14
- package/dist/kameleoonData/conversion.js.map +0 -1
- package/dist/kameleoonData/customData.d.ts +0 -33
- package/dist/kameleoonData/customData.js +0 -25
- package/dist/kameleoonData/customData.js.map +0 -1
- package/dist/kameleoonData/device.d.ts +0 -21
- package/dist/kameleoonData/device.js +0 -14
- package/dist/kameleoonData/device.js.map +0 -1
- package/dist/kameleoonData/index.d.ts +0 -7
- package/dist/kameleoonData/index.js +0 -2
- package/dist/kameleoonData/index.js.map +0 -1
- package/dist/kameleoonData/pageView.d.ts +0 -23
- package/dist/kameleoonData/pageView.js +0 -14
- package/dist/kameleoonData/pageView.js.map +0 -1
- package/dist/kameleoonData/types.d.ts +0 -117
- package/dist/kameleoonData/types.js +0 -15
- package/dist/kameleoonData/types.js.map +0 -1
- package/dist/kameleoonData/userAgent.d.ts +0 -18
- package/dist/kameleoonData/userAgent.js +0 -9
- package/dist/kameleoonData/userAgent.js.map +0 -1
- package/dist/kameleoonError/constants.d.ts +0 -27
- package/dist/kameleoonError/constants.js +0 -2
- package/dist/kameleoonError/constants.js.map +0 -1
- package/dist/kameleoonError/helpers.d.ts +0 -1
- package/dist/kameleoonError/helpers.js +0 -2
- package/dist/kameleoonError/helpers.js.map +0 -1
- package/dist/kameleoonError/index.d.ts +0 -3
- package/dist/kameleoonError/index.js +0 -2
- package/dist/kameleoonError/index.js.map +0 -1
- package/dist/kameleoonError/kameleoonError.d.ts +0 -25
- package/dist/kameleoonError/kameleoonError.js +0 -5
- package/dist/kameleoonError/kameleoonError.js.map +0 -1
- package/dist/kameleoonError/types.d.ts +0 -25
- package/dist/kameleoonError/types.js +0 -2
- package/dist/kameleoonError/types.js.map +0 -1
- package/dist/kameleoonUtils.d.ts +0 -13
- package/dist/kameleoonUtils.js +0 -5
- package/dist/kameleoonUtils.js.map +0 -1
- package/dist/requester/constants.d.ts +0 -17
- package/dist/requester/constants.js +0 -3
- package/dist/requester/constants.js.map +0 -1
- package/dist/requester/index.d.ts +0 -3
- package/dist/requester/index.js +0 -2
- package/dist/requester/index.js.map +0 -1
- package/dist/requester/requester.d.ts +0 -23
- package/dist/requester/requester.js +0 -2
- package/dist/requester/requester.js.map +0 -1
- package/dist/requester/types.d.ts +0 -100
- package/dist/requester/types.js +0 -2
- package/dist/requester/types.js.map +0 -1
- package/dist/storage/constants.d.ts +0 -10
- package/dist/storage/constants.js +0 -5
- package/dist/storage/constants.js.map +0 -1
- package/dist/storage/externalStorage.d.ts +0 -11
- package/dist/storage/externalStorage.js +0 -2
- package/dist/storage/externalStorage.js.map +0 -1
- package/dist/storage/index.d.ts +0 -3
- package/dist/storage/index.js +0 -2
- package/dist/storage/index.js.map +0 -1
- package/dist/storage/types.d.ts +0 -63
- package/dist/storage/types.js +0 -2
- package/dist/storage/types.js.map +0 -1
- package/dist/targeting/conditions/browserCondition.d.ts +0 -13
- package/dist/targeting/conditions/browserCondition.js +0 -2
- package/dist/targeting/conditions/browserCondition.js.map +0 -1
- package/dist/targeting/conditions/conditionFactory.d.ts +0 -6
- package/dist/targeting/conditions/conditionFactory.js +0 -2
- package/dist/targeting/conditions/conditionFactory.js.map +0 -1
- package/dist/targeting/conditions/conversionCondition.d.ts +0 -10
- package/dist/targeting/conditions/conversionCondition.js +0 -4
- package/dist/targeting/conditions/conversionCondition.js.map +0 -1
- package/dist/targeting/conditions/customDataCondition.d.ts +0 -14
- package/dist/targeting/conditions/customDataCondition.js +0 -8
- package/dist/targeting/conditions/customDataCondition.js.map +0 -1
- package/dist/targeting/conditions/deviceCondition.d.ts +0 -9
- package/dist/targeting/conditions/deviceCondition.js +0 -2
- package/dist/targeting/conditions/deviceCondition.js.map +0 -1
- package/dist/targeting/conditions/exclusiveExperimentCondition.d.ts +0 -7
- package/dist/targeting/conditions/exclusiveExperimentCondition.js +0 -2
- package/dist/targeting/conditions/exclusiveExperimentCondition.js.map +0 -1
- package/dist/targeting/conditions/index.d.ts +0 -12
- package/dist/targeting/conditions/index.js +0 -2
- package/dist/targeting/conditions/index.js.map +0 -1
- package/dist/targeting/conditions/pageTitleCondition.d.ts +0 -11
- package/dist/targeting/conditions/pageTitleCondition.js +0 -2
- package/dist/targeting/conditions/pageTitleCondition.js.map +0 -1
- package/dist/targeting/conditions/pageUrlCondition.d.ts +0 -11
- package/dist/targeting/conditions/pageUrlCondition.js +0 -2
- package/dist/targeting/conditions/pageUrlCondition.js.map +0 -1
- package/dist/targeting/conditions/sdkLanguageCondition.d.ts +0 -15
- package/dist/targeting/conditions/sdkLanguageCondition.js +0 -2
- package/dist/targeting/conditions/sdkLanguageCondition.js.map +0 -1
- package/dist/targeting/conditions/targetExperimentCondition.d.ts +0 -12
- package/dist/targeting/conditions/targetExperimentCondition.js +0 -2
- package/dist/targeting/conditions/targetExperimentCondition.js.map +0 -1
- package/dist/targeting/conditions/types.d.ts +0 -42
- package/dist/targeting/conditions/types.js +0 -2
- package/dist/targeting/conditions/types.js.map +0 -1
- package/dist/targeting/conditions/visitorCodeCondition.d.ts +0 -11
- package/dist/targeting/conditions/visitorCodeCondition.js +0 -2
- package/dist/targeting/conditions/visitorCodeCondition.js.map +0 -1
- package/dist/targeting/index.d.ts +0 -3
- package/dist/targeting/index.js +0 -2
- package/dist/targeting/index.js.map +0 -1
- package/dist/targeting/targetingNode.d.ts +0 -23
- package/dist/targeting/targetingNode.js +0 -2
- package/dist/targeting/targetingNode.js.map +0 -1
- package/dist/targeting/targetingTree.d.ts +0 -19
- package/dist/targeting/targetingTree.js +0 -35
- package/dist/targeting/targetingTree.js.map +0 -1
- package/dist/targeting/types.d.ts +0 -142
- package/dist/targeting/types.js +0 -2
- package/dist/targeting/types.js.map +0 -1
- package/dist/types.d.ts +0 -175
- package/dist/types.js +0 -42
- package/dist/types.js.map +0 -1
- package/dist/utilities/constants.d.ts +0 -2
- package/dist/utilities/constants.js +0 -2
- package/dist/utilities/constants.js.map +0 -1
- package/dist/utilities/index.d.ts +0 -2
- package/dist/utilities/index.js +0 -2
- package/dist/utilities/index.js.map +0 -1
- package/dist/utilities/types.d.ts +0 -64
- package/dist/utilities/types.js +0 -2
- package/dist/utilities/types.js.map +0 -1
- package/dist/utilities/utilities.d.ts +0 -27
- package/dist/utilities/utilities.js +0 -2
- package/dist/utilities/utilities.js.map +0 -1
- package/dist/variationConfiguration/index.d.ts +0 -2
- package/dist/variationConfiguration/index.js +0 -2
- package/dist/variationConfiguration/index.js.map +0 -1
- package/dist/variationConfiguration/types.d.ts +0 -28
- package/dist/variationConfiguration/types.js +0 -2
- package/dist/variationConfiguration/types.js.map +0 -1
- package/dist/variationConfiguration/variation.d.ts +0 -13
- package/dist/variationConfiguration/variation.js +0 -7
- package/dist/variationConfiguration/variation.js.map +0 -1
- package/dist/variationConfiguration/variationConfiguration.d.ts +0 -35
- package/dist/variationConfiguration/variationConfiguration.js +0 -66
- package/dist/variationConfiguration/variationConfiguration.js.map +0 -1
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { CustomDataType, IKameleoonData } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* @class
|
|
4
|
-
* CustomData - a class for creating an instance for user's custom data
|
|
5
|
-
* */
|
|
6
|
-
export declare class CustomData implements IKameleoonData {
|
|
7
|
-
private index;
|
|
8
|
-
private value;
|
|
9
|
-
private nonce;
|
|
10
|
-
/**
|
|
11
|
-
* @param {number} index - an index of custom data to be stored under in a state, an index of custom data can be specified in `Advanced Tools` section of Kameleoon Application
|
|
12
|
-
* @param {string[]} value - custom value to store under the specified id, value can be anything but has to be stringified to match the `string` type. *Note* value is variadic parameter and can be used as follows
|
|
13
|
-
* @example
|
|
14
|
-
* ```ts
|
|
15
|
-
* // - Single value
|
|
16
|
-
* const customData = new CustomData(0, 'value_1');
|
|
17
|
-
* // - Variadic number of values
|
|
18
|
-
* const customData = new CustomData(0, 'value_1', 'value_2', 'value_3');
|
|
19
|
-
* // - Array of values
|
|
20
|
-
* const values = ['value_1', 'value_2', 'value_3'];
|
|
21
|
-
* const customData = new CustomData(0, ...values);
|
|
22
|
-
* ```
|
|
23
|
-
* */
|
|
24
|
-
constructor(index: number, ...value: string[]);
|
|
25
|
-
/**
|
|
26
|
-
* @property url - url for the current data type used for events tracking
|
|
27
|
-
* */
|
|
28
|
-
get url(): string;
|
|
29
|
-
/**
|
|
30
|
-
* @property data - data of the current class instance
|
|
31
|
-
* */
|
|
32
|
-
get data(): CustomDataType;
|
|
33
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CustomData=void 0;var _requester=require("../requester"),_utilities=require("../utilities"),_types=require("./types");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_unsupportedIterableToArray(a)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _iterableToArray(a){if("undefined"!=typeof Symbol&&null!=a[Symbol.iterator]||null!=a["@@iterator"])return Array.from(a)}function _arrayWithoutHoles(a){if(Array.isArray(a))return _arrayLikeToArray(a)}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _defineProperty(a,b,c){return b=_toPropertyKey(b),b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"===_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!==_typeof(a)||null===a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var d=c.call(a,b||"default");if("object"!==_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}/**
|
|
2
|
-
* @class
|
|
3
|
-
* CustomData - a class for creating an instance for user's custom data
|
|
4
|
-
* */var CustomData=/*#__PURE__*/function(){/**
|
|
5
|
-
* @param {number} index - an index of custom data to be stored under in a state, an index of custom data can be specified in `Advanced Tools` section of Kameleoon Application
|
|
6
|
-
* @param {string[]} value - custom value to store under the specified id, value can be anything but has to be stringified to match the `string` type. *Note* value is variadic parameter and can be used as follows
|
|
7
|
-
* @example
|
|
8
|
-
* ```ts
|
|
9
|
-
* // - Single value
|
|
10
|
-
* const customData = new CustomData(0, 'value_1');
|
|
11
|
-
* // - Variadic number of values
|
|
12
|
-
* const customData = new CustomData(0, 'value_1', 'value_2', 'value_3');
|
|
13
|
-
* // - Array of values
|
|
14
|
-
* const values = ['value_1', 'value_2', 'value_3'];
|
|
15
|
-
* const customData = new CustomData(0, ...values);
|
|
16
|
-
* ```
|
|
17
|
-
* */function a(b){_classCallCheck(this,a),_defineProperty(this,"index",void 0),_defineProperty(this,"value",void 0),_defineProperty(this,"nonce",void 0),this.index=b;for(var c=arguments.length,d=Array(1<c?c-1:0),e=1;e<c;e++)d[e-1]=arguments[e];this.value=d,this.nonce=_utilities.Utilities.getNonce()}/**
|
|
18
|
-
* @property url - url for the current data type used for events tracking
|
|
19
|
-
* */return _createClass(a,[{key:"url",get:function get(){// --- Note ---
|
|
20
|
-
// If SDK is used in vanilla JS codebase, then you're also able to create an instance
|
|
21
|
-
// with no required data, we don't want send anything to tracking in that case
|
|
22
|
-
if("number"!=typeof this.index)return"";var a=_toConsumableArray(new Set(this.value)),b={};return a.forEach(function(a){b[a]=1}),Object.keys(b).length?_requester.UrlEventType.CustomData+_requester.UrlParameter.Index+this.index+_requester.UrlParameter.ValuesCountMap+encodeURIComponent(JSON.stringify(b))+_requester.UrlParameter.Overwrite+"true"+_requester.UrlParameter.Nonce+this.nonce:""}/**
|
|
23
|
-
* @property data - data of the current class instance
|
|
24
|
-
* */},{key:"data",get:function get(){return{index:this.index,value:this.value,type:_types.KameleoonData.CustomData,nonce:this.nonce}}}]),a}();exports.CustomData=CustomData;
|
|
25
|
-
//# sourceMappingURL=customData.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"customData.js","names":["CustomData","a","index","_classCallCheck","_defineProperty","c","arguments","length","value","Array","e","nonce","Utilities","getNonce","_createClass","key","get","uniqueValues","_toConsumableArray","Set","resultValue","forEach","Object","keys","UrlEventType","UrlParameter","Index","ValuesCountMap","encodeURIComponent","JSON","stringify","Overwrite","Nonce","type","KameleoonData","exports"],"sources":["../../src/kameleoonData/customData.ts"],"sourcesContent":["import { UrlEventType, UrlParameter } from 'src/requester';\nimport { Utilities } from 'src/utilities';\nimport { CustomDataType, IKameleoonData, KameleoonData } from './types';\n\n/**\n * @class\n * CustomData - a class for creating an instance for user's custom data\n * */\nexport class CustomData implements IKameleoonData {\n private index: number;\n private value: string[];\n private nonce: string;\n\n /**\n * @param {number} index - an index of custom data to be stored under in a state, an index of custom data can be specified in `Advanced Tools` section of Kameleoon Application\n * @param {string[]} value - custom value to store under the specified id, value can be anything but has to be stringified to match the `string` type. *Note* value is variadic parameter and can be used as follows\n * @example\n * ```ts\n * // - Single value\n * const customData = new CustomData(0, 'value_1');\n * // - Variadic number of values\n * const customData = new CustomData(0, 'value_1', 'value_2', 'value_3');\n * // - Array of values\n * const values = ['value_1', 'value_2', 'value_3'];\n * const customData = new CustomData(0, ...values);\n * ```\n * */\n constructor(index: number, ...value: string[]) {\n this.index = index;\n this.value = value;\n this.nonce = Utilities.getNonce();\n }\n\n /**\n * @property url - url for the current data type used for events tracking\n * */\n get url(): string {\n // --- Note ---\n // If SDK is used in vanilla JS codebase, then you're also able to create an instance\n // with no required data, we don't want send anything to tracking in that case\n if (typeof this.index !== 'number') {\n return '';\n }\n\n const uniqueValues = [...new Set(this.value)];\n let resultValue: Record<string, 1> = {};\n\n // --- Note ---\n // Final value should look like this `{ \"value_1\": 1, \"value_2\": 1, \"value_3\": 1}`\n // With no duplicates\n uniqueValues.forEach((value) => {\n resultValue[value] = 1;\n });\n\n if (!Object.keys(resultValue).length) {\n return '';\n }\n\n return (\n UrlEventType.CustomData +\n UrlParameter.Index +\n this.index +\n UrlParameter.ValuesCountMap +\n encodeURIComponent(JSON.stringify(resultValue)) +\n UrlParameter.Overwrite +\n String(true) +\n UrlParameter.Nonce +\n this.nonce\n );\n }\n\n /**\n * @property data - data of the current class instance\n * */\n get data(): CustomDataType {\n return {\n index: this.index,\n value: this.value,\n type: KameleoonData.CustomData,\n nonce: this.nonce,\n };\n }\n}\n"],"mappings":"04EAIA;AACA;AACA;AACA,KAHA,GAIa,CAAAA,UAAU,yBAKrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OACE,SAAAC,EAAYC,CAAa,CAAsB,CAAAC,eAAA,MAAAF,CAAA,EAAAG,eAAA,sBAAAA,eAAA,sBAAAA,eAAA,sBAC7C,IAAI,CAACF,KAAK,CAAGA,CAAK,SAAAG,CAAA,CAAAC,SAAA,CAAAC,MAAA,CADUC,CAAK,CAAAC,KAAA,GAAAJ,CAAA,CAAAA,CAAA,MAAAK,CAAA,GAAAA,CAAA,CAAAL,CAAA,CAAAK,CAAA,GAALF,CAAK,CAAAE,CAAA,IAAAJ,SAAA,CAAAI,CAAA,EAEjC,IAAI,CAACF,KAAK,CAAGA,CAAK,CAClB,IAAI,CAACG,KAAK,CAAGC,oBAAS,CAACC,QAAQ,EACjC,CAEA;AACF;AACA,OAFE,OAAAC,YAAA,CAAAb,CAAA,GAAAc,GAAA,OAAAC,GAAA,CAGA,SAAAA,IAAA,CAAkB,CAChB;AACA;AACA;AACA,GAA0B,QAAQ,EAA9B,MAAO,KAAI,CAACd,KAAkB,CAChC,MAAO,EAAE,CACV,GAEK,CAAAe,CAAY,CAAAC,kBAAA,CAAO,GAAI,CAAAC,GAAG,CAAC,IAAI,CAACX,KAAK,CAAC,CAAC,CACzCY,CAA8B,CAAG,CAAC,CAAC,OAKvC,CAAAH,CAAY,CAACI,OAAO,CAAC,SAACb,CAAK,CAAK,CAC9BY,CAAW,CAACZ,CAAK,CAAC,CAAG,CACvB,CAAC,CAAC,CAEGc,MAAM,CAACC,IAAI,CAACH,CAAW,CAAC,CAACb,MAAM,CAKlCiB,uBAAY,CAACxB,UAAU,CACvByB,uBAAY,CAACC,KAAK,CAClB,IAAI,CAACxB,KAAK,CACVuB,uBAAY,CAACE,cAAc,CAC3BC,kBAAkB,CAACC,IAAI,CAACC,SAAS,CAACV,CAAW,CAAC,CAAC,CAC/CK,uBAAY,CAACM,SAAS,OACV,CACZN,uBAAY,CAACO,KAAK,CAClB,IAAI,CAACrB,KAAK,CAZH,EAcX,CAEA;AACF;AACA,OAFE,GAAAI,GAAA,QAAAC,GAAA,CAGA,SAAAA,IAAA,CAA2B,CACzB,MAAO,CACLd,KAAK,CAAE,IAAI,CAACA,KAAK,CACjBM,KAAK,CAAE,IAAI,CAACA,KAAK,CACjByB,IAAI,CAAEC,oBAAa,CAAClC,UAAU,CAC9BW,KAAK,CAAE,IAAI,CAACA,KACd,CACF,CAAC,IAAAV,CAAA,IAAAkC,OAAA,CAAAnC,UAAA,CAAAA,UAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { DeviceDataType, DeviceType, IKameleoonData } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* @class
|
|
4
|
-
* Device - a class for creating an instance for device of a certain type
|
|
5
|
-
* */
|
|
6
|
-
export declare class Device implements IKameleoonData {
|
|
7
|
-
private device;
|
|
8
|
-
private nonce;
|
|
9
|
-
/**
|
|
10
|
-
* @param {DeviceType} device - one of the available device types from `DeviceType` enum
|
|
11
|
-
* */
|
|
12
|
-
constructor(device: DeviceType);
|
|
13
|
-
/**
|
|
14
|
-
* @property url - url for the current data type used for events tracking
|
|
15
|
-
* */
|
|
16
|
-
get url(): string;
|
|
17
|
-
/**
|
|
18
|
-
* @property data - data of the current class instance
|
|
19
|
-
* */
|
|
20
|
-
get data(): DeviceDataType;
|
|
21
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Device=void 0;var _requester=require("../requester"),_utilities=require("../utilities"),_types=require("./types");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _defineProperty(a,b,c){return b=_toPropertyKey(b),b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"===_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!==_typeof(a)||null===a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var d=c.call(a,b||"default");if("object"!==_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}/**
|
|
2
|
-
* @class
|
|
3
|
-
* Device - a class for creating an instance for device of a certain type
|
|
4
|
-
* */var Device=/*#__PURE__*/function(){/**
|
|
5
|
-
* @param {DeviceType} device - one of the available device types from `DeviceType` enum
|
|
6
|
-
* */function a(b){_classCallCheck(this,a),_defineProperty(this,"device",void 0),_defineProperty(this,"nonce",void 0),this.device=b,this.nonce=_utilities.Utilities.getNonce()}/**
|
|
7
|
-
* @property url - url for the current data type used for events tracking
|
|
8
|
-
* */return _createClass(a,[{key:"url",get:function get(){// --- Note ---
|
|
9
|
-
// If SDK is used in vanilla JS codebase, then you're also able to create an instance
|
|
10
|
-
// with no required data, we don't want send anything to tracking in that case
|
|
11
|
-
return this.device?_requester.UrlEventType.StaticData+_requester.UrlParameter.DeviceType+this.device+_requester.UrlParameter.Nonce+this.nonce:""}/**
|
|
12
|
-
* @property data - data of the current class instance
|
|
13
|
-
* */},{key:"data",get:function get(){return{device:this.device,type:_types.KameleoonData.Device,nonce:this.nonce}}}]),a}();exports.Device=Device;
|
|
14
|
-
//# sourceMappingURL=device.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"device.js","names":["Device","a","device","_classCallCheck","_defineProperty","nonce","Utilities","getNonce","_createClass","key","get","UrlEventType","StaticData","UrlParameter","DeviceType","Nonce","type","KameleoonData","exports"],"sources":["../../src/kameleoonData/device.ts"],"sourcesContent":["import { UrlEventType, UrlParameter } from 'src/requester';\nimport { Utilities } from 'src/utilities';\nimport {\n DeviceDataType,\n DeviceType,\n IKameleoonData,\n KameleoonData,\n} from './types';\n\n/**\n * @class\n * Device - a class for creating an instance for device of a certain type\n * */\nexport class Device implements IKameleoonData {\n private device: DeviceType;\n private nonce: string;\n\n /**\n * @param {DeviceType} device - one of the available device types from `DeviceType` enum\n * */\n constructor(device: DeviceType) {\n this.device = device;\n this.nonce = Utilities.getNonce();\n }\n\n /**\n * @property url - url for the current data type used for events tracking\n * */\n get url(): string {\n // --- Note ---\n // If SDK is used in vanilla JS codebase, then you're also able to create an instance\n // with no required data, we don't want send anything to tracking in that case\n if (!this.device) {\n return '';\n }\n\n return (\n UrlEventType.StaticData +\n UrlParameter.DeviceType +\n this.device +\n UrlParameter.Nonce +\n this.nonce\n );\n }\n\n /**\n * @property data - data of the current class instance\n * */\n get data(): DeviceDataType {\n return {\n device: this.device,\n type: KameleoonData.Device,\n nonce: this.nonce,\n };\n }\n}\n"],"mappings":"u6CASA;AACA;AACA;AACA,KAHA,GAIa,CAAAA,MAAM,yBAIjB;AACF;AACA,OACE,SAAAC,EAAYC,CAAkB,CAAE,CAAAC,eAAA,MAAAF,CAAA,EAAAG,eAAA,uBAAAA,eAAA,sBAC9B,IAAI,CAACF,MAAM,CAAGA,CAAM,CACpB,IAAI,CAACG,KAAK,CAAGC,oBAAS,CAACC,QAAQ,EACjC,CAEA;AACF;AACA,OAFE,OAAAC,YAAA,CAAAP,CAAA,GAAAQ,GAAA,OAAAC,GAAA,CAGA,SAAAA,IAAA,CAAkB,CAChB;AACA;AACA;AAAA,MACK,KAAI,CAACR,MAAM,CAKdS,uBAAY,CAACC,UAAU,CACvBC,uBAAY,CAACC,UAAU,CACvB,IAAI,CAACZ,MAAM,CACXW,uBAAY,CAACE,KAAK,CAClB,IAAI,CAACV,KAAK,CARH,EAUX,CAEA;AACF;AACA,OAFE,GAAAI,GAAA,QAAAC,GAAA,CAGA,SAAAA,IAAA,CAA2B,CACzB,MAAO,CACLR,MAAM,CAAE,IAAI,CAACA,MAAM,CACnBc,IAAI,CAAEC,oBAAa,CAACjB,MAAM,CAC1BK,KAAK,CAAE,IAAI,CAACA,KACd,CACF,CAAC,IAAAJ,CAAA,IAAAiB,OAAA,CAAAlB,MAAA,CAAAA,MAAA"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { CustomData } from './customData';
|
|
2
|
-
export { Conversion } from './conversion';
|
|
3
|
-
export { Device } from './device';
|
|
4
|
-
export { Browser } from './browser';
|
|
5
|
-
export { PageView } from './pageView';
|
|
6
|
-
export { UserAgent } from './userAgent';
|
|
7
|
-
export { DeviceType, BrowserType, BrowserDataType, BrowserIndexMap, PageViewDataType, DeviceDataType, ConversionDataType, CustomDataType, KameleoonData, KameleoonDataType, KameleoonDataItemType, PageViewParametersType, ConversionParametersType, UserAgentDataType, } from './types';
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"Browser",{enumerable:!0,get:function get(){return _browser.Browser}}),Object.defineProperty(exports,"BrowserDataType",{enumerable:!0,get:function get(){return _types.BrowserDataType}}),Object.defineProperty(exports,"BrowserIndexMap",{enumerable:!0,get:function get(){return _types.BrowserIndexMap}}),Object.defineProperty(exports,"BrowserType",{enumerable:!0,get:function get(){return _types.BrowserType}}),Object.defineProperty(exports,"Conversion",{enumerable:!0,get:function get(){return _conversion.Conversion}}),Object.defineProperty(exports,"ConversionDataType",{enumerable:!0,get:function get(){return _types.ConversionDataType}}),Object.defineProperty(exports,"ConversionParametersType",{enumerable:!0,get:function get(){return _types.ConversionParametersType}}),Object.defineProperty(exports,"CustomData",{enumerable:!0,get:function get(){return _customData.CustomData}}),Object.defineProperty(exports,"CustomDataType",{enumerable:!0,get:function get(){return _types.CustomDataType}}),Object.defineProperty(exports,"Device",{enumerable:!0,get:function get(){return _device.Device}}),Object.defineProperty(exports,"DeviceDataType",{enumerable:!0,get:function get(){return _types.DeviceDataType}}),Object.defineProperty(exports,"DeviceType",{enumerable:!0,get:function get(){return _types.DeviceType}}),Object.defineProperty(exports,"KameleoonData",{enumerable:!0,get:function get(){return _types.KameleoonData}}),Object.defineProperty(exports,"KameleoonDataItemType",{enumerable:!0,get:function get(){return _types.KameleoonDataItemType}}),Object.defineProperty(exports,"KameleoonDataType",{enumerable:!0,get:function get(){return _types.KameleoonDataType}}),Object.defineProperty(exports,"PageView",{enumerable:!0,get:function get(){return _pageView.PageView}}),Object.defineProperty(exports,"PageViewDataType",{enumerable:!0,get:function get(){return _types.PageViewDataType}}),Object.defineProperty(exports,"PageViewParametersType",{enumerable:!0,get:function get(){return _types.PageViewParametersType}}),Object.defineProperty(exports,"UserAgent",{enumerable:!0,get:function get(){return _userAgent.UserAgent}}),Object.defineProperty(exports,"UserAgentDataType",{enumerable:!0,get:function get(){return _types.UserAgentDataType}});var _customData=require("./customData"),_conversion=require("./conversion"),_device=require("./device"),_browser=require("./browser"),_pageView=require("./pageView"),_userAgent=require("./userAgent"),_types=require("./types");
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"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 BrowserDataType,\n BrowserIndexMap,\n PageViewDataType,\n DeviceDataType,\n ConversionDataType,\n CustomDataType,\n KameleoonData,\n KameleoonDataType,\n KameleoonDataItemType,\n PageViewParametersType,\n ConversionParametersType,\n UserAgentDataType,\n} from './types';\n"],"mappings":""}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { IKameleoonData, PageViewDataType, PageViewParametersType } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* @class
|
|
4
|
-
* PageView - a class for creating an instance of a page view data
|
|
5
|
-
* */
|
|
6
|
-
export declare class PageView implements IKameleoonData {
|
|
7
|
-
private urlAddress;
|
|
8
|
-
private title;
|
|
9
|
-
private nonce;
|
|
10
|
-
private referrers?;
|
|
11
|
-
/**
|
|
12
|
-
* @param {PageViewParametersType} pageViewParameters - an object with page view parameters
|
|
13
|
-
* */
|
|
14
|
-
constructor({ urlAddress, title, referrers }: PageViewParametersType);
|
|
15
|
-
/**
|
|
16
|
-
* @property url - url for the current data type used for events tracking
|
|
17
|
-
* */
|
|
18
|
-
get url(): string;
|
|
19
|
-
/**
|
|
20
|
-
* @property data - data of the current class instance
|
|
21
|
-
* */
|
|
22
|
-
get data(): PageViewDataType;
|
|
23
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PageView=void 0;var _requester=require("../requester"),_utilities=require("../utilities"),_types=require("./types");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _defineProperty(a,b,c){return b=_toPropertyKey(b),b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"===_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!==_typeof(a)||null===a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var d=c.call(a,b||"default");if("object"!==_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}/**
|
|
2
|
-
* @class
|
|
3
|
-
* PageView - a class for creating an instance of a page view data
|
|
4
|
-
* */var PageView=/*#__PURE__*/function(){/**
|
|
5
|
-
* @param {PageViewParametersType} pageViewParameters - an object with page view parameters
|
|
6
|
-
* */function a(b){var c=b.urlAddress,d=b.title,e=b.referrers;_classCallCheck(this,a),_defineProperty(this,"urlAddress",void 0),_defineProperty(this,"title",void 0),_defineProperty(this,"nonce",void 0),_defineProperty(this,"referrers",void 0),this.urlAddress=c,this.title=d,this.referrers=e,this.nonce=_utilities.Utilities.getNonce()}/**
|
|
7
|
-
* @property url - url for the current data type used for events tracking
|
|
8
|
-
* */return _createClass(a,[{key:"url",get:function get(){var a;// --- Note ---
|
|
9
|
-
// If SDK is used in vanilla JS codebase, then you're also able to create an instance
|
|
10
|
-
// with no required data, we don't want send anything to tracking in that case
|
|
11
|
-
if(!this.urlAddress)return"";var b=this.title?_requester.UrlParameter.Title+encodeURIComponent(this.title):"",c=null!==(a=this.referrers)&&void 0!==a&&a.length?_requester.UrlParameter.ReferrersIndices+JSON.stringify(this.referrers):"";return _requester.UrlEventType.Page+_requester.UrlParameter.Href+encodeURIComponent(this.urlAddress)+b+c+_requester.UrlParameter.Nonce+this.nonce}/**
|
|
12
|
-
* @property data - data of the current class instance
|
|
13
|
-
* */},{key:"data",get:function get(){return{urlAddress:this.urlAddress,title:this.title,referrers:this.referrers,type:_types.KameleoonData.PageView,nonce:this.nonce}}}]),a}();exports.PageView=PageView;
|
|
14
|
-
//# sourceMappingURL=pageView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pageView.js","names":["PageView","a","b","urlAddress","title","referrers","_classCallCheck","_defineProperty","nonce","Utilities","getNonce","_createClass","key","get","titleParameter","UrlParameter","Title","encodeURIComponent","referrersParameter","length","ReferrersIndices","JSON","stringify","UrlEventType","Page","Href","Nonce","type","KameleoonData","exports"],"sources":["../../src/kameleoonData/pageView.ts"],"sourcesContent":["import { UrlEventType, UrlParameter } from 'src/requester';\nimport { Utilities } from 'src/utilities';\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 implements IKameleoonData {\n private urlAddress: string;\n private title: string;\n private nonce: 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 this.urlAddress = urlAddress;\n this.title = title;\n this.referrers = referrers;\n this.nonce = Utilities.getNonce();\n }\n\n /**\n * @property url - url for the current data type used for events tracking\n * */\n get url(): string {\n // --- Note ---\n // If SDK is used in vanilla JS codebase, then you're also able to create an instance\n // with no required data, we don't want send anything to tracking in that case\n if (!this.urlAddress) {\n return '';\n }\n\n const titleParameter = this.title\n ? UrlParameter.Title + encodeURIComponent(this.title)\n : '';\n\n const referrersParameter = this.referrers?.length\n ? UrlParameter.ReferrersIndices + JSON.stringify(this.referrers)\n : '';\n\n return (\n UrlEventType.Page +\n UrlParameter.Href +\n encodeURIComponent(this.urlAddress) +\n titleParameter +\n referrersParameter +\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"],"mappings":"y6CASA;AACA;AACA;AACA,KAHA,GAIa,CAAAA,QAAQ,yBAMnB;AACF;AACA,OACE,SAAAC,EAAAC,CAAA,CAAsE,IAAxD,CAAAC,CAAU,CAAAD,CAAA,CAAVC,UAAU,CAAEC,CAAK,CAAAF,CAAA,CAALE,KAAK,CAAEC,CAAS,CAAAH,CAAA,CAATG,SAAS,CAAAC,eAAA,MAAAL,CAAA,EAAAM,eAAA,2BAAAA,eAAA,sBAAAA,eAAA,sBAAAA,eAAA,0BACxC,IAAI,CAACJ,UAAU,CAAGA,CAAU,CAC5B,IAAI,CAACC,KAAK,CAAGA,CAAK,CAClB,IAAI,CAACC,SAAS,CAAGA,CAAS,CAC1B,IAAI,CAACG,KAAK,CAAGC,oBAAS,CAACC,QAAQ,EACjC,CAEA;AACF;AACA,OAFE,OAAAC,YAAA,CAAAV,CAAA,GAAAW,GAAA,OAAAC,GAAA,CAGA,SAAAA,IAAA,CAAkB,KAAAZ,CAAA,CAChB;AACA;AACA;AACA,GAAI,CAAC,IAAI,CAACE,UAAU,CAClB,MAAO,EAAE,CACV,GAEK,CAAAW,CAAc,CAAG,IAAI,CAACV,KAAK,CAC7BW,uBAAY,CAACC,KAAK,CAAGC,kBAAkB,CAAC,IAAI,CAACb,KAAK,CAAC,CACnD,EAAE,CAEAc,CAAkB,CAAG,QAAAjB,CAAA,KAAI,CAACI,SAAS,YAAAJ,CAAA,EAAdA,CAAA,CAAgBkB,MAAM,CAC7CJ,uBAAY,CAACK,gBAAgB,CAAGC,IAAI,CAACC,SAAS,CAAC,IAAI,CAACjB,SAAS,CAAC,CAC9D,EAAE,CAEN,MACE,CAAAkB,uBAAY,CAACC,IAAI,CACjBT,uBAAY,CAACU,IAAI,CACjBR,kBAAkB,CAAC,IAAI,CAACd,UAAU,CAAC,CACnCW,CAAc,CACdI,CAAkB,CAClBH,uBAAY,CAACW,KAAK,CAClB,IAAI,CAAClB,KAET,CAEA;AACF;AACA,OAFE,GAAAI,GAAA,QAAAC,GAAA,CAGA,SAAAA,IAAA,CAA6B,CAC3B,MAAO,CACLV,UAAU,CAAE,IAAI,CAACA,UAAU,CAC3BC,KAAK,CAAE,IAAI,CAACA,KAAK,CACjBC,SAAS,CAAE,IAAI,CAACA,SAAS,CACzBsB,IAAI,CAAEC,oBAAa,CAAC5B,QAAQ,CAC5BQ,KAAK,CAAE,IAAI,CAACA,KACd,CACF,CAAC,IAAAP,CAAA,IAAA4B,OAAA,CAAA7B,QAAA,CAAAA,QAAA"}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { Browser, Conversion, CustomData, Device, PageView, UserAgent } from './';
|
|
2
|
-
export type KameleoonDataItemType = BrowserDataType | ConversionDataType | CustomDataType | DeviceDataType | PageViewDataType | UserAgentDataType;
|
|
3
|
-
/**
|
|
4
|
-
* @interface an interface of KameleoonData
|
|
5
|
-
* each class instance will have url getter method
|
|
6
|
-
* for handling url of different data types
|
|
7
|
-
* */
|
|
8
|
-
export interface IKameleoonData {
|
|
9
|
-
readonly url: string;
|
|
10
|
-
readonly data: KameleoonDataItemType;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* @type a tuple of each possible type of data for `addData` method
|
|
14
|
-
* of KameleoonClient
|
|
15
|
-
* */
|
|
16
|
-
export type KameleoonDataType = Browser | Conversion | CustomData | Device | PageView | UserAgent;
|
|
17
|
-
export type ActivityTimePropertyType = {
|
|
18
|
-
lastActivityTime: number;
|
|
19
|
-
};
|
|
20
|
-
export type ExistingCustomDataType = NonNullable<KameleoonVisitorDataType[KameleoonData.CustomData]>;
|
|
21
|
-
export type ExistingDataType<T extends KameleoonData> = NonNullable<KameleoonVisitorDataType[T]>;
|
|
22
|
-
export type KameleoonVisitorDataType<T = ActivityTimePropertyType> = {
|
|
23
|
-
[KameleoonData.CustomData]?: {
|
|
24
|
-
[index: number]: (CustomDataType & T) | undefined;
|
|
25
|
-
};
|
|
26
|
-
[KameleoonData.Conversion]?: ConversionDataType & T;
|
|
27
|
-
[KameleoonData.UserAgent]?: UserAgentDataType & T;
|
|
28
|
-
[KameleoonData.PageView]?: PageViewDataType & T;
|
|
29
|
-
[KameleoonData.Browser]?: BrowserDataType & T;
|
|
30
|
-
[KameleoonData.Device]?: DeviceDataType & T;
|
|
31
|
-
};
|
|
32
|
-
export declare enum KameleoonData {
|
|
33
|
-
CustomData = "customData",
|
|
34
|
-
PageView = "pageView",
|
|
35
|
-
Browser = "browser",
|
|
36
|
-
Conversion = "conversion",
|
|
37
|
-
Device = "device",
|
|
38
|
-
UserAgent = "userAgent"
|
|
39
|
-
}
|
|
40
|
-
type SharedDataPropertiesType = {
|
|
41
|
-
type: KameleoonData;
|
|
42
|
-
nonce: string;
|
|
43
|
-
};
|
|
44
|
-
export type BrowserDataType = {
|
|
45
|
-
browser: BrowserType;
|
|
46
|
-
version?: number;
|
|
47
|
-
} & SharedDataPropertiesType;
|
|
48
|
-
export type ConversionDataType = {
|
|
49
|
-
goalId: number;
|
|
50
|
-
revenue: number;
|
|
51
|
-
negative: boolean;
|
|
52
|
-
} & SharedDataPropertiesType;
|
|
53
|
-
export type CustomDataType = {
|
|
54
|
-
index: number;
|
|
55
|
-
value: string | string[];
|
|
56
|
-
} & SharedDataPropertiesType;
|
|
57
|
-
export type DeviceDataType = {
|
|
58
|
-
device: DeviceType;
|
|
59
|
-
} & SharedDataPropertiesType;
|
|
60
|
-
export type PageViewDataType = {
|
|
61
|
-
urlAddress: string;
|
|
62
|
-
title: string;
|
|
63
|
-
referrers?: number[];
|
|
64
|
-
} & SharedDataPropertiesType;
|
|
65
|
-
export type UserAgentDataType = {
|
|
66
|
-
value: string;
|
|
67
|
-
} & SharedDataPropertiesType;
|
|
68
|
-
/**
|
|
69
|
-
* @param {number} goalId - an id of a goal to track
|
|
70
|
-
* @param {number | undefined} revenue - an optional parameter for revenue, default value is `0`
|
|
71
|
-
* @param {boolean | undefined} negative - an optional parameter identifying whether the conversion should be removed, default value is `false`
|
|
72
|
-
* */
|
|
73
|
-
export type ConversionParametersType = {
|
|
74
|
-
goalId: number;
|
|
75
|
-
revenue?: number;
|
|
76
|
-
negative?: boolean;
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* @param {string} urlAddress - url address of the page to track
|
|
80
|
-
* @param {string} title - title of the web page
|
|
81
|
-
* @param {number[] | undefined} referrers - an optional parameter containing a list of referrersIndices, has no default value
|
|
82
|
-
* */
|
|
83
|
-
export type PageViewParametersType = {
|
|
84
|
-
urlAddress: string;
|
|
85
|
-
title: string;
|
|
86
|
-
referrers?: number[];
|
|
87
|
-
};
|
|
88
|
-
/**
|
|
89
|
-
* @readonly
|
|
90
|
-
* @enum {string} an Enum containing all possible variants for device type
|
|
91
|
-
* */
|
|
92
|
-
export declare enum DeviceType {
|
|
93
|
-
Phone = "PHONE",
|
|
94
|
-
Tablet = "TABLET",
|
|
95
|
-
Desktop = "DESKTOP"
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* @readonly
|
|
99
|
-
* @enum {string} an Enum containing all possible variants for browser type
|
|
100
|
-
* */
|
|
101
|
-
export declare enum BrowserType {
|
|
102
|
-
Chrome = "CHROME",
|
|
103
|
-
InternetExplorer = "IE",
|
|
104
|
-
Firefox = "FIREFOX",
|
|
105
|
-
Safari = "SAFARI",
|
|
106
|
-
Opera = "OPERA",
|
|
107
|
-
Other = "OTHER"
|
|
108
|
-
}
|
|
109
|
-
export declare const BrowserIndexMap: {
|
|
110
|
-
readonly CHROME: 0;
|
|
111
|
-
readonly IE: 1;
|
|
112
|
-
readonly FIREFOX: 2;
|
|
113
|
-
readonly SAFARI: 3;
|
|
114
|
-
readonly OPERA: 4;
|
|
115
|
-
readonly OTHER: 5;
|
|
116
|
-
};
|
|
117
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";var _BrowserIndexMap;Object.defineProperty(exports,"__esModule",{value:!0}),exports.KameleoonData=exports.DeviceType=exports.BrowserType=exports.BrowserIndexMap=void 0;function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _defineProperty(a,b,c){return b=_toPropertyKey(b),b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"===_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!==_typeof(a)||null===a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var d=c.call(a,b||"default");if("object"!==_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}/**
|
|
2
|
-
* @interface an interface of KameleoonData
|
|
3
|
-
* each class instance will have url getter method
|
|
4
|
-
* for handling url of different data types
|
|
5
|
-
* */ /**
|
|
6
|
-
* @type a tuple of each possible type of data for `addData` method
|
|
7
|
-
* of KameleoonClient
|
|
8
|
-
* */var KameleoonData=/*#__PURE__*/function(a){return a.CustomData="customData",a.PageView="pageView",a.Browser="browser",a.Conversion="conversion",a.Device="device",a.UserAgent="userAgent",a}({});exports.KameleoonData=KameleoonData;/**
|
|
9
|
-
* @readonly
|
|
10
|
-
* @enum {string} an Enum containing all possible variants for device type
|
|
11
|
-
* */var DeviceType=/*#__PURE__*/function(a){return a.Phone="PHONE",a.Tablet="TABLET",a.Desktop="DESKTOP",a}({});/**
|
|
12
|
-
* @readonly
|
|
13
|
-
* @enum {string} an Enum containing all possible variants for browser type
|
|
14
|
-
* */exports.DeviceType=DeviceType;var BrowserType=/*#__PURE__*/function(a){return a.Chrome="CHROME",a.InternetExplorer="IE",a.Firefox="FIREFOX",a.Safari="SAFARI",a.Opera="OPERA",a.Other="OTHER",a}({});exports.BrowserType=BrowserType;var BrowserIndexMap=(_BrowserIndexMap={},_defineProperty(_BrowserIndexMap,BrowserType.Chrome,0),_defineProperty(_BrowserIndexMap,BrowserType.InternetExplorer,1),_defineProperty(_BrowserIndexMap,BrowserType.Firefox,2),_defineProperty(_BrowserIndexMap,BrowserType.Safari,3),_defineProperty(_BrowserIndexMap,BrowserType.Opera,4),_defineProperty(_BrowserIndexMap,BrowserType.Other,5),_BrowserIndexMap);exports.BrowserIndexMap=BrowserIndexMap;
|
|
15
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["KameleoonData","CustomData","PageView","Browser","Conversion","Device","UserAgent","exports","DeviceType","Phone","Tablet","Desktop","BrowserType","Chrome","InternetExplorer","Firefox","Safari","Opera","Other","BrowserIndexMap","_BrowserIndexMap","_defineProperty"],"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 type ActivityTimePropertyType = {\n lastActivityTime: number;\n};\n\nexport type ExistingCustomDataType = NonNullable<\n KameleoonVisitorDataType[KameleoonData.CustomData]\n>;\n\nexport type ExistingDataType<T extends KameleoonData> = NonNullable<\n KameleoonVisitorDataType[T]\n>;\n\nexport type KameleoonVisitorDataType<T = ActivityTimePropertyType> = {\n [KameleoonData.CustomData]?: {\n [index: number]: (CustomDataType & T) | undefined;\n };\n [KameleoonData.Conversion]?: ConversionDataType & T;\n [KameleoonData.UserAgent]?: UserAgentDataType & T;\n [KameleoonData.PageView]?: PageViewDataType & T;\n [KameleoonData.Browser]?: BrowserDataType & T;\n [KameleoonData.Device]?: DeviceDataType & T;\n};\n\nexport enum KameleoonData {\n CustomData = 'customData',\n PageView = 'pageView',\n Browser = 'browser',\n Conversion = 'conversion',\n Device = 'device',\n UserAgent = 'userAgent',\n}\n\ntype SharedDataPropertiesType = {\n type: KameleoonData;\n nonce: string;\n};\n\nexport type BrowserDataType = {\n browser: BrowserType;\n version?: number;\n} & SharedDataPropertiesType;\n\nexport type ConversionDataType = {\n goalId: number;\n revenue: number;\n negative: boolean;\n} & SharedDataPropertiesType;\n\nexport type CustomDataType = {\n index: number;\n value: string | string[];\n} & SharedDataPropertiesType;\n\nexport type DeviceDataType = {\n device: DeviceType;\n} & SharedDataPropertiesType;\n\nexport type PageViewDataType = {\n urlAddress: string;\n title: string;\n referrers?: number[];\n} & SharedDataPropertiesType;\n\nexport type UserAgentDataType = {\n value: string;\n} & SharedDataPropertiesType;\n\n/**\n * @param {number} goalId - an id of a goal to track\n * @param {number | undefined} revenue - an optional parameter for revenue, default value is `0`\n * @param {boolean | undefined} negative - an optional parameter identifying 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 referrersIndices, 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 {string} an Enum containing all possible variants for browser type\n * */\nexport enum BrowserType {\n Chrome = 'CHROME',\n InternetExplorer = 'IE',\n Firefox = 'FIREFOX',\n Safari = 'SAFARI',\n Opera = 'OPERA',\n Other = 'OTHER',\n}\n\nexport const BrowserIndexMap = {\n [BrowserType.Chrome]: 0,\n [BrowserType.InternetExplorer]: 1,\n [BrowserType.Firefox]: 2,\n [BrowserType.Safari]: 3,\n [BrowserType.Opera]: 4,\n [BrowserType.Other]: 5,\n} as const;\n"],"mappings":"y9BAiBA;AACA;AACA;AACA;AACA,KAJA,CAUA;AACA;AACA;AACA,KAHA,GAmCY,CAAAA,aAAa,uBAAbA,CAAa,QAAb,CAAAA,CAAa,CAAAC,UAAA,cAAbD,CAAa,CAAAE,QAAA,YAAbF,CAAa,CAAAG,OAAA,WAAbH,CAAa,CAAAI,UAAA,cAAbJ,CAAa,CAAAK,MAAA,UAAbL,CAAa,CAAAM,SAAA,aAAbN,CAAa,MAAAO,OAAA,CAAAP,aAAA,CAAAA,aAAA,CAkEzB;AACA;AACA;AACA,KAHA,GAIY,CAAAQ,UAAU,uBAAVA,CAAU,QAAV,CAAAA,CAAU,CAAAC,KAAA,SAAVD,CAAU,CAAAE,MAAA,UAAVF,CAAU,CAAAG,OAAA,WAAVH,CAAU,MAMtB;AACA;AACA;AACA,KAHAD,OAAA,CAAAC,UAAA,CAAAA,UAAA,IAIY,CAAAI,WAAW,uBAAXA,CAAW,QAAX,CAAAA,CAAW,CAAAC,MAAA,UAAXD,CAAW,CAAAE,gBAAA,MAAXF,CAAW,CAAAG,OAAA,WAAXH,CAAW,CAAAI,MAAA,UAAXJ,CAAW,CAAAK,KAAA,SAAXL,CAAW,CAAAM,KAAA,SAAXN,CAAW,MAAAL,OAAA,CAAAK,WAAA,CAAAA,WAAA,CAShB,GAAM,CAAAO,eAAe,EAAAC,gBAAA,IAAAC,eAAA,CAAAD,gBAAA,CACzBR,WAAW,CAACC,MAAM,CAAG,CAAC,EAAAQ,eAAA,CAAAD,gBAAA,CACtBR,WAAW,CAACE,gBAAgB,CAAG,CAAC,EAAAO,eAAA,CAAAD,gBAAA,CAChCR,WAAW,CAACG,OAAO,CAAG,CAAC,EAAAM,eAAA,CAAAD,gBAAA,CACvBR,WAAW,CAACI,MAAM,CAAG,CAAC,EAAAK,eAAA,CAAAD,gBAAA,CACtBR,WAAW,CAACK,KAAK,CAAG,CAAC,EAAAI,eAAA,CAAAD,gBAAA,CACrBR,WAAW,CAACM,KAAK,CAAG,CAAC,EAAAE,gBAAA,CACd,CAACb,OAAA,CAAAY,eAAA,CAAAA,eAAA"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { UserAgentDataType, IKameleoonData } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* @class
|
|
4
|
-
* UserAgent - a class for creating an instance for user agent
|
|
5
|
-
* */
|
|
6
|
-
export declare class UserAgent implements IKameleoonData {
|
|
7
|
-
private value;
|
|
8
|
-
private nonce;
|
|
9
|
-
constructor(value: string);
|
|
10
|
-
/**
|
|
11
|
-
* @property url - url for the current data type used for events tracking
|
|
12
|
-
* */
|
|
13
|
-
get url(): string;
|
|
14
|
-
/**
|
|
15
|
-
* @property data - data of the current class instance
|
|
16
|
-
* */
|
|
17
|
-
get data(): UserAgentDataType;
|
|
18
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.UserAgent=void 0;var _utilities=require("../utilities"),_types=require("./types");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _defineProperty(a,b,c){return b=_toPropertyKey(b),b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"===_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!==_typeof(a)||null===a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var d=c.call(a,b||"default");if("object"!==_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}/**
|
|
2
|
-
* @class
|
|
3
|
-
* UserAgent - a class for creating an instance for user agent
|
|
4
|
-
* */var UserAgent=/*#__PURE__*/function(){function a(b){_classCallCheck(this,a),_defineProperty(this,"value",void 0),_defineProperty(this,"nonce",void 0),this.value=b,this.nonce=_utilities.Utilities.getNonce()}/**
|
|
5
|
-
* @property url - url for the current data type used for events tracking
|
|
6
|
-
* */return _createClass(a,[{key:"url",get:function get(){return""}/**
|
|
7
|
-
* @property data - data of the current class instance
|
|
8
|
-
* */},{key:"data",get:function get(){return{value:this.value,type:_types.KameleoonData.UserAgent,nonce:this.nonce}}}]),a}();exports.UserAgent=UserAgent;
|
|
9
|
-
//# sourceMappingURL=userAgent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"userAgent.js","names":["UserAgent","a","value","_classCallCheck","_defineProperty","nonce","Utilities","getNonce","_createClass","key","get","type","KameleoonData","exports"],"sources":["../../src/kameleoonData/userAgent.ts"],"sourcesContent":["import { Utilities } from 'src/utilities';\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 implements IKameleoonData {\n private value: string;\n private nonce: string;\n\n constructor(value: string) {\n this.value = value;\n this.nonce = Utilities.getNonce();\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":"u4CAGA;AACA;AACA;AACA,KAHA,GAIa,CAAAA,SAAS,yBAIpB,SAAAC,EAAYC,CAAa,CAAE,CAAAC,eAAA,MAAAF,CAAA,EAAAG,eAAA,sBAAAA,eAAA,sBACzB,IAAI,CAACF,KAAK,CAAGA,CAAK,CAClB,IAAI,CAACG,KAAK,CAAGC,oBAAS,CAACC,QAAQ,EACjC,CAEA;AACF;AACA,OAFE,OAAAC,YAAA,CAAAP,CAAA,GAAAQ,GAAA,OAAAC,GAAA,CAGA,SAAAA,IAAA,CAAkB,CAChB,MAAO,EACT,CAEA;AACF;AACA,OAFE,GAAAD,GAAA,QAAAC,GAAA,CAGA,SAAAA,IAAA,CAA8B,CAC5B,MAAO,CACLR,KAAK,CAAE,IAAI,CAACA,KAAK,CACjBS,IAAI,CAAEC,oBAAa,CAACZ,SAAS,CAC7BK,KAAK,CAAE,IAAI,CAACA,KACd,CACF,CAAC,IAAAJ,CAAA,IAAAY,OAAA,CAAAb,SAAA,CAAAA,SAAA"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { KameleoonStorageKey } from '../storage';
|
|
2
|
-
import { TargetingType } from '../targeting';
|
|
3
|
-
export declare const ERROR_MESSAGES: {
|
|
4
|
-
JSONParse: (err: unknown) => string;
|
|
5
|
-
NumberParse: (value: string) => string;
|
|
6
|
-
VersionParse: (value: string) => string;
|
|
7
|
-
SemanticVersionParse: (value: string) => string;
|
|
8
|
-
Initialization: () => string;
|
|
9
|
-
StorageInitialization: () => string;
|
|
10
|
-
EventSourceInitialization: () => string;
|
|
11
|
-
VariationNotFound: () => string;
|
|
12
|
-
FeatureFlagConfigurationNotFound: (featureKey: string, visitorCode: string) => string;
|
|
13
|
-
FeatureFlagVariableNotFound: (variableKey: string, visitorCode: string) => string;
|
|
14
|
-
ExperimentConfigurationNotFound: (experimentId: number, visitorCode: string) => string;
|
|
15
|
-
NotTargeted: (visitorCode: string) => string;
|
|
16
|
-
NotAllocated: (visitorCode: string) => string;
|
|
17
|
-
VisitorCodeMaxLength: () => string;
|
|
18
|
-
VisitorCodeEmpty: () => string;
|
|
19
|
-
StorageWrite: (err: unknown) => string;
|
|
20
|
-
StorageRead: (key: KameleoonStorageKey) => string;
|
|
21
|
-
StorageParse: (err: unknown, key: KameleoonStorageKey) => string;
|
|
22
|
-
ClientConfiguration: () => string;
|
|
23
|
-
TargetingCondition: (targetingType: TargetingType) => string;
|
|
24
|
-
AmongValuesCheck: (err: unknown, value: string) => string;
|
|
25
|
-
RemoteData: () => string;
|
|
26
|
-
MaximumRetriesReached: () => string;
|
|
27
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ERROR_MESSAGES=void 0;var _ERROR_MESSAGES,_types=require("./types");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _defineProperty(a,b,c){return b=_toPropertyKey(b),b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"===_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!==_typeof(a)||null===a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var d=c.call(a,b||"default");if("object"!==_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}var ERROR_MESSAGES=(_ERROR_MESSAGES={},_defineProperty(_ERROR_MESSAGES,_types.KameleoonException.JSONParse,function(a){return"Couldn't parse JSON variable: ".concat(a)}),_defineProperty(_ERROR_MESSAGES,_types.KameleoonException.NumberParse,function(a){return"It's not possible to parse value ".concat(a," to Number")}),_defineProperty(_ERROR_MESSAGES,_types.KameleoonException.VersionParse,function(a){return"It's not possible to parse a version value ".concat(a," to Number, version should be in format x.x")}),_defineProperty(_ERROR_MESSAGES,_types.KameleoonException.SemanticVersionParse,function(a){return"It's not possible to parse a version value ".concat(a," to Number, version should be in format x.x.x")}),_defineProperty(_ERROR_MESSAGES,_types.KameleoonException.Initialization,function(){return"It seems that the client wasn't properly initialized, make sure to run `initialize` method before invoking other methods"}),_defineProperty(_ERROR_MESSAGES,_types.KameleoonException.StorageInitialization,function(){return"There was an error while initializing React Native SDK storage, it seems that the storage library dependency wasn't installed"}),_defineProperty(_ERROR_MESSAGES,_types.KameleoonException.EventSourceInitialization,function(){return"There was an error while initializing Real Time Update service, it seems that the event source library dependency wasn't installed"}),_defineProperty(_ERROR_MESSAGES,_types.KameleoonException.VariationNotFound,function(){return"Couldn't find experiment variation"}),_defineProperty(_ERROR_MESSAGES,_types.KameleoonException.FeatureFlagConfigurationNotFound,function(a,b){return"No feature flag with key ".concat(a," was found for ").concat(b," visitorCode.")}),_defineProperty(_ERROR_MESSAGES,_types.KameleoonException.FeatureFlagVariableNotFound,function(a,b){return"No feature flag variable with key ".concat(a," was found for ").concat(b," visitorCode.")}),_defineProperty(_ERROR_MESSAGES,_types.KameleoonException.ExperimentConfigurationNotFound,function(a,b){return"No experiment with id ".concat(a," was found for ").concat(b," visitorCode.")}),_defineProperty(_ERROR_MESSAGES,_types.KameleoonException.NotTargeted,function(a){return"Visitor code ".concat(a," is not targeted")}),_defineProperty(_ERROR_MESSAGES,_types.KameleoonException.NotAllocated,function(a){return"Visitor with visitor code ".concat(a," is in unallocated traffic, there is no variation id to be assigned to the visitor.")}),_defineProperty(_ERROR_MESSAGES,_types.KameleoonException.VisitorCodeMaxLength,function(){return"Visitor code can not be more than 255 characters long"}),_defineProperty(_ERROR_MESSAGES,_types.KameleoonException.VisitorCodeEmpty,function(){return"Visitor code can not be empty"}),_defineProperty(_ERROR_MESSAGES,_types.KameleoonException.StorageWrite,function(a){return"Couldn't update storage for kameleoonClient: ".concat(a)}),_defineProperty(_ERROR_MESSAGES,_types.KameleoonException.StorageRead,function(a){return"No data found in storage under ".concat(a," key")}),_defineProperty(_ERROR_MESSAGES,_types.KameleoonException.StorageParse,function(a,b){return"Couldn't parse ".concat(b," storage data, the data may be corrupted. Error: ").concat(a)}),_defineProperty(_ERROR_MESSAGES,_types.KameleoonException.ClientConfiguration,function(){return"Couldn't retrieve client configuration from Kameleoon Api"}),_defineProperty(_ERROR_MESSAGES,_types.KameleoonException.TargetingCondition,function(a){return"".concat(a," targeting condition is not yet supported.")}),_defineProperty(_ERROR_MESSAGES,_types.KameleoonException.AmongValuesCheck,function(a,b){return"Couldn't parse value \"".concat(b,"\": ").concat(a)}),_defineProperty(_ERROR_MESSAGES,_types.KameleoonException.RemoteData,function(){return"Couldn't retrieve data from Kameleoon server"}),_defineProperty(_ERROR_MESSAGES,_types.KameleoonException.MaximumRetriesReached,function(){return"Maximum retries reached, request failed"}),_ERROR_MESSAGES);exports.ERROR_MESSAGES=ERROR_MESSAGES;
|
|
2
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":["ERROR_MESSAGES","_ERROR_MESSAGES","_defineProperty","KameleoonException","JSONParse","err","concat","NumberParse","value","VersionParse","SemanticVersionParse","Initialization","StorageInitialization","EventSourceInitialization","VariationNotFound","FeatureFlagConfigurationNotFound","featureKey","visitorCode","FeatureFlagVariableNotFound","variableKey","ExperimentConfigurationNotFound","experimentId","NotTargeted","NotAllocated","VisitorCodeMaxLength","VisitorCodeEmpty","StorageWrite","StorageRead","key","StorageParse","ClientConfiguration","TargetingCondition","targetingType","AmongValuesCheck","RemoteData","MaximumRetriesReached","exports"],"sources":["../../src/kameleoonError/constants.ts"],"sourcesContent":["import { KameleoonStorageKey } from 'src/storage';\nimport { TargetingType } from 'src/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.VersionParse]: (value: string) =>\n `It's not possible to parse a version value ${value} to Number, version should be in format x.x`,\n [KameleoonException.SemanticVersionParse]: (value: string) =>\n `It's not possible to parse a version value ${value} to Number, version should be in format x.x.x`,\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.VariationNotFound]: () =>\n \"Couldn't find experiment variation\",\n [KameleoonException.FeatureFlagConfigurationNotFound]: (\n featureKey: string,\n visitorCode: string,\n ) =>\n `No feature flag with key ${featureKey} was found for ${visitorCode} visitorCode.`,\n [KameleoonException.FeatureFlagVariableNotFound]: (\n variableKey: string,\n visitorCode: string,\n ) =>\n `No feature flag variable with key ${variableKey} 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.VisitorCodeEmpty]: () => 'Visitor code can not be empty',\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 [KameleoonException.MaximumRetriesReached]: () =>\n `Maximum retries reached, request failed`,\n};\n"],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function exhaustCheck(option: never): never;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","names":["exhaustCheck","option","Error","concat"],"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":"sGAAO,QAAS,CAAAA,YAAYA,CAACC,CAAa,CAAS,CACjD,KAAM,IAAI,CAAAC,KAAK,4CAAAC,MAAA,CAA4CF,CAAM,EACnE"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"KameleoonError",{enumerable:!0,get:function get(){return _kameleoonError.KameleoonError}}),Object.defineProperty(exports,"KameleoonException",{enumerable:!0,get:function get(){return _types.KameleoonException}}),Object.defineProperty(exports,"exhaustCheck",{enumerable:!0,get:function get(){return _helpers.exhaustCheck}});var _kameleoonError=require("./kameleoonError"),_types=require("./types"),_helpers=require("./helpers");
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/kameleoonError/index.ts"],"sourcesContent":["export { KameleoonError } from './kameleoonError';\nexport { KameleoonException } from './types';\nexport { exhaustCheck } from './helpers';\n"],"mappings":""}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { KameleoonStorageKey } from '../storage';
|
|
2
|
-
import { TargetingType } from '../targeting';
|
|
3
|
-
import { KameleoonException } from './types';
|
|
4
|
-
/**
|
|
5
|
-
* @class
|
|
6
|
-
* KameleoonError - extends standard `Error` by adding custom `type` property with the type of `KameleoonException`
|
|
7
|
-
* */
|
|
8
|
-
export declare class KameleoonError extends Error {
|
|
9
|
-
private errorType;
|
|
10
|
-
/**
|
|
11
|
-
* @param {KameleoonException} type - type of KameleoonError represented by `KameleoonException` enum
|
|
12
|
-
* */
|
|
13
|
-
constructor(type: KameleoonException.Initialization | KameleoonException.ClientConfiguration | KameleoonException.VisitorCodeMaxLength | KameleoonException.VisitorCodeEmpty | KameleoonException.StorageInitialization | KameleoonException.EventSourceInitialization | KameleoonException.VariationNotFound | KameleoonException.RemoteData | KameleoonException.MaximumRetriesReached);
|
|
14
|
-
constructor(type: KameleoonException.FeatureFlagConfigurationNotFound, featureKey: string, visitorCode: string);
|
|
15
|
-
constructor(type: KameleoonException.FeatureFlagVariableNotFound, variableKey: string, visitorCode: string);
|
|
16
|
-
constructor(type: KameleoonException.NotTargeted | KameleoonException.NotAllocated, visitorCode: string);
|
|
17
|
-
constructor(type: KameleoonException.ExperimentConfigurationNotFound, experimentId: number, visitorCode: string);
|
|
18
|
-
constructor(type: KameleoonException.StorageWrite | KameleoonException.JSONParse, err: unknown);
|
|
19
|
-
constructor(type: KameleoonException.StorageRead, storageKey: string);
|
|
20
|
-
constructor(type: KameleoonException.StorageParse, err: unknown, key: KameleoonStorageKey);
|
|
21
|
-
constructor(type: KameleoonException.TargetingCondition, targetingType: TargetingType);
|
|
22
|
-
constructor(type: KameleoonException.AmongValuesCheck, err: unknown, value: string);
|
|
23
|
-
constructor(type: KameleoonException.NumberParse | KameleoonException.VersionParse | KameleoonException.SemanticVersionParse, value: string);
|
|
24
|
-
get type(): KameleoonException;
|
|
25
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.KameleoonError=void 0;var _constants=require("./constants"),_helpers=require("./helpers"),_types=require("./types");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _possibleConstructorReturn(a,b){if(b&&("object"===_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _wrapNativeSuper(a){var b="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function(a){function c(){return _construct(a,arguments,_getPrototypeOf(this).constructor)}if(null===a||!_isNativeFunction(a))return a;if("function"!=typeof a)throw new TypeError("Super expression must either be null or a function");if("undefined"!=typeof b){if(b.has(a))return b.get(a);b.set(a,c)}return c.prototype=Object.create(a.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(c,a)},_wrapNativeSuper(a)}function _construct(){return _construct=_isNativeReflectConstruct()?Reflect.construct.bind():function(b,c,d){var e=[null];e.push.apply(e,c);var a=Function.bind.apply(b,e),f=new a;return d&&_setPrototypeOf(f,d.prototype),f},_construct.apply(null,arguments)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}function _isNativeFunction(a){return-1!==Function.toString.call(a).indexOf("[native code]")}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _defineProperty(a,b,c){return b=_toPropertyKey(b),b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"===_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!==_typeof(a)||null===a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var d=c.call(a,b||"default");if("object"!==_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}/**
|
|
2
|
-
* @class
|
|
3
|
-
* KameleoonError - extends standard `Error` by adding custom `type` property with the type of `KameleoonException`
|
|
4
|
-
* */var KameleoonError=/*#__PURE__*/function(a){function b(a,d,e){var f;return _classCallCheck(this,b),f=c.call(this,"Error: ".concat(a)),_defineProperty(_assertThisInitialized(f),"errorType",void 0),f.name="KameleoonError",f.errorType=a,(a===_types.KameleoonException.Initialization||a===_types.KameleoonException.ClientConfiguration||a===_types.KameleoonException.VisitorCodeMaxLength||a===_types.KameleoonException.VisitorCodeEmpty||a===_types.KameleoonException.StorageInitialization||a===_types.KameleoonException.VariationNotFound||a===_types.KameleoonException.EventSourceInitialization||a===_types.KameleoonException.RemoteData||a===_types.KameleoonException.MaximumRetriesReached?f.message=_constants.ERROR_MESSAGES[a]():a===_types.KameleoonException.NotAllocated||a===_types.KameleoonException.NotTargeted?f.message=_constants.ERROR_MESSAGES[a](d):a===_types.KameleoonException.ExperimentConfigurationNotFound?f.message=_constants.ERROR_MESSAGES[a](d,e):a===_types.KameleoonException.FeatureFlagVariableNotFound||a===_types.KameleoonException.FeatureFlagConfigurationNotFound?f.message=_constants.ERROR_MESSAGES[a](d,e):a===_types.KameleoonException.StorageWrite||a===_types.KameleoonException.JSONParse?f.message=_constants.ERROR_MESSAGES[a](d):a===_types.KameleoonException.StorageRead?f.message=_constants.ERROR_MESSAGES[a](d):a===_types.KameleoonException.StorageParse?f.message=_constants.ERROR_MESSAGES[a](d,e):a===_types.KameleoonException.TargetingCondition?f.message=_constants.ERROR_MESSAGES[a](d):a===_types.KameleoonException.NumberParse||a===_types.KameleoonException.VersionParse||a===_types.KameleoonException.SemanticVersionParse?f.message=_constants.ERROR_MESSAGES[a](d):a===_types.KameleoonException.AmongValuesCheck?f.message=_constants.ERROR_MESSAGES[a](d,e):(0,_helpers.exhaustCheck)(a),f)}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"type",get:function get(){return this.errorType}}]),b}(/*#__PURE__*/_wrapNativeSuper(Error));exports.KameleoonError=KameleoonError;
|
|
5
|
-
//# sourceMappingURL=kameleoonError.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kameleoonError.js","names":["KameleoonError","a","b","type","secondParam","thirdParam","f","_classCallCheck","c","call","concat","_defineProperty","_assertThisInitialized","name","errorType","KameleoonException","Initialization","ClientConfiguration","VisitorCodeMaxLength","VisitorCodeEmpty","StorageInitialization","VariationNotFound","EventSourceInitialization","RemoteData","MaximumRetriesReached","message","ERROR_MESSAGES","NotAllocated","NotTargeted","ExperimentConfigurationNotFound","FeatureFlagVariableNotFound","FeatureFlagConfigurationNotFound","StorageWrite","JSONParse","StorageRead","StorageParse","TargetingCondition","NumberParse","VersionParse","SemanticVersionParse","AmongValuesCheck","exhaustCheck","_inherits","_createSuper","_createClass","key","get","_wrapNativeSuper","Error","exports"],"sources":["../../src/kameleoonError/kameleoonError.ts"],"sourcesContent":["import { KameleoonStorageKey } from 'src/storage';\nimport { TargetingType } from 'src/targeting';\nimport { ERROR_MESSAGES } from './constants';\nimport { exhaustCheck } from './helpers';\nimport { KameleoonException } from './types';\n\n/**\n * @class\n * KameleoonError - extends standard `Error` by adding custom `type` property with the type of `KameleoonException`\n * */\nexport class KameleoonError extends Error {\n private errorType: KameleoonException;\n\n /**\n * @param {KameleoonException} type - type of KameleoonError represented by `KameleoonException` enum\n * */\n constructor(\n type:\n | KameleoonException.Initialization\n | KameleoonException.ClientConfiguration\n | KameleoonException.VisitorCodeMaxLength\n | KameleoonException.VisitorCodeEmpty\n | KameleoonException.StorageInitialization\n | KameleoonException.EventSourceInitialization\n | KameleoonException.VariationNotFound\n | KameleoonException.RemoteData\n | KameleoonException.MaximumRetriesReached,\n );\n constructor(\n type: KameleoonException.FeatureFlagConfigurationNotFound,\n featureKey: string,\n visitorCode: string,\n );\n constructor(\n type: KameleoonException.FeatureFlagVariableNotFound,\n variableKey: string,\n visitorCode: string,\n );\n constructor(\n type: KameleoonException.NotTargeted | KameleoonException.NotAllocated,\n visitorCode: string,\n );\n constructor(\n type: KameleoonException.ExperimentConfigurationNotFound,\n experimentId: number,\n visitorCode: string,\n );\n constructor(\n type: KameleoonException.StorageWrite | KameleoonException.JSONParse,\n err: unknown,\n );\n constructor(type: KameleoonException.StorageRead, storageKey: string);\n constructor(\n type: KameleoonException.StorageParse,\n err: unknown,\n key: KameleoonStorageKey,\n );\n constructor(\n type: KameleoonException.TargetingCondition,\n targetingType: TargetingType,\n );\n constructor(\n type: KameleoonException.AmongValuesCheck,\n err: unknown,\n value: string,\n );\n constructor(\n type:\n | KameleoonException.NumberParse\n | KameleoonException.VersionParse\n | KameleoonException.SemanticVersionParse,\n value: string,\n );\n constructor(\n type: KameleoonException,\n secondParam?:\n | number\n | string\n | unknown\n | KameleoonStorageKey\n | TargetingType,\n thirdParam?: string | KameleoonStorageKey,\n ) {\n super(`Error: ${type}`);\n\n this.name = 'KameleoonError';\n this.errorType = type;\n\n switch (type) {\n case KameleoonException.Initialization:\n case KameleoonException.ClientConfiguration:\n case KameleoonException.VisitorCodeMaxLength:\n case KameleoonException.VisitorCodeEmpty:\n case KameleoonException.StorageInitialization:\n case KameleoonException.VariationNotFound:\n case KameleoonException.EventSourceInitialization:\n case KameleoonException.RemoteData:\n case KameleoonException.MaximumRetriesReached:\n this.message = ERROR_MESSAGES[type]();\n break;\n case KameleoonException.NotAllocated:\n case KameleoonException.NotTargeted:\n this.message = ERROR_MESSAGES[type](secondParam as string);\n break;\n case KameleoonException.ExperimentConfigurationNotFound:\n this.message = ERROR_MESSAGES[type](\n secondParam as number,\n thirdParam as string,\n );\n break;\n case KameleoonException.FeatureFlagVariableNotFound:\n case KameleoonException.FeatureFlagConfigurationNotFound:\n this.message = ERROR_MESSAGES[type](\n secondParam as string,\n thirdParam as string,\n );\n break;\n case KameleoonException.StorageWrite:\n case KameleoonException.JSONParse:\n this.message = ERROR_MESSAGES[type](secondParam);\n break;\n case KameleoonException.StorageRead:\n this.message = ERROR_MESSAGES[type](secondParam as KameleoonStorageKey);\n break;\n case KameleoonException.StorageParse:\n this.message = ERROR_MESSAGES[type](\n secondParam,\n thirdParam as KameleoonStorageKey,\n );\n break;\n case KameleoonException.TargetingCondition:\n this.message = ERROR_MESSAGES[type](secondParam as TargetingType);\n break;\n case KameleoonException.NumberParse:\n case KameleoonException.VersionParse:\n case KameleoonException.SemanticVersionParse:\n this.message = ERROR_MESSAGES[type](secondParam as string);\n break;\n case KameleoonException.AmongValuesCheck:\n this.message = ERROR_MESSAGES[type](secondParam, thirdParam as string);\n break;\n default:\n exhaustCheck(type);\n }\n }\n\n get type(): KameleoonException {\n return this.errorType;\n }\n}\n"],"mappings":"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"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare enum KameleoonException {
|
|
2
|
-
ExperimentConfigurationNotFound = "ExperimentConfigurationNotFound",
|
|
3
|
-
EventSourceInitialization = "EventSourceInitialization",
|
|
4
|
-
VariationNotFound = "VariationNotFound",
|
|
5
|
-
FeatureFlagConfigurationNotFound = "FeatureFlagConfigurationNotFound",
|
|
6
|
-
FeatureFlagVariableNotFound = "FeatureFlagVariableNotFound",
|
|
7
|
-
NotTargeted = "NotTargeted",
|
|
8
|
-
NotAllocated = "NotAllocated",
|
|
9
|
-
VisitorCodeMaxLength = "VisitorCodeMaxLength",
|
|
10
|
-
VisitorCodeEmpty = "VisitorCodeEmpty",
|
|
11
|
-
StorageInitialization = "StorageInitialization",
|
|
12
|
-
StorageWrite = "StorageWrite",
|
|
13
|
-
StorageRead = "StorageRead",
|
|
14
|
-
StorageParse = "StorageParse",
|
|
15
|
-
ClientConfiguration = "ClientConfiguration",
|
|
16
|
-
TargetingCondition = "TargetingCondition",
|
|
17
|
-
AmongValuesCheck = "AmongValuesCheck",
|
|
18
|
-
Initialization = "Initialization",
|
|
19
|
-
JSONParse = "JSONParse",
|
|
20
|
-
NumberParse = "NumberParse",
|
|
21
|
-
VersionParse = "VersionParse",
|
|
22
|
-
SemanticVersionParse = "SemanticVersionParse",
|
|
23
|
-
RemoteData = "RemoteData",
|
|
24
|
-
MaximumRetriesReached = "MaximumRetriesReached"
|
|
25
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.KameleoonException=void 0;var KameleoonException=/*#__PURE__*/function(a){return a.ExperimentConfigurationNotFound="ExperimentConfigurationNotFound",a.EventSourceInitialization="EventSourceInitialization",a.VariationNotFound="VariationNotFound",a.FeatureFlagConfigurationNotFound="FeatureFlagConfigurationNotFound",a.FeatureFlagVariableNotFound="FeatureFlagVariableNotFound",a.NotTargeted="NotTargeted",a.NotAllocated="NotAllocated",a.VisitorCodeMaxLength="VisitorCodeMaxLength",a.VisitorCodeEmpty="VisitorCodeEmpty",a.StorageInitialization="StorageInitialization",a.StorageWrite="StorageWrite",a.StorageRead="StorageRead",a.StorageParse="StorageParse",a.ClientConfiguration="ClientConfiguration",a.TargetingCondition="TargetingCondition",a.AmongValuesCheck="AmongValuesCheck",a.Initialization="Initialization",a.JSONParse="JSONParse",a.NumberParse="NumberParse",a.VersionParse="VersionParse",a.SemanticVersionParse="SemanticVersionParse",a.RemoteData="RemoteData",a.MaximumRetriesReached="MaximumRetriesReached",a}({});exports.KameleoonException=KameleoonException;
|
|
2
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["KameleoonException","ExperimentConfigurationNotFound","EventSourceInitialization","VariationNotFound","FeatureFlagConfigurationNotFound","FeatureFlagVariableNotFound","NotTargeted","NotAllocated","VisitorCodeMaxLength","VisitorCodeEmpty","StorageInitialization","StorageWrite","StorageRead","StorageParse","ClientConfiguration","TargetingCondition","AmongValuesCheck","Initialization","JSONParse","NumberParse","VersionParse","SemanticVersionParse","RemoteData","MaximumRetriesReached","exports"],"sources":["../../src/kameleoonError/types.ts"],"sourcesContent":["export enum KameleoonException {\n ExperimentConfigurationNotFound = 'ExperimentConfigurationNotFound',\n EventSourceInitialization = 'EventSourceInitialization',\n VariationNotFound = 'VariationNotFound',\n FeatureFlagConfigurationNotFound = 'FeatureFlagConfigurationNotFound',\n FeatureFlagVariableNotFound = 'FeatureFlagVariableNotFound',\n NotTargeted = 'NotTargeted',\n NotAllocated = 'NotAllocated',\n VisitorCodeMaxLength = 'VisitorCodeMaxLength',\n VisitorCodeEmpty = 'VisitorCodeEmpty',\n StorageInitialization = 'StorageInitialization',\n StorageWrite = 'StorageWrite',\n StorageRead = 'StorageRead',\n StorageParse = 'StorageParse',\n ClientConfiguration = 'ClientConfiguration',\n TargetingCondition = 'TargetingCondition',\n AmongValuesCheck = 'AmongValuesCheck',\n Initialization = 'Initialization',\n JSONParse = 'JSONParse',\n NumberParse = 'NumberParse',\n VersionParse = 'VersionParse',\n SemanticVersionParse = 'SemanticVersionParse',\n RemoteData = 'RemoteData',\n MaximumRetriesReached = 'MaximumRetriesReached',\n}\n"],"mappings":"yGAAY,CAAAA,kBAAkB,uBAAlBA,CAAkB,QAAlB,CAAAA,CAAkB,CAAAC,+BAAA,mCAAlBD,CAAkB,CAAAE,yBAAA,6BAAlBF,CAAkB,CAAAG,iBAAA,qBAAlBH,CAAkB,CAAAI,gCAAA,oCAAlBJ,CAAkB,CAAAK,2BAAA,+BAAlBL,CAAkB,CAAAM,WAAA,eAAlBN,CAAkB,CAAAO,YAAA,gBAAlBP,CAAkB,CAAAQ,oBAAA,wBAAlBR,CAAkB,CAAAS,gBAAA,oBAAlBT,CAAkB,CAAAU,qBAAA,yBAAlBV,CAAkB,CAAAW,YAAA,gBAAlBX,CAAkB,CAAAY,WAAA,eAAlBZ,CAAkB,CAAAa,YAAA,gBAAlBb,CAAkB,CAAAc,mBAAA,uBAAlBd,CAAkB,CAAAe,kBAAA,sBAAlBf,CAAkB,CAAAgB,gBAAA,oBAAlBhB,CAAkB,CAAAiB,cAAA,kBAAlBjB,CAAkB,CAAAkB,SAAA,aAAlBlB,CAAkB,CAAAmB,WAAA,eAAlBnB,CAAkB,CAAAoB,YAAA,gBAAlBpB,CAAkB,CAAAqB,oBAAA,wBAAlBrB,CAAkB,CAAAsB,UAAA,cAAlBtB,CAAkB,CAAAuB,qBAAA,yBAAlBvB,CAAkB,MAAAwB,OAAA,CAAAxB,kBAAA,CAAAA,kBAAA"}
|