@kameleoon/javascript-sdk-core 4.0.1 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/constants.js +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/kameleoonClient.d.ts +2 -1
- package/dist/kameleoonClient.js +1 -1
- package/dist/kameleoonClient.js.map +1 -1
- package/dist/kameleoonClientInterface.d.ts +2 -2
- package/dist/kameleoonClientInterface.js.map +1 -1
- package/dist/kameleoonData/applicationVersion.d.ts +0 -9
- package/dist/kameleoonData/applicationVersion.js.map +1 -1
- package/dist/kameleoonData/browser.d.ts +3 -12
- package/dist/kameleoonData/browser.js +1 -1
- package/dist/kameleoonData/browser.js.map +1 -1
- package/dist/kameleoonData/conversion.d.ts +11 -13
- package/dist/kameleoonData/conversion.js +1 -1
- package/dist/kameleoonData/conversion.js.map +1 -1
- package/dist/kameleoonData/cookie.d.ts +0 -9
- package/dist/kameleoonData/cookie.js.map +1 -1
- package/dist/kameleoonData/customData.d.ts +3 -13
- package/dist/kameleoonData/customData.js +1 -1
- package/dist/kameleoonData/customData.js.map +1 -1
- package/dist/kameleoonData/dataManager.d.ts +11 -5
- package/dist/kameleoonData/dataManager.js +1 -1
- package/dist/kameleoonData/dataManager.js.map +1 -1
- package/dist/kameleoonData/dataProcessor.d.ts +13 -6
- package/dist/kameleoonData/dataProcessor.js +1 -1
- package/dist/kameleoonData/dataProcessor.js.map +1 -1
- package/dist/kameleoonData/device.d.ts +3 -12
- package/dist/kameleoonData/device.js +1 -1
- package/dist/kameleoonData/device.js.map +1 -1
- package/dist/kameleoonData/geolocation.d.ts +3 -12
- package/dist/kameleoonData/geolocation.js +1 -1
- package/dist/kameleoonData/geolocation.js.map +1 -1
- package/dist/kameleoonData/index.d.ts +1 -0
- package/dist/kameleoonData/index.js +1 -1
- package/dist/kameleoonData/index.js.map +1 -1
- package/dist/kameleoonData/kameleoonConversionScore.d.ts +15 -0
- package/dist/kameleoonData/kameleoonConversionScore.js +2 -0
- package/dist/kameleoonData/kameleoonConversionScore.js.map +1 -0
- package/dist/kameleoonData/operatingSystem.d.ts +3 -12
- package/dist/kameleoonData/operatingSystem.js +1 -1
- package/dist/kameleoonData/operatingSystem.js.map +1 -1
- package/dist/kameleoonData/pageView.d.ts +4 -13
- package/dist/kameleoonData/pageView.js +1 -1
- package/dist/kameleoonData/pageView.js.map +1 -1
- package/dist/kameleoonData/types.d.ts +54 -11
- package/dist/kameleoonData/types.js +1 -1
- package/dist/kameleoonData/types.js.map +1 -1
- package/dist/kameleoonData/userAgent.d.ts +0 -9
- package/dist/kameleoonData/userAgent.js.map +1 -1
- package/dist/kameleoonData/visitProcessor.d.ts +34 -0
- package/dist/kameleoonData/visitProcessor.js +2 -0
- package/dist/kameleoonData/visitProcessor.js.map +1 -0
- package/dist/kameleoonData/visitsData.d.ts +7 -21
- package/dist/kameleoonData/visitsData.js +1 -1
- package/dist/kameleoonData/visitsData.js.map +1 -1
- package/dist/requester/constants.js +1 -1
- package/dist/requester/constants.js.map +1 -1
- package/dist/requester/requester.d.ts +2 -3
- package/dist/requester/requester.js +1 -1
- package/dist/requester/requester.js.map +1 -1
- package/dist/requester/types.d.ts +14 -2
- package/dist/requester/types.js +1 -1
- package/dist/requester/types.js.map +1 -1
- package/dist/requester/urlProvider.d.ts +2 -3
- package/dist/requester/urlProvider.js +1 -1
- package/dist/requester/urlProvider.js.map +1 -1
- package/dist/storage/storage.js +1 -1
- package/dist/targeting/conditions/browser.js +1 -1
- package/dist/targeting/conditions/browser.js.map +1 -1
- package/dist/targeting/conditions/conditionFactory.js +1 -1
- package/dist/targeting/conditions/conditionFactory.js.map +1 -1
- package/dist/targeting/conditions/conversionLikelihood.d.ts +12 -0
- package/dist/targeting/conditions/conversionLikelihood.js +2 -0
- package/dist/targeting/conditions/conversionLikelihood.js.map +1 -0
- package/dist/targeting/conditions/firstVisit.js +1 -1
- package/dist/targeting/conditions/firstVisit.js.map +1 -1
- package/dist/targeting/conditions/geolocation.js +1 -1
- package/dist/targeting/conditions/geolocation.js.map +1 -1
- package/dist/targeting/conditions/index.d.ts +1 -0
- package/dist/targeting/conditions/index.js +1 -1
- package/dist/targeting/conditions/index.js.map +1 -1
- package/dist/targeting/conditions/lastVisit.js +1 -1
- package/dist/targeting/conditions/lastVisit.js.map +1 -1
- package/dist/targeting/conditions/newVisitor.js +1 -1
- package/dist/targeting/conditions/newVisitor.js.map +1 -1
- package/dist/targeting/conditions/sameDayVisits.js +1 -1
- package/dist/targeting/conditions/sameDayVisits.js.map +1 -1
- package/dist/targeting/conditions/targetFeatureFlag.js +1 -1
- package/dist/targeting/conditions/types.d.ts +3 -0
- package/dist/targeting/conditions/types.js.map +1 -1
- package/dist/targeting/conditions/visits.js +1 -1
- package/dist/targeting/conditions/visits.js.map +1 -1
- package/dist/targeting/index.d.ts +2 -2
- package/dist/targeting/index.js +1 -1
- package/dist/targeting/index.js.map +1 -1
- package/dist/targeting/types.d.ts +4 -0
- package/dist/targeting/types.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.js.map +1 -1
- package/dist/utilities/types.d.ts +6 -1
- package/dist/utilities/types.js.map +1 -1
- package/dist/utilities/utilities.d.ts +1 -1
- package/dist/utilities/utilities.js +1 -1
- package/dist/utilities/utilities.js.map +1 -1
- package/dist/variationConfiguration/types.d.ts +1 -1
- package/dist/variationConfiguration/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Device=void 0;var _requester=require("../requester"),_types=require("./types");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||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){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)}class Device{constructor(a){_defineProperty(this,"device",void 0),_defineProperty(this,"sent",void 0),this.device=a,this.sent=!1}get url(){return this.device?_requester.UrlEventType.StaticData+_requester.UrlParameter.DeviceType+this.device:""}get data(){return{device:this.device,type:_types.KameleoonData.Device,sent:this.sent}}get isSent(){return this.sent}set isSent(a){this.sent=a}static
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Device=void 0;var _requester=require("../requester"),_types=require("./types");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||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){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)}class Device{constructor(a){_defineProperty(this,"device",void 0),_defineProperty(this,"sent",void 0),this.device=a,this.sent=!1}get url(){return this.device?_requester.UrlEventType.StaticData+_requester.UrlParameter.DeviceType+this.device:""}get data(){return{device:this.device,type:_types.KameleoonData.Device,sent:this.sent}}get isSent(){return this.sent}set isSent(a){this.sent=a}static _fromVisit(a){var b;return null!==(b=a.staticDataEvent)&&void 0!==b&&b.data.deviceType?new Device(a.staticDataEvent.data.deviceType):void 0}}exports.Device=Device;
|
|
2
2
|
//# sourceMappingURL=device.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.js","names":["Device","constructor","device","_defineProperty","sent","url","UrlEventType","StaticData","UrlParameter","DeviceType","data","type","KameleoonData","isSent","value","
|
|
1
|
+
{"version":3,"file":"device.js","names":["Device","constructor","device","_defineProperty","sent","url","UrlEventType","StaticData","UrlParameter","DeviceType","data","type","KameleoonData","isSent","value","_fromVisit","visit","b","staticDataEvent","deviceType","exports"],"sources":["../../src/kameleoonData/device.ts"],"sourcesContent":["import { UrlEventType, UrlParameter, VisitType } from 'src/requester';\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 sent: boolean;\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.sent = false;\n }\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 UrlEventType.StaticData + UrlParameter.DeviceType + this.device;\n }\n\n get data(): DeviceDataType {\n return {\n device: this.device,\n type: KameleoonData.Device,\n sent: this.sent,\n };\n }\n\n get isSent(): boolean {\n return this.sent;\n }\n\n set isSent(value: boolean) {\n this.sent = value;\n }\n\n /**\n * @private\n * @method _fromVisit - an internal method for creating an instance of Device class from a visit\n * @param {VisitType} visit - a visit\n * @returns {Device | undefined} an instance of Device class or undefined if browser can not be found among visits\n * */\n public static _fromVisit(visit: VisitType): Device | undefined {\n if (visit.staticDataEvent?.data.deviceType) {\n return new Device(visit.staticDataEvent.data.deviceType);\n }\n\n return undefined;\n }\n}\n"],"mappings":"8pBAYO,KAAM,CAAAA,MAAiC,CAO5CC,WAAWA,CAACC,CAAkB,CAAE,CAAAC,eAAA,uBAAAA,eAAA,qBAC9B,IAAI,CAACD,MAAM,CAAGA,CAAM,CACpB,IAAI,CAACE,IAAI,GACX,CAEA,GAAI,CAAAC,GAAGA,CAAA,CAAW,OAIX,KAAI,CAACH,MAAM,CAITI,uBAAY,CAACC,UAAU,CAAGC,uBAAY,CAACC,UAAU,CAAG,IAAI,CAACP,MAAM,CAH7D,EAIX,CAEA,GAAI,CAAAQ,IAAIA,CAAA,CAAmB,CACzB,MAAO,CACLR,MAAM,CAAE,IAAI,CAACA,MAAM,CACnBS,IAAI,CAAEC,oBAAa,CAACZ,MAAM,CAC1BI,IAAI,CAAE,IAAI,CAACA,IACb,CACF,CAEA,GAAI,CAAAS,MAAMA,CAAA,CAAY,CACpB,MAAO,KAAI,CAACT,IACd,CAEA,GAAI,CAAAS,MAAMA,CAACC,CAAc,CAAE,CACzB,IAAI,CAACV,IAAI,CAAGU,CACd,CAQA,MAAc,CAAAC,UAAUA,CAACC,CAAgB,CAAsB,KAAAC,CAAA,gBAAAA,CAAA,CACzDD,CAAK,CAACE,eAAe,YAAAD,CAAA,EAArBA,CAAA,CAAuBP,IAAI,CAACS,UAAU,CACjC,GAAI,CAAAnB,MAAM,CAACgB,CAAK,CAACE,eAAe,CAACR,IAAI,CAACS,UAAU,CAAC,OAI5D,CACF,CAACC,OAAA,CAAApB,MAAA,CAAAA,MAAA"}
|
|
@@ -29,24 +29,15 @@ export declare class GeolocationData implements IKameleoonData {
|
|
|
29
29
|
*
|
|
30
30
|
* */
|
|
31
31
|
constructor({ country, region, city, postalCode, coordinates, }: GeolocationInfoType);
|
|
32
|
-
/**
|
|
33
|
-
* @property url - url for the current data type used for events tracking
|
|
34
|
-
* */
|
|
35
32
|
get url(): string;
|
|
36
|
-
/**
|
|
37
|
-
* @property data - data of the current class instance
|
|
38
|
-
* */
|
|
39
33
|
get data(): GeolocationDataType;
|
|
40
|
-
/**
|
|
41
|
-
* @property isSent - signifying if the data was sent already tracked
|
|
42
|
-
* */
|
|
43
34
|
get isSent(): boolean;
|
|
44
35
|
set isSent(value: boolean);
|
|
45
36
|
/**
|
|
46
37
|
* @private
|
|
47
|
-
* @method
|
|
48
|
-
* @param {VisitType
|
|
38
|
+
* @method _fromVisit - an internal method for creating an instance of GeolocationData class from a visit
|
|
39
|
+
* @param {VisitType} visit - a visit
|
|
49
40
|
* @returns {GeolocationData | undefined} an instance of GeolocationData class or undefined if geolocation can not be found among visits
|
|
50
41
|
* */
|
|
51
|
-
static
|
|
42
|
+
static _fromVisit(visit: VisitType): GeolocationData | undefined;
|
|
52
43
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GeolocationData=void 0;var _requester=require("../requester"),_types=require("./types");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||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){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)}class GeolocationData{constructor(a){let{country:b,region:c,city:d,postalCode:e,coordinates:f}=a;_defineProperty(this,"country",void 0),_defineProperty(this,"region",void 0),_defineProperty(this,"city",void 0),_defineProperty(this,"postalCode",void 0),_defineProperty(this,"coordinates",void 0),_defineProperty(this,"sent",void 0),this.country=b,this.region=c,this.city=d,this.postalCode=e,this.coordinates=f,this.sent=!1}get url(){const a=this.region?_requester.UrlParameter.Region+encodeURIComponent(this.region):"",b=this.city?_requester.UrlParameter.City+encodeURIComponent(this.city):"",c=this.postalCode?_requester.UrlParameter.PostalCode+encodeURIComponent(this.postalCode):"",d=this.coordinates?_requester.UrlParameter.Latitude+this.coordinates[0]+_requester.UrlParameter.Longitude+this.coordinates[1]:"";return _requester.UrlEventType.Geolocation+_requester.UrlParameter.Country+encodeURIComponent(this.country)+a+b+c+d}get data(){return{type:_types.KameleoonData.GeolocationData,country:this.country,region:this.region,city:this.city,postalCode:this.postalCode,coordinates:this.coordinates,sent:this.sent}}get isSent(){return this.sent}set isSent(a){this.sent=a}static
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GeolocationData=void 0;var _requester=require("../requester"),_types=require("./types");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||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){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)}class GeolocationData{constructor(a){let{country:b,region:c,city:d,postalCode:e,coordinates:f}=a;_defineProperty(this,"country",void 0),_defineProperty(this,"region",void 0),_defineProperty(this,"city",void 0),_defineProperty(this,"postalCode",void 0),_defineProperty(this,"coordinates",void 0),_defineProperty(this,"sent",void 0),this.country=b,this.region=c,this.city=d,this.postalCode=e,this.coordinates=f,this.sent=!1}get url(){const a=this.region?_requester.UrlParameter.Region+encodeURIComponent(this.region):"",b=this.city?_requester.UrlParameter.City+encodeURIComponent(this.city):"",c=this.postalCode?_requester.UrlParameter.PostalCode+encodeURIComponent(this.postalCode):"",d=this.coordinates?_requester.UrlParameter.Latitude+this.coordinates[0]+_requester.UrlParameter.Longitude+this.coordinates[1]:"";return _requester.UrlEventType.Geolocation+_requester.UrlParameter.Country+encodeURIComponent(this.country)+a+b+c+d}get data(){return{type:_types.KameleoonData.GeolocationData,country:this.country,region:this.region,city:this.city,postalCode:this.postalCode,coordinates:this.coordinates,sent:this.sent}}get isSent(){return this.sent}set isSent(a){this.sent=a}static _fromVisit(a){var b;if(!(null!==(b=a.geolocationEvents)&&void 0!==b&&b.length))return;let c;for(const b of a.geolocationEvents){const{data:a}=b;a.country&&(c=a)}const{country:d,region:e,city:f}=c||{};if(d)return e&&f?new GeolocationData({country:d,region:e,city:f}):e?new GeolocationData({country:d,region:e}):new GeolocationData({country:d})}}exports.GeolocationData=GeolocationData;
|
|
2
2
|
//# sourceMappingURL=geolocation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geolocation.js","names":["GeolocationData","constructor","a","country","region","city","postalCode","coordinates","_defineProperty","sent","url","UrlParameter","Region","encodeURIComponent","City","PostalCode","Latitude","Longitude","UrlEventType","Geolocation","Country","data","type","KameleoonData","isSent","value","
|
|
1
|
+
{"version":3,"file":"geolocation.js","names":["GeolocationData","constructor","a","country","region","city","postalCode","coordinates","_defineProperty","sent","url","UrlParameter","Region","encodeURIComponent","City","PostalCode","Latitude","Longitude","UrlEventType","Geolocation","Country","data","type","KameleoonData","isSent","value","_fromVisit","visit","b","geolocationEvents","length","geolocationData","geolocationEvent","exports"],"sources":["../../src/kameleoonData/geolocation.ts"],"sourcesContent":["import { UrlEventType, UrlParameter, VisitType } from 'src/requester';\nimport { GeolocationEventType } from 'src/requester/types';\nimport {\n IKameleoonData,\n KameleoonData,\n GeolocationInfoType,\n GeolocationDataType,\n} from './types';\n\n/**\n * @class\n * Geolocation - a class for creating an instance for geolocation data\n * */\nexport class GeolocationData implements IKameleoonData {\n private country: string;\n private region?: string;\n private city?: string;\n private postalCode?: string;\n private coordinates?: [number, number];\n private sent: boolean;\n\n /**\n * @param {GeolocationInfoType} geolocationInfo - an object containing information about geolocation of a visitor\n * @example\n * ```ts\n * // Visitor is located at Triumph Arch in Paris, France\n * const location: GeolocationDataType = {\n * country: 'France',\n * region: 'Île-de-France',\n * city: 'Paris',\n * postalCode: '75008',\n * coordinates: [48.8738, 2.295]\n * };\n *\n * const geolocation = new GeolocationData(location);\n * ```\n *\n * */\n constructor({\n country,\n region,\n city,\n postalCode,\n coordinates,\n }: GeolocationInfoType) {\n this.country = country;\n this.region = region;\n this.city = city;\n this.postalCode = postalCode;\n this.coordinates = coordinates;\n this.sent = false;\n }\n\n get url(): string {\n const region = this.region\n ? UrlParameter.Region + encodeURIComponent(this.region)\n : '';\n const city = this.city\n ? UrlParameter.City + encodeURIComponent(this.city)\n : '';\n const postalCode = this.postalCode\n ? UrlParameter.PostalCode + encodeURIComponent(this.postalCode)\n : '';\n const coordinates = this.coordinates\n ? UrlParameter.Latitude +\n this.coordinates[0] +\n UrlParameter.Longitude +\n this.coordinates[1]\n : '';\n\n return (\n UrlEventType.Geolocation +\n UrlParameter.Country +\n encodeURIComponent(this.country) +\n region +\n city +\n postalCode +\n coordinates\n );\n }\n\n get data(): GeolocationDataType {\n return {\n type: KameleoonData.GeolocationData,\n country: this.country,\n region: this.region,\n city: this.city,\n postalCode: this.postalCode,\n coordinates: this.coordinates,\n sent: this.sent,\n };\n }\n\n get isSent(): boolean {\n return this.sent;\n }\n\n set isSent(value: boolean) {\n this.sent = value;\n }\n\n /**\n * @private\n * @method _fromVisit - an internal method for creating an instance of GeolocationData class from a visit\n * @param {VisitType} visit - a visit\n * @returns {GeolocationData | undefined} an instance of GeolocationData class or undefined if geolocation can not be found among visits\n * */\n public static _fromVisit(visit: VisitType): GeolocationData | undefined {\n if (!visit.geolocationEvents?.length) {\n return undefined;\n }\n\n let geolocationData: GeolocationEventType['data'] | undefined = undefined;\n\n for (const geolocationEvent of visit.geolocationEvents) {\n const { data } = geolocationEvent;\n\n if (data.country) {\n geolocationData = data;\n }\n }\n\n // --- Note ---\n // We only take `country`, `region`, and `city` from geolocation event ignoring other fields\n // as they are not participating in targeting, and visits data won't be tracked again\n const { country, region, city } = geolocationData || {};\n\n if (country) {\n if (region && city) {\n return new GeolocationData({ country, region, city });\n } else if (region) {\n return new GeolocationData({ country, region });\n } else {\n return new GeolocationData({ country });\n }\n }\n }\n}\n"],"mappings":"uqBAaO,KAAM,CAAAA,eAA0C,CAyBrDC,WAAWA,CAAAC,CAAA,CAMa,IANZ,CACVC,OAAO,CAAPA,CAAO,CACPC,MAAM,CAANA,CAAM,CACNC,IAAI,CAAJA,CAAI,CACJC,UAAU,CAAVA,CAAU,CACVC,WAAW,CAAXA,CACmB,CAAC,CAAAL,CAAA,CAAAM,eAAA,wBAAAA,eAAA,uBAAAA,eAAA,qBAAAA,eAAA,2BAAAA,eAAA,4BAAAA,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plicationVersion } from './applicationVersion';
|
|
11
11
|
export { VisitsData } from './visitsData';
|
|
12
|
+
export { KameleoonConversionScore } from './kameleoonConversionScore';
|
|
12
13
|
export { DEFAULT_CLEANUP_INTERVAL } from './constants';
|
|
13
14
|
export { DeviceType, CookieType, VisitsDataType, BrowserType, KameleoonData, DeviceDataType, CustomDataType, BrowserDataType, BrowserIndexMap, PageViewDataType, KameleoonDataType, UserAgentDataType, ConversionDataType, OperatingSystemType, GeolocationInfoType, KameleoonDataItemType, PageViewParametersType, ConversionParametersType, ApplicationVersionDataType, } from './types';
|
|
14
15
|
export { DataManager } from './dataManager';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"ApplicationVersion",{enumerable:!0,get:function(){return _applicationVersion.ApplicationVersion}}),Object.defineProperty(exports,"ApplicationVersionDataType",{enumerable:!0,get:function(){return _types.ApplicationVersionDataType}}),Object.defineProperty(exports,"Browser",{enumerable:!0,get:function(){return _browser.Browser}}),Object.defineProperty(exports,"BrowserDataType",{enumerable:!0,get:function(){return _types.BrowserDataType}}),Object.defineProperty(exports,"BrowserIndexMap",{enumerable:!0,get:function(){return _types.BrowserIndexMap}}),Object.defineProperty(exports,"BrowserType",{enumerable:!0,get:function(){return _types.BrowserType}}),Object.defineProperty(exports,"Conversion",{enumerable:!0,get:function(){return _conversion.Conversion}}),Object.defineProperty(exports,"ConversionDataType",{enumerable:!0,get:function(){return _types.ConversionDataType}}),Object.defineProperty(exports,"ConversionParametersType",{enumerable:!0,get:function(){return _types.ConversionParametersType}}),Object.defineProperty(exports,"Cookie",{enumerable:!0,get:function(){return _cookie.Cookie}}),Object.defineProperty(exports,"CookieType",{enumerable:!0,get:function(){return _types.CookieType}}),Object.defineProperty(exports,"CustomData",{enumerable:!0,get:function(){return _customData.CustomData}}),Object.defineProperty(exports,"CustomDataType",{enumerable:!0,get:function(){return _types.CustomDataType}}),Object.defineProperty(exports,"DEFAULT_CLEANUP_INTERVAL",{enumerable:!0,get:function(){return _constants.DEFAULT_CLEANUP_INTERVAL}}),Object.defineProperty(exports,"DataManager",{enumerable:!0,get:function(){return _dataManager.DataManager}}),Object.defineProperty(exports,"Device",{enumerable:!0,get:function(){return _device.Device}}),Object.defineProperty(exports,"DeviceDataType",{enumerable:!0,get:function(){return _types.DeviceDataType}}),Object.defineProperty(exports,"DeviceType",{enumerable:!0,get:function(){return _types.DeviceType}}),Object.defineProperty(exports,"GeolocationData",{enumerable:!0,get:function(){return _geolocation.GeolocationData}}),Object.defineProperty(exports,"GeolocationInfoType",{enumerable:!0,get:function(){return _types.GeolocationInfoType}}),Object.defineProperty(exports,"KameleoonData",{enumerable:!0,get:function(){return _types.KameleoonData}}),Object.defineProperty(exports,"KameleoonDataItemType",{enumerable:!0,get:function(){return _types.KameleoonDataItemType}}),Object.defineProperty(exports,"KameleoonDataType",{enumerable:!0,get:function(){return _types.KameleoonDataType}}),Object.defineProperty(exports,"OperatingSystem",{enumerable:!0,get:function(){return _operatingSystem.OperatingSystem}}),Object.defineProperty(exports,"OperatingSystemType",{enumerable:!0,get:function(){return _types.OperatingSystemType}}),Object.defineProperty(exports,"PageView",{enumerable:!0,get:function(){return _pageView.PageView}}),Object.defineProperty(exports,"PageViewDataType",{enumerable:!0,get:function(){return _types.PageViewDataType}}),Object.defineProperty(exports,"PageViewParametersType",{enumerable:!0,get:function(){return _types.PageViewParametersType}}),Object.defineProperty(exports,"UserAgent",{enumerable:!0,get:function(){return _userAgent.UserAgent}}),Object.defineProperty(exports,"UserAgentDataType",{enumerable:!0,get:function(){return _types.UserAgentDataType}}),Object.defineProperty(exports,"VisitsData",{enumerable:!0,get:function(){return _visitsData.VisitsData}}),Object.defineProperty(exports,"VisitsDataType",{enumerable:!0,get:function(){return _types.VisitsDataType}});var _device=require("./device"),_cookie=require("./cookie"),_browser=require("./browser"),_pageView=require("./pageView"),_userAgent=require("./userAgent"),_customData=require("./customData"),_conversion=require("./conversion"),_geolocation=require("./geolocation"),_operatingSystem=require("./operatingSystem"),_applicationVersion=require("./applicationVersion"),_visitsData=require("./visitsData"),_constants=require("./constants"),_types=require("./types"),_dataManager=require("./dataManager");
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"ApplicationVersion",{enumerable:!0,get:function(){return _applicationVersion.ApplicationVersion}}),Object.defineProperty(exports,"ApplicationVersionDataType",{enumerable:!0,get:function(){return _types.ApplicationVersionDataType}}),Object.defineProperty(exports,"Browser",{enumerable:!0,get:function(){return _browser.Browser}}),Object.defineProperty(exports,"BrowserDataType",{enumerable:!0,get:function(){return _types.BrowserDataType}}),Object.defineProperty(exports,"BrowserIndexMap",{enumerable:!0,get:function(){return _types.BrowserIndexMap}}),Object.defineProperty(exports,"BrowserType",{enumerable:!0,get:function(){return _types.BrowserType}}),Object.defineProperty(exports,"Conversion",{enumerable:!0,get:function(){return _conversion.Conversion}}),Object.defineProperty(exports,"ConversionDataType",{enumerable:!0,get:function(){return _types.ConversionDataType}}),Object.defineProperty(exports,"ConversionParametersType",{enumerable:!0,get:function(){return _types.ConversionParametersType}}),Object.defineProperty(exports,"Cookie",{enumerable:!0,get:function(){return _cookie.Cookie}}),Object.defineProperty(exports,"CookieType",{enumerable:!0,get:function(){return _types.CookieType}}),Object.defineProperty(exports,"CustomData",{enumerable:!0,get:function(){return _customData.CustomData}}),Object.defineProperty(exports,"CustomDataType",{enumerable:!0,get:function(){return _types.CustomDataType}}),Object.defineProperty(exports,"DEFAULT_CLEANUP_INTERVAL",{enumerable:!0,get:function(){return _constants.DEFAULT_CLEANUP_INTERVAL}}),Object.defineProperty(exports,"DataManager",{enumerable:!0,get:function(){return _dataManager.DataManager}}),Object.defineProperty(exports,"Device",{enumerable:!0,get:function(){return _device.Device}}),Object.defineProperty(exports,"DeviceDataType",{enumerable:!0,get:function(){return _types.DeviceDataType}}),Object.defineProperty(exports,"DeviceType",{enumerable:!0,get:function(){return _types.DeviceType}}),Object.defineProperty(exports,"GeolocationData",{enumerable:!0,get:function(){return _geolocation.GeolocationData}}),Object.defineProperty(exports,"GeolocationInfoType",{enumerable:!0,get:function(){return _types.GeolocationInfoType}}),Object.defineProperty(exports,"KameleoonConversionScore",{enumerable:!0,get:function(){return _kameleoonConversionScore.KameleoonConversionScore}}),Object.defineProperty(exports,"KameleoonData",{enumerable:!0,get:function(){return _types.KameleoonData}}),Object.defineProperty(exports,"KameleoonDataItemType",{enumerable:!0,get:function(){return _types.KameleoonDataItemType}}),Object.defineProperty(exports,"KameleoonDataType",{enumerable:!0,get:function(){return _types.KameleoonDataType}}),Object.defineProperty(exports,"OperatingSystem",{enumerable:!0,get:function(){return _operatingSystem.OperatingSystem}}),Object.defineProperty(exports,"OperatingSystemType",{enumerable:!0,get:function(){return _types.OperatingSystemType}}),Object.defineProperty(exports,"PageView",{enumerable:!0,get:function(){return _pageView.PageView}}),Object.defineProperty(exports,"PageViewDataType",{enumerable:!0,get:function(){return _types.PageViewDataType}}),Object.defineProperty(exports,"PageViewParametersType",{enumerable:!0,get:function(){return _types.PageViewParametersType}}),Object.defineProperty(exports,"UserAgent",{enumerable:!0,get:function(){return _userAgent.UserAgent}}),Object.defineProperty(exports,"UserAgentDataType",{enumerable:!0,get:function(){return _types.UserAgentDataType}}),Object.defineProperty(exports,"VisitsData",{enumerable:!0,get:function(){return _visitsData.VisitsData}}),Object.defineProperty(exports,"VisitsDataType",{enumerable:!0,get:function(){return _types.VisitsDataType}});var _device=require("./device"),_cookie=require("./cookie"),_browser=require("./browser"),_pageView=require("./pageView"),_userAgent=require("./userAgent"),_customData=require("./customData"),_conversion=require("./conversion"),_geolocation=require("./geolocation"),_operatingSystem=require("./operatingSystem"),_applicationVersion=require("./applicationVersion"),_visitsData=require("./visitsData"),_kameleoonConversionScore=require("./kameleoonConversionScore"),_constants=require("./constants"),_types=require("./types"),_dataManager=require("./dataManager");
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/kameleoonData/index.ts"],"sourcesContent":["export { Device } from './device';\nexport { Cookie } from './cookie';\nexport { Browser } from './browser';\nexport { PageView } from './pageView';\nexport { UserAgent } from './userAgent';\nexport { CustomData } from './customData';\nexport { Conversion } from './conversion';\nexport { GeolocationData } from './geolocation';\nexport { OperatingSystem } from './operatingSystem';\nexport { ApplicationVersion } from './applicationVersion';\nexport { VisitsData } from './visitsData';\nexport { DEFAULT_CLEANUP_INTERVAL } from './constants';\nexport {\n DeviceType,\n CookieType,\n VisitsDataType,\n BrowserType,\n KameleoonData,\n DeviceDataType,\n CustomDataType,\n BrowserDataType,\n BrowserIndexMap,\n PageViewDataType,\n KameleoonDataType,\n UserAgentDataType,\n ConversionDataType,\n OperatingSystemType,\n GeolocationInfoType,\n KameleoonDataItemType,\n PageViewParametersType,\n ConversionParametersType,\n ApplicationVersionDataType,\n} from './types';\nexport { DataManager } from './dataManager';\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/kameleoonData/index.ts"],"sourcesContent":["export { Device } from './device';\nexport { Cookie } from './cookie';\nexport { Browser } from './browser';\nexport { PageView } from './pageView';\nexport { UserAgent } from './userAgent';\nexport { CustomData } from './customData';\nexport { Conversion } from './conversion';\nexport { GeolocationData } from './geolocation';\nexport { OperatingSystem } from './operatingSystem';\nexport { ApplicationVersion } from './applicationVersion';\nexport { VisitsData } from './visitsData';\nexport { KameleoonConversionScore } from './kameleoonConversionScore';\nexport { DEFAULT_CLEANUP_INTERVAL } from './constants';\nexport {\n DeviceType,\n CookieType,\n VisitsDataType,\n BrowserType,\n KameleoonData,\n DeviceDataType,\n CustomDataType,\n BrowserDataType,\n BrowserIndexMap,\n PageViewDataType,\n KameleoonDataType,\n UserAgentDataType,\n ConversionDataType,\n OperatingSystemType,\n GeolocationInfoType,\n KameleoonDataItemType,\n PageViewParametersType,\n ConversionParametersType,\n ApplicationVersionDataType,\n} from './types';\nexport { DataManager } from './dataManager';\n"],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IKameleoonData, KCSType, KCSDataType } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* @class
|
|
4
|
+
* KameleoonConversionScore - a class for creating an KCS Heat Range data
|
|
5
|
+
* */
|
|
6
|
+
export declare class KameleoonConversionScore implements IKameleoonData {
|
|
7
|
+
private kcs;
|
|
8
|
+
/**
|
|
9
|
+
* @param {KCSType} kcs - Kameleoon Conversion Score nested object
|
|
10
|
+
* */
|
|
11
|
+
constructor(kcs: KCSType);
|
|
12
|
+
get url(): string;
|
|
13
|
+
get data(): KCSDataType;
|
|
14
|
+
get isSent(): boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var _types=require("./types");Object.defineProperty(exports,"__esModule",{value:!0}),exports.KameleoonConversionScore=void 0;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||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){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)}class KameleoonConversionScore{constructor(a){_defineProperty(this,"kcs",void 0),this.kcs=a}get url(){return""}get data(){return{kcs:this.kcs,type:_types.KameleoonData.KameleoonConversionScore,sent:!0}}get isSent(){return!0}}exports.KameleoonConversionScore=KameleoonConversionScore;
|
|
2
|
+
//# sourceMappingURL=kameleoonConversionScore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kameleoonConversionScore.js","names":["_types","require","Object","defineProperty","exports","value","KameleoonConversionScore","_defineProperty","a","b","c","_toPropertyKey","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","d","call","TypeError","String","Number","constructor","kcs","url","data","type","KameleoonData","sent","isSent"],"sources":["../../src/kameleoonData/kameleoonConversionScore.ts"],"sourcesContent":["import { IKameleoonData, KCSType, KCSDataType, KameleoonData } from './types';\n\n/**\n * @class\n * KameleoonConversionScore - a class for creating an KCS Heat Range data\n * */\nexport class KameleoonConversionScore implements IKameleoonData {\n private kcs: KCSType;\n\n /**\n * @param {KCSType} kcs - Kameleoon Conversion Score nested object\n * */\n constructor(kcs: KCSType) {\n this.kcs = kcs;\n }\n\n get url(): string {\n return '';\n }\n\n get data(): KCSDataType {\n return {\n kcs: this.kcs,\n type: KameleoonData.KameleoonConversionScore,\n sent: true,\n };\n }\n\n get isSent(): boolean {\n return true;\n }\n}\n"],"mappings":"aAAA,IAAAA,MAAA,CAAAC,OAAA,YAA8EC,MAAA,CAAAC,cAAA,CAAAC,OAAA,eAAAC,KAAA,MAAAD,OAAA,CAAAE,wBAAA,iBAAAC,gBAAAC,CAAA,CAAAC,CAAA,CAAAC,CAAA,SAAAD,CAAA,CAAAE,cAAA,CAAAF,CAAA,EAAAA,CAAA,IAAAD,CAAA,CAAAN,MAAA,CAAAC,cAAA,CAAAK,CAAA,CAAAC,CAAA,EAAAJ,KAAA,CAAAK,CAAA,CAAAE,UAAA,IAAAC,YAAA,IAAAC,QAAA,MAAAN,CAAA,CAAAC,CAAA,EAAAC,CAAA,CAAAF,CAAA,UAAAG,eAAAH,CAAA,MAAAC,CAAA,CAAAM,YAAA,CAAAP,CAAA,kCAAAC,CAAA,CAAAA,CAAA,CAAAA,CAAA,aAAAM,aAAAP,CAAA,CAAAC,CAAA,sBAAAD,CAAA,GAAAA,CAAA,QAAAA,CAAA,KAAAE,CAAA,CAAAF,CAAA,CAAAQ,MAAA,CAAAC,WAAA,cAAAP,CAAA,MAAAQ,CAAA,CAAAR,CAAA,CAAAS,IAAA,CAAAX,CAAA,CAAAC,CAAA,iCAAAS,CAAA,QAAAA,CAAA,WAAAE,SAAA,mEAAAX,CAAA,CAAAY,MAAA,CAAAC,MAAA,EAAAd,CAAA,EAMvE,KAAM,CAAAF,wBAAmD,CAM9DiB,WAAWA,CAACC,CAAY,CAAE,CAAAjB,eAAA,oBACxB,IAAI,CAACiB,GAAG,CAAGA,CACb,CAEA,GAAI,CAAAC,GAAGA,CAAA,CAAW,CAChB,MAAO,EACT,CAEA,GAAI,CAAAC,IAAIA,CAAA,CAAgB,CACtB,MAAO,CACLF,GAAG,CAAE,IAAI,CAACA,GAAG,CACbG,IAAI,CAAEC,oBAAa,CAACtB,wBAAwB,CAC5CuB,IAAI,GACN,CACF,CAEA,GAAI,CAAAC,MAAMA,CAAA,CAAY,CACpB,QACF,CACF,CAAC1B,OAAA,CAAAE,wBAAA,CAAAA,wBAAA"}
|
|
@@ -11,24 +11,15 @@ export declare class OperatingSystem implements IKameleoonData {
|
|
|
11
11
|
* @param {OperatingSystemType} operatingSystem - one of the available operating system types from `OperatingSystemType` enum
|
|
12
12
|
* */
|
|
13
13
|
constructor(operatingSystem: OperatingSystemType);
|
|
14
|
-
/**
|
|
15
|
-
* @property url - url for the current data type used for events tracking
|
|
16
|
-
* */
|
|
17
14
|
get url(): string;
|
|
18
|
-
/**
|
|
19
|
-
* @property data - data of the current class instance
|
|
20
|
-
* */
|
|
21
15
|
get data(): OperatingSystemDataType;
|
|
22
|
-
/**
|
|
23
|
-
* @property isSent - signifying if the data was sent already tracked
|
|
24
|
-
* */
|
|
25
16
|
get isSent(): boolean;
|
|
26
17
|
set isSent(value: boolean);
|
|
27
18
|
/**
|
|
28
19
|
* @private
|
|
29
|
-
* @method
|
|
30
|
-
* @param {VisitType
|
|
20
|
+
* @method _fromVisit - a static method for creating an instance of OperatingSystem class from a visit
|
|
21
|
+
* @param {VisitType} visit - a visit
|
|
31
22
|
* @returns {OperatingSystem | undefined} an instance of OperatingSystem class or undefined
|
|
32
23
|
* */
|
|
33
|
-
static
|
|
24
|
+
static _fromVisit(visit: VisitType): OperatingSystem | undefined;
|
|
34
25
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.OperatingSystem=void 0;var _requester=require("../requester"),_types=require("./types");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||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){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)}class OperatingSystem{constructor(a){_defineProperty(this,"operatingSystem",void 0),_defineProperty(this,"sent",void 0),this.operatingSystem=a,this.sent=!1}get url(){return this.operatingSystem?_requester.UrlEventType.StaticData+_requester.UrlParameter.Os+this.operatingSystem+_requester.UrlParameter.OsIndex+_types.OperatingSystemIndexMap[this.operatingSystem]:""}get data(){return{operatingSystem:this.operatingSystem,type:_types.KameleoonData.OperatingSystem,sent:this.sent}}get isSent(){return this.sent}set isSent(a){this.sent=a}static
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.OperatingSystem=void 0;var _requester=require("../requester"),_types=require("./types");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||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){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)}class OperatingSystem{constructor(a){_defineProperty(this,"operatingSystem",void 0),_defineProperty(this,"sent",void 0),this.operatingSystem=a,this.sent=!1}get url(){return this.operatingSystem?_requester.UrlEventType.StaticData+_requester.UrlParameter.Os+this.operatingSystem+_requester.UrlParameter.OsIndex+_types.OperatingSystemIndexMap[this.operatingSystem]:""}get data(){return{operatingSystem:this.operatingSystem,type:_types.KameleoonData.OperatingSystem,sent:this.sent}}get isSent(){return this.sent}set isSent(a){this.sent=a}static _fromVisit(a){if(a.staticDataEvent){const{os:b,osIndex:c}=a.staticDataEvent.data;if(b||"number"==typeof c){const a=null!==b&&void 0!==b?b:_types.OperatingSystemTypeMap[c];return new OperatingSystem(a)}}}}exports.OperatingSystem=OperatingSystem;
|
|
2
2
|
//# sourceMappingURL=operatingSystem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operatingSystem.js","names":["OperatingSystem","constructor","operatingSystem","_defineProperty","sent","url","UrlEventType","StaticData","UrlParameter","Os","OsIndex","OperatingSystemIndexMap","data","type","KameleoonData","isSent","value","
|
|
1
|
+
{"version":3,"file":"operatingSystem.js","names":["OperatingSystem","constructor","operatingSystem","_defineProperty","sent","url","UrlEventType","StaticData","UrlParameter","Os","OsIndex","OperatingSystemIndexMap","data","type","KameleoonData","isSent","value","_fromVisit","visit","staticDataEvent","os","operatingSystemType","osIndex","OperatingSystemTypeMap","exports"],"sources":["../../src/kameleoonData/operatingSystem.ts"],"sourcesContent":["import { UrlEventType, UrlParameter, VisitType } from 'src/requester';\nimport {\n IKameleoonData,\n KameleoonData,\n OperatingSystemDataType,\n OperatingSystemIndexMap,\n OperatingSystemType,\n OperatingSystemTypeMap,\n} from './types';\n\n/**\n * @class\n * OperatingSystem - a class for creating an instance for Operating System of a certain type\n * */\nexport class OperatingSystem implements IKameleoonData {\n private operatingSystem: OperatingSystemType;\n private sent: boolean;\n\n /**\n * @param {OperatingSystemType} operatingSystem - one of the available operating system types from `OperatingSystemType` enum\n * */\n constructor(operatingSystem: OperatingSystemType) {\n this.operatingSystem = operatingSystem;\n this.sent = false;\n }\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.operatingSystem) {\n return '';\n }\n\n return (\n UrlEventType.StaticData +\n UrlParameter.Os +\n this.operatingSystem +\n UrlParameter.OsIndex +\n OperatingSystemIndexMap[this.operatingSystem]\n );\n }\n\n get data(): OperatingSystemDataType {\n return {\n operatingSystem: this.operatingSystem,\n type: KameleoonData.OperatingSystem,\n sent: this.sent,\n };\n }\n\n get isSent(): boolean {\n return this.sent;\n }\n\n set isSent(value: boolean) {\n this.sent = value;\n }\n\n /**\n * @private\n * @method _fromVisit - a static method for creating an instance of OperatingSystem class from a visit\n * @param {VisitType} visit - a visit\n * @returns {OperatingSystem | undefined} an instance of OperatingSystem class or undefined\n * */\n public static _fromVisit(visit: VisitType): OperatingSystem | undefined {\n if (!visit.staticDataEvent) {\n return undefined;\n }\n\n const { os: operatingSystemType, osIndex } = visit.staticDataEvent.data;\n\n if (operatingSystemType || typeof osIndex === 'number') {\n const operatingSystem =\n operatingSystemType ?? OperatingSystemTypeMap[osIndex as number];\n\n return new OperatingSystem(operatingSystem);\n }\n\n return undefined;\n }\n}\n"],"mappings":"uqBAcO,KAAM,CAAAA,eAA0C,CAOrDC,WAAWA,CAACC,CAAoC,CAAE,CAAAC,eAAA,gCAAAA,eAAA,qBAChD,IAAI,CAACD,eAAe,CAAGA,CAAe,CACtC,IAAI,CAACE,IAAI,GACX,CAEA,GAAI,CAAAC,GAAGA,CAAA,CAAW,OAIX,KAAI,CAACH,eAAe,CAKvBI,uBAAY,CAACC,UAAU,CACvBC,uBAAY,CAACC,EAAE,CACf,IAAI,CAACP,eAAe,CACpBM,uBAAY,CAACE,OAAO,CACpBC,8BAAuB,CAAC,IAAI,CAACT,eAAe,CAAC,CARtC,EAUX,CAEA,GAAI,CAAAU,IAAIA,CAAA,CAA4B,CAClC,MAAO,CACLV,eAAe,CAAE,IAAI,CAACA,eAAe,CACrCW,IAAI,CAAEC,oBAAa,CAACd,eAAe,CACnCI,IAAI,CAAE,IAAI,CAACA,IACb,CACF,CAEA,GAAI,CAAAW,MAAMA,CAAA,CAAY,CACpB,MAAO,KAAI,CAACX,IACd,CAEA,GAAI,CAAAW,MAAMA,CAACC,CAAc,CAAE,CACzB,IAAI,CAACZ,IAAI,CAAGY,CACd,CAQA,MAAc,CAAAC,UAAUA,CAACC,CAAgB,CAA+B,CACtE,GAAKA,CAAK,CAACC,eAAe,EAI1B,KAAM,CAAEC,EAAE,CAAEC,CAAmB,CAAEC,OAAO,CAAPA,CAAQ,CAAC,CAAGJ,CAAK,CAACC,eAAe,CAACP,IAAI,CAEvE,GAAIS,CAAmB,EAAuB,QAAQ,EAA3B,MAAO,CAAAC,CAAoB,CAAE,CACtD,KAAM,CAAApB,CAAe,QACnBmB,CAAmB,WAAnBA,CAAmB,CAAnBA,CAAmB,CAAIE,6BAAsB,CAACD,CAAO,CAAW,CAElE,MAAO,IAAI,CAAAtB,eAAe,CAACE,CAAe,CAC5C,CAAC,CAGH,CACF,CAACsB,OAAA,CAAAxB,eAAA,CAAAA,eAAA"}
|
|
@@ -14,17 +14,8 @@ export declare class PageView implements IKameleoonData {
|
|
|
14
14
|
* @param {PageViewParametersType} pageViewParameters - an object with page view parameters
|
|
15
15
|
* */
|
|
16
16
|
constructor({ urlAddress, title, referrers }: PageViewParametersType);
|
|
17
|
-
/**
|
|
18
|
-
* @property url - url for the current data type used for events tracking
|
|
19
|
-
* */
|
|
20
17
|
get url(): string;
|
|
21
|
-
/**
|
|
22
|
-
* @property data - data of the current class instance
|
|
23
|
-
* */
|
|
24
18
|
get data(): PageViewDataType;
|
|
25
|
-
/**
|
|
26
|
-
* @property isSent - signifying if the data was sent already tracked
|
|
27
|
-
* */
|
|
28
19
|
get isSent(): boolean;
|
|
29
20
|
set isSent(value: boolean);
|
|
30
21
|
/**
|
|
@@ -34,9 +25,9 @@ export declare class PageView implements IKameleoonData {
|
|
|
34
25
|
set timestamps(value: number[]);
|
|
35
26
|
/**
|
|
36
27
|
* @private
|
|
37
|
-
* @method
|
|
38
|
-
* @param {VisitType
|
|
39
|
-
* @
|
|
28
|
+
* @method _updateFromVisit - an internal method for updating a list of page view data from a visit
|
|
29
|
+
* @param {VisitType} visit - a visit
|
|
30
|
+
* @param {Map<string, PageView>} dataMap - a map of page view data where we collect data
|
|
40
31
|
* */
|
|
41
|
-
static
|
|
32
|
+
static _updateFromVisit(visit: VisitType, dataMap: Map<string, PageView>): void;
|
|
42
33
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PageView=void 0;var _requester=require("../requester"),_utilities=require("../utilities"),_types=require("../utilities/types"),_types2=require("./types");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||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){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)}class PageView{constructor(a){let{urlAddress:b,title:c,referrers:d}=a;_defineProperty(this,"urlAddress",void 0),_defineProperty(this,"title",void 0),_defineProperty(this,"referrers",void 0),_defineProperty(this,"sent",void 0),_defineProperty(this,"timestampList",[]),this.urlAddress=b,this.title=c,this.referrers=d,this.sent=!1}get url(){var a;if(!this.urlAddress)return"";const 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}get data(){return{urlAddress:this.urlAddress,title:this.title,referrers:this.referrers,type:_types2.KameleoonData.PageView,sent:this.sent,timestamps:this.timestampList}}get isSent(){return this.sent}set isSent(a){this.sent=a}get timestamps(){return this.timestampList}set timestamps(a){const b=new Set(a);this.timestampList.length?b.forEach(a=>{_utilities.Utilities.insertInOrderedListMutably({list:this.timestampList,element:a,order:_types.Order.Ascending})}):this.timestampList=[...b]}static
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PageView=void 0;var _requester=require("../requester"),_utilities=require("../utilities"),_types=require("../utilities/types"),_types2=require("./types");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||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){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)}class PageView{constructor(a){let{urlAddress:b,title:c,referrers:d}=a;_defineProperty(this,"urlAddress",void 0),_defineProperty(this,"title",void 0),_defineProperty(this,"referrers",void 0),_defineProperty(this,"sent",void 0),_defineProperty(this,"timestampList",[]),this.urlAddress=b,this.title=c,this.referrers=d,this.sent=!1}get url(){var a;if(!this.urlAddress)return"";const 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}get data(){return{urlAddress:this.urlAddress,title:this.title,referrers:this.referrers,type:_types2.KameleoonData.PageView,sent:this.sent,timestamps:this.timestampList}}get isSent(){return this.sent}set isSent(a){this.sent=a}get timestamps(){return this.timestampList}set timestamps(a){const b=new Set(a);this.timestampList.length?b.forEach(a=>{_utilities.Utilities.insertInOrderedListMutably({list:this.timestampList,element:a,order:_types.Order.Ascending})}):this.timestampList=[...b]}static _updateFromVisit(a,b){const c=a.pageEvents;if(c)for(const a of c){let c=[];const{time:d}=a,{href:e,title:f,referrersIndices:g}=a.data;"number"==typeof g[0]&&(c=g);let h;if(b.has(e)){const a=b.get(e).timestamps;h=new PageView({urlAddress:e,title:f,referrers:c}),h.timestamps=[...a,d]}else h=new PageView({urlAddress:e,title:f,referrers:c}),h.timestamps=[d];h.isSent=!0,b.set(e,h)}}}exports.PageView=PageView;
|
|
2
2
|
//# sourceMappingURL=pageView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pageView.js","names":["PageView","constructor","a","urlAddress","title","referrers","_defineProperty","sent","url","titleParameter","UrlParameter","Title","encodeURIComponent","referrersParameter","length","ReferrersIndices","JSON","stringify","UrlEventType","Page","Href","data","type","KameleoonData","timestamps","timestampList","isSent","value","uniqueValues","Set","forEach","timestamp","Utilities","insertInOrderedListMutably","list","element","order","Order","Ascending","
|
|
1
|
+
{"version":3,"file":"pageView.js","names":["PageView","constructor","a","urlAddress","title","referrers","_defineProperty","sent","url","titleParameter","UrlParameter","Title","encodeURIComponent","referrersParameter","length","ReferrersIndices","JSON","stringify","UrlEventType","Page","Href","data","type","KameleoonData","timestamps","timestampList","isSent","value","uniqueValues","Set","forEach","timestamp","Utilities","insertInOrderedListMutably","list","element","order","Order","Ascending","_updateFromVisit","visit","dataMap","pageEvents","pageEvent","time","href","referrersIndices","pageView","has","existingTimestamps","get","set","exports"],"sources":["../../src/kameleoonData/pageView.ts"],"sourcesContent":["import { UrlEventType, UrlParameter, VisitType } from 'src/requester';\nimport { Utilities } from 'src/utilities';\nimport { Order } from 'src/utilities/types';\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 referrers?: number[];\n private sent: boolean;\n // --- Note ---\n // Ascending order\n private timestampList: 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.sent = false;\n }\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 );\n }\n\n get data(): PageViewDataType {\n return {\n urlAddress: this.urlAddress,\n title: this.title,\n referrers: this.referrers,\n type: KameleoonData.PageView,\n sent: this.sent,\n timestamps: this.timestampList,\n };\n }\n\n get isSent(): boolean {\n return this.sent;\n }\n\n set isSent(value: boolean) {\n this.sent = value;\n }\n\n /**\n * @property timestamps - a list of timestamps for the current data type\n * */\n get timestamps(): number[] {\n return this.timestampList;\n }\n\n set timestamps(value: number[]) {\n const uniqueValues = new Set<number>(value);\n\n if (this.timestampList.length) {\n // --- Note ---\n // We want to keep the list in ascending order\n uniqueValues.forEach((timestamp) => {\n Utilities.insertInOrderedListMutably({\n list: this.timestampList,\n element: timestamp,\n order: Order.Ascending,\n });\n });\n } else {\n this.timestampList = [...uniqueValues];\n }\n }\n\n /**\n * @private\n * @method _updateFromVisit - an internal method for updating a list of page view data from a visit\n * @param {VisitType} visit - a visit\n * @param {Map<string, PageView>} dataMap - a map of page view data where we collect data\n * */\n public static _updateFromVisit(\n visit: VisitType,\n dataMap: Map<string, PageView>,\n ): void {\n const pageEvents = visit.pageEvents;\n\n if (pageEvents) {\n for (const pageEvent of pageEvents) {\n let referrers: number[] = [];\n\n const { time } = pageEvent;\n const { href, title, referrersIndices } = pageEvent.data;\n\n if (typeof referrersIndices[0] === 'number') {\n referrers = referrersIndices as number[];\n }\n\n let pageView: PageView;\n\n if (dataMap.has(href)) {\n const existingTimestamps = dataMap.get(href)!.timestamps;\n\n pageView = new PageView({\n urlAddress: href,\n title,\n referrers,\n });\n\n pageView.timestamps = [...existingTimestamps, time];\n } else {\n pageView = new PageView({\n urlAddress: href,\n title,\n referrers,\n });\n\n pageView.timestamps = [time];\n }\n\n // --- Note ---\n // We don't want to track collected pages again\n pageView.isSent = true;\n dataMap.set(href, pageView);\n }\n }\n }\n}\n"],"mappings":"yuBAcO,KAAM,CAAAA,QAAmC,CAY9CC,WAAWA,CAAAC,CAAA,CAA2D,IAA1D,CAAEC,UAAU,CAAVA,CAAU,CAAEC,KAAK,CAALA,CAAK,CAAEC,SAAS,CAATA,CAAkC,CAAC,CAAAH,CAAA,CAAAI,eAAA,2BAAAA,eAAA,sBAAAA,eAAA,0BAAAA,eAAA,qBAAAA,eAAA,sBALlC,EAAE,EAMlC,IAAI,CAACH,UAAU,CAAGA,CAAU,CAC5B,IAAI,CAACC,KAAK,CAAGA,CAAK,CAClB,IAAI,CAACC,SAAS,CAAGA,CAAS,CAC1B,IAAI,CAACE,IAAI,GACX,CAEA,GAAI,CAAAC,GAAGA,CAAA,CAAW,KAAAN,CAAA,CAIhB,GAAI,CAAC,IAAI,CAACC,UAAU,CAClB,MAAO,EAAE,CACV,KAEK,CAAAM,CAAc,CAAG,IAAI,CAACL,KAAK,CAC7BM,uBAAY,CAACC,KAAK,CAAGC,kBAAkB,CAAC,IAAI,CAACR,KAAK,CAAC,CACnD,EAAE,CAEAS,CAAkB,CAAG,QAAAX,CAAA,KAAI,CAACG,SAAS,YAAAH,CAAA,EAAdA,CAAA,CAAgBY,MAAM,CAC7CJ,uBAAY,CAACK,gBAAgB,CAAGC,IAAI,CAACC,SAAS,CAAC,IAAI,CAACZ,SAAS,CAAC,CAC9D,EAAE,CAEN,MACE,CAAAa,uBAAY,CAACC,IAAI,CACjBT,uBAAY,CAACU,IAAI,C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,KAEvB,CAAEuC,IAAI,CAAJA,CAAK,CAAC,CAAGD,CAAS,CACpB,CAAEE,IAAI,CAAJA,CAAI,CAAEzC,KAAK,CAALA,CAAK,CAAE0C,gBAAgB,CAAhBA,CAAiB,CAAC,CAAGH,CAAS,CAACtB,IAAI,CAErB,QAAQ,EAAvC,MAAO,CAAAyB,CAAgB,CAAC,CAAC,CAAc,GACzCzC,CAAS,CAAGyC,CAA4B,EAG1C,GAAI,CAAAC,CAAkB,CAEtB,GAAIN,CAAO,CAACO,GAAG,CAACH,CAAI,CAAC,CAAE,CACrB,KAAM,CAAAI,CAAkB,CAAGR,CAAO,CAACS,GAAG,CAACL,CAAI,CAAC,CAAErB,UAAU,CAExDuB,CAAQ,CAAG,GAAI,CAAA/C,QAAQ,CAAC,CACtBG,UAAU,CAAE0C,CAAI,CAChBzC,KAAK,CAALA,CAAK,CACLC,SAAS,CAATA,CACF,CAAC,CAAC,CAEF0C,CAAQ,CAACvB,UAAU,CAAG,CAAC,GAAGyB,CAAkB,CAAEL,CAAI,CACpD,CAAC,IACC,CAAAG,CAAQ,CAAG,GAAI,CAAA/C,QAAQ,CAAC,CACtBG,UAAU,CAAE0C,CAAI,CAChBzC,KAAK,CAALA,CAAK,CACLC,SAAS,CAATA,CACF,CAAC,CAAC,CAEF0C,CAAQ,CAACvB,UAAU,CAAG,CAACoB,CAAI,CAAC,CAK9BG,CAAQ,CAACrB,MAAM,GAAO,CACtBe,CAAO,CAACU,GAAG,CAACN,CAAI,CAAEE,CAAQ,CAC5B,CAEJ,CACF,CAACK,OAAA,CAAApD,QAAA,CAAAA,QAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TargetingDataType } from '../targeting';
|
|
2
|
-
import { IStorage } from '../storage';
|
|
3
|
-
import { Browser, Conversion, Cookie, CustomData, Device, GeolocationData, OperatingSystem, PageView, UserAgent, ApplicationVersion, VisitsData } from '../kameleoonData';
|
|
1
|
+
import { DereferencedTargetingDataType, TargetingDataType } from '../targeting';
|
|
2
|
+
import { FeatureFlagVariationsType, IStorage } from '../storage';
|
|
3
|
+
import { Browser, Conversion, Cookie, CustomData, Device, GeolocationData, OperatingSystem, PageView, UserAgent, ApplicationVersion, VisitsData, KameleoonConversionScore } from '../kameleoonData';
|
|
4
4
|
export type UnsentVisitorTargetingDataType = Map<KameleoonData | number, KameleoonDataType | KameleoonDataType[]>;
|
|
5
5
|
export type UnsentTargetingDataType = {
|
|
6
6
|
[visitorCode: string]: UnsentVisitorTargetingDataType | undefined;
|
|
@@ -9,41 +9,54 @@ export type FieldParametersType = {
|
|
|
9
9
|
visitorCode: string;
|
|
10
10
|
key: KameleoonData;
|
|
11
11
|
value: BrowserDataType | CookieDataType | DeviceDataType | GeolocationDataType | OperatingSystemDataType | UserAgentDataType | VisitsDataType;
|
|
12
|
-
data:
|
|
12
|
+
data: DereferencedTargetingDataType;
|
|
13
13
|
};
|
|
14
14
|
export type ArrayFieldParametersType = {
|
|
15
15
|
visitorCode: string;
|
|
16
16
|
key: KameleoonData;
|
|
17
17
|
value: ConversionDataType;
|
|
18
|
-
data:
|
|
18
|
+
data: DereferencedTargetingDataType;
|
|
19
19
|
};
|
|
20
20
|
export type NestedFieldParametersType = {
|
|
21
21
|
visitorCode: string;
|
|
22
22
|
key: KameleoonData.CustomData | KameleoonData.PageView;
|
|
23
23
|
nestedKey: string;
|
|
24
24
|
value: CustomDataType | PageViewDataType;
|
|
25
|
-
data:
|
|
25
|
+
data: DereferencedTargetingDataType;
|
|
26
|
+
};
|
|
27
|
+
export type DereferenceTargetingDataResultType = {
|
|
28
|
+
data: KameleoonVisitorDataType;
|
|
29
|
+
visitorReference: string;
|
|
26
30
|
};
|
|
27
31
|
export type DataManagerParametersType = {
|
|
28
32
|
targetingCleanupInterval?: number;
|
|
29
33
|
storage: IStorage<TargetingDataType>;
|
|
30
34
|
};
|
|
31
|
-
export type KameleoonDataItemType = BrowserDataType | ConversionDataType | CustomDataType | DeviceDataType | PageViewDataType | UserAgentDataType | CookieDataType | GeolocationDataType | OperatingSystemDataType | ApplicationVersionDataType | VisitsDataType;
|
|
35
|
+
export type KameleoonDataItemType = BrowserDataType | ConversionDataType | CustomDataType | DeviceDataType | PageViewDataType | UserAgentDataType | CookieDataType | GeolocationDataType | OperatingSystemDataType | ApplicationVersionDataType | KCSDataType | VisitsDataType;
|
|
32
36
|
/**
|
|
33
37
|
* @interface an interface of KameleoonData
|
|
34
38
|
* each class instance will have url getter method
|
|
35
39
|
* for handling url of different data types
|
|
36
40
|
* */
|
|
37
41
|
export interface IKameleoonData {
|
|
42
|
+
/**
|
|
43
|
+
* @property url - url for the current data type used for events tracking
|
|
44
|
+
* */
|
|
38
45
|
readonly url: string;
|
|
46
|
+
/**
|
|
47
|
+
* @property data - data of the current class instance
|
|
48
|
+
* */
|
|
39
49
|
readonly data: KameleoonDataItemType;
|
|
50
|
+
/**
|
|
51
|
+
* @property isSent - signifying if the data was sent already tracked
|
|
52
|
+
* */
|
|
40
53
|
isSent: boolean;
|
|
41
54
|
}
|
|
42
55
|
/**
|
|
43
56
|
* @type a tuple of each possible type of data for `addData` method
|
|
44
57
|
* of KameleoonClient
|
|
45
58
|
* */
|
|
46
|
-
export type KameleoonDataType = Browser | Conversion | CustomData | Device | PageView | UserAgent | VisitsData | GeolocationData | OperatingSystem | Cookie | ApplicationVersion;
|
|
59
|
+
export type KameleoonDataType = Browser | Conversion | CustomData | Device | PageView | UserAgent | VisitsData | GeolocationData | OperatingSystem | Cookie | ApplicationVersion | KameleoonConversionScore;
|
|
47
60
|
export type ActivityTimePropertyType = {
|
|
48
61
|
lastActivityTime: number;
|
|
49
62
|
};
|
|
@@ -67,6 +80,7 @@ export type KameleoonVisitorDataType<T = ActivityTimePropertyType> = {
|
|
|
67
80
|
[KameleoonData.Browser]?: BrowserDataType & T;
|
|
68
81
|
[KameleoonData.Device]?: DeviceDataType & T;
|
|
69
82
|
[KameleoonData.Cookie]?: CookieDataType & T;
|
|
83
|
+
[KameleoonData.KameleoonConversionScore]?: KCSDataType & T;
|
|
70
84
|
[KameleoonData.OperatingSystem]?: OperatingSystemDataType & T;
|
|
71
85
|
[KameleoonData.ApplicationVersion]?: ApplicationVersionDataType & T;
|
|
72
86
|
[KameleoonData.VisitsData]?: VisitsDataType & T;
|
|
@@ -82,7 +96,8 @@ export declare enum KameleoonData {
|
|
|
82
96
|
OperatingSystem = "operatingSystem",
|
|
83
97
|
UserAgent = "userAgent",
|
|
84
98
|
ApplicationVersion = "applicationVersion",
|
|
85
|
-
VisitsData = "visitsData"
|
|
99
|
+
VisitsData = "visitsData",
|
|
100
|
+
KameleoonConversionScore = "kameleoonConversionScore"
|
|
86
101
|
}
|
|
87
102
|
type SharedDataPropertiesType = {
|
|
88
103
|
type: KameleoonData;
|
|
@@ -105,9 +120,11 @@ export type CustomDataType = {
|
|
|
105
120
|
export type DeviceDataType = {
|
|
106
121
|
device: DeviceType;
|
|
107
122
|
} & SharedDataPropertiesType;
|
|
123
|
+
export type KCSDataType = {
|
|
124
|
+
kcs: KCSType;
|
|
125
|
+
} & SharedDataPropertiesType;
|
|
108
126
|
export type VisitsDataType = {
|
|
109
|
-
|
|
110
|
-
currentVisit: number | null;
|
|
127
|
+
visits: number[];
|
|
111
128
|
} & SharedDataPropertiesType;
|
|
112
129
|
export type OperatingSystemDataType = {
|
|
113
130
|
operatingSystem: OperatingSystemType;
|
|
@@ -191,6 +208,14 @@ export type CookieType = {
|
|
|
191
208
|
key: string;
|
|
192
209
|
value: string;
|
|
193
210
|
};
|
|
211
|
+
/**
|
|
212
|
+
* @type Nested object of key moments and goals with their respective scores
|
|
213
|
+
* */
|
|
214
|
+
export type KCSType = {
|
|
215
|
+
[keyMoment: string]: {
|
|
216
|
+
[goalId: string]: number;
|
|
217
|
+
};
|
|
218
|
+
};
|
|
194
219
|
export type OptionalCookieType = Omit<CookieType, 'key'> & {
|
|
195
220
|
key?: string;
|
|
196
221
|
};
|
|
@@ -224,4 +249,22 @@ export declare const BrowserIndexMap: {
|
|
|
224
249
|
readonly OTHER: 5;
|
|
225
250
|
};
|
|
226
251
|
export declare const BrowserTypeMap: Record<number, BrowserType>;
|
|
252
|
+
export type SingleDataType = {
|
|
253
|
+
[KameleoonData.Device]: Device | null;
|
|
254
|
+
[KameleoonData.Browser]: Browser | null;
|
|
255
|
+
[KameleoonData.GeolocationData]: GeolocationData | null;
|
|
256
|
+
[KameleoonData.OperatingSystem]: OperatingSystem | null;
|
|
257
|
+
[KameleoonData.KameleoonConversionScore]: KameleoonConversionScore | null;
|
|
258
|
+
};
|
|
259
|
+
export type MultipleDataType = {
|
|
260
|
+
[KameleoonData.CustomData]: Map<number, CustomData>;
|
|
261
|
+
[KameleoonData.PageView]: Map<string, PageView>;
|
|
262
|
+
[KameleoonData.Conversion]: Map<number, Conversion>;
|
|
263
|
+
};
|
|
264
|
+
export type VisitProcessorDataType = {
|
|
265
|
+
visitorData: KameleoonDataType[];
|
|
266
|
+
storageVisitorData: KameleoonDataType[];
|
|
267
|
+
visitsData: VisitsData;
|
|
268
|
+
experimentData: FeatureFlagVariationsType;
|
|
269
|
+
};
|
|
227
270
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var _helpers=require("./helpers");Object.defineProperty(exports,"__esModule",{value:!0}),exports.OperatingSystemTypeMap=exports.OperatingSystemType=exports.OperatingSystemIndexMap=exports.KameleoonData=exports.DeviceType=exports.BrowserTypeMap=exports.BrowserType=exports.BrowserIndexMap=void 0;let KameleoonData=exports.KameleoonData=function(a){return a.CustomData="customData",a.PageView="pageView",a.GeolocationData="geolocation",a.Browser="browser",a.Conversion="conversion",a.Cookie="cookie",a.Device="device",a.OperatingSystem="operatingSystem",a.UserAgent="userAgent",a.ApplicationVersion="applicationVersion",a.VisitsData="visitsData",a}({}),DeviceType=exports.DeviceType=function(a){return a.Phone="PHONE",a.Tablet="TABLET",a.Desktop="DESKTOP",a}({}),OperatingSystemType=exports.OperatingSystemType=function(a){return a.WindowsPhone="WINDOWS_PHONE",a.Windows="WINDOWS",a.Android="ANDROID",a.Linux="LINUX",a.Mac="MAC",a.IOS="IOS",a}({}),BrowserType=exports.BrowserType=function(a){return a.Chrome="CHROME",a.InternetExplorer="IE",a.Firefox="FIREFOX",a.Safari="SAFARI",a.Opera="OPERA",a.Other="OTHER",a}({});const OperatingSystemIndexMap=exports.OperatingSystemIndexMap={[OperatingSystemType.Windows]:0,[OperatingSystemType.Mac]:1,[OperatingSystemType.IOS]:2,[OperatingSystemType.Linux]:3,[OperatingSystemType.Android]:4,[OperatingSystemType.WindowsPhone]:5},OperatingSystemTypeMap=exports.OperatingSystemTypeMap=(0,_helpers.constructTypeMap)(OperatingSystemIndexMap),BrowserIndexMap=exports.BrowserIndexMap={[BrowserType.Chrome]:0,[BrowserType.InternetExplorer]:1,[BrowserType.Firefox]:2,[BrowserType.Safari]:3,[BrowserType.Opera]:4,[BrowserType.Other]:5},BrowserTypeMap=exports.BrowserTypeMap=(0,_helpers.constructTypeMap)(BrowserIndexMap);
|
|
1
|
+
"use strict";var _helpers=require("./helpers");Object.defineProperty(exports,"__esModule",{value:!0}),exports.OperatingSystemTypeMap=exports.OperatingSystemType=exports.OperatingSystemIndexMap=exports.KameleoonData=exports.DeviceType=exports.BrowserTypeMap=exports.BrowserType=exports.BrowserIndexMap=void 0;let KameleoonData=exports.KameleoonData=function(a){return a.CustomData="customData",a.PageView="pageView",a.GeolocationData="geolocation",a.Browser="browser",a.Conversion="conversion",a.Cookie="cookie",a.Device="device",a.OperatingSystem="operatingSystem",a.UserAgent="userAgent",a.ApplicationVersion="applicationVersion",a.VisitsData="visitsData",a.KameleoonConversionScore="kameleoonConversionScore",a}({}),DeviceType=exports.DeviceType=function(a){return a.Phone="PHONE",a.Tablet="TABLET",a.Desktop="DESKTOP",a}({}),OperatingSystemType=exports.OperatingSystemType=function(a){return a.WindowsPhone="WINDOWS_PHONE",a.Windows="WINDOWS",a.Android="ANDROID",a.Linux="LINUX",a.Mac="MAC",a.IOS="IOS",a}({}),BrowserType=exports.BrowserType=function(a){return a.Chrome="CHROME",a.InternetExplorer="IE",a.Firefox="FIREFOX",a.Safari="SAFARI",a.Opera="OPERA",a.Other="OTHER",a}({});const OperatingSystemIndexMap=exports.OperatingSystemIndexMap={[OperatingSystemType.Windows]:0,[OperatingSystemType.Mac]:1,[OperatingSystemType.IOS]:2,[OperatingSystemType.Linux]:3,[OperatingSystemType.Android]:4,[OperatingSystemType.WindowsPhone]:5},OperatingSystemTypeMap=exports.OperatingSystemTypeMap=(0,_helpers.constructTypeMap)(OperatingSystemIndexMap),BrowserIndexMap=exports.BrowserIndexMap={[BrowserType.Chrome]:0,[BrowserType.InternetExplorer]:1,[BrowserType.Firefox]:2,[BrowserType.Safari]:3,[BrowserType.Opera]:4,[BrowserType.Other]:5},BrowserTypeMap=exports.BrowserTypeMap=(0,_helpers.constructTypeMap)(BrowserIndexMap);
|
|
2
2
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["_helpers","require","Object","defineProperty","exports","value","OperatingSystemTypeMap","OperatingSystemType","OperatingSystemIndexMap","KameleoonData","DeviceType","BrowserTypeMap","BrowserType","BrowserIndexMap","CustomData","PageView","GeolocationData","Browser","Conversion","Cookie","Device","OperatingSystem","UserAgent","ApplicationVersion","VisitsData","Phone","Tablet","Desktop","WindowsPhone","Windows","Android","Linux","Mac","IOS","Chrome","InternetExplorer","Firefox","Safari","Opera","Other","constructTypeMap"],"sources":["../../src/kameleoonData/types.ts"],"sourcesContent":["import { TargetingDataType } from 'src/targeting';\nimport { IStorage } from 'src/storage';\nimport {\n Browser,\n Conversion,\n Cookie,\n CustomData,\n Device,\n GeolocationData,\n OperatingSystem,\n PageView,\n UserAgent,\n ApplicationVersion,\n VisitsData,\n} from 'src/kameleoonData';\nimport { constructTypeMap } from './helpers';\n\n// --- Note ---\n// -- `Conversion`s are stored by `KameleoonData.Conversion` key in a form of an `KameleoonDataType[]` array\n// -- `PageView`s are store by `timestamp` (number) key in a form of `KameleoonDataType`\n// -- All the other unsent data types are stored in a form of `KameleoonData` key and `KameleoonDataType` value\nexport type UnsentVisitorTargetingDataType = Map<\n KameleoonData | number,\n KameleoonDataType | KameleoonDataType[]\n>;\n\nexport type UnsentTargetingDataType = {\n [visitorCode: string]: UnsentVisitorTargetingDataType | undefined;\n};\n\nexport type FieldParametersType = {\n visitorCode: string;\n key: KameleoonData;\n value:\n | BrowserDataType\n | CookieDataType\n | DeviceDataType\n | GeolocationDataType\n | OperatingSystemDataType\n | UserAgentDataType\n | VisitsDataType;\n data: TargetingDataType;\n};\n\nexport type ArrayFieldParametersType = {\n visitorCode: string;\n key: KameleoonData;\n value: ConversionDataType;\n data: TargetingDataType;\n};\nexport type NestedFieldParametersType = {\n visitorCode: string;\n key: KameleoonData.CustomData | KameleoonData.PageView;\n nestedKey: string;\n value: CustomDataType | PageViewDataType;\n data: TargetingDataType;\n};\n\nexport type DataManagerParametersType = {\n targetingCleanupInterval?: number;\n storage: IStorage<TargetingDataType>;\n};\n\nexport type KameleoonDataItemType =\n | BrowserDataType\n | ConversionDataType\n | CustomDataType\n | DeviceDataType\n | PageViewDataType\n | UserAgentDataType\n | CookieDataType\n | GeolocationDataType\n | OperatingSystemDataType\n | ApplicationVersionDataType\n | VisitsDataType;\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 isSent: boolean;\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 | VisitsData\n | GeolocationData\n | OperatingSystem\n | Cookie\n | ApplicationVersion;\n\nexport type ActivityTimePropertyType = {\n lastActivityTime: number;\n};\n\nexport type ExistingCustomDataType = NonNullable<\n KameleoonVisitorDataType[KameleoonData.CustomData]\n>;\n\nexport type ExistingPageViewDataType = NonNullable<\n KameleoonVisitorDataType[KameleoonData.PageView]\n>;\n\nexport type ExistingNestedDataType =\n | ExistingCustomDataType\n | ExistingPageViewDataType;\n\nexport type ExistingArrayDataType = ExistingConversionDataType;\n\nexport type ExistingConversionDataType = NonNullable<\n KameleoonVisitorDataType[KameleoonData.Conversion]\n>;\n\nexport type ExistingVisitsDataType = NonNullable<\n KameleoonVisitorDataType[KameleoonData.VisitsData]\n>;\n\nexport type ExistingDataType<T extends KameleoonData> = NonNullable<\n KameleoonVisitorDataType[T]\n>;\n\nexport type KameleoonVisitorDataType<T = ActivityTimePropertyType> = {\n [KameleoonData.CustomData]?: {\n [index: string]: (CustomDataType & T) | undefined;\n };\n [KameleoonData.Conversion]?: (ConversionDataType & T)[];\n [KameleoonData.GeolocationData]?: GeolocationDataType & T;\n [KameleoonData.UserAgent]?: UserAgentDataType & T;\n [KameleoonData.PageView]?: { [url: string]: PageViewDataType & T };\n [KameleoonData.Browser]?: BrowserDataType & T;\n [KameleoonData.Device]?: DeviceDataType & T;\n [KameleoonData.Cookie]?: CookieDataType & T;\n [KameleoonData.OperatingSystem]?: OperatingSystemDataType & T;\n [KameleoonData.ApplicationVersion]?: ApplicationVersionDataType & T;\n [KameleoonData.VisitsData]?: VisitsDataType & T;\n};\n\nexport enum KameleoonData {\n CustomData = 'customData',\n PageView = 'pageView',\n GeolocationData = 'geolocation',\n Browser = 'browser',\n Conversion = 'conversion',\n Cookie = 'cookie',\n Device = 'device',\n OperatingSystem = 'operatingSystem',\n UserAgent = 'userAgent',\n ApplicationVersion = 'applicationVersion',\n VisitsData = 'visitsData',\n}\n\ntype SharedDataPropertiesType = {\n type: KameleoonData;\n sent: boolean;\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[];\n isIdentifier: boolean;\n} & SharedDataPropertiesType;\n\nexport type DeviceDataType = {\n device: DeviceType;\n} & SharedDataPropertiesType;\n\nexport type VisitsDataType = {\n previousVisits: number[];\n currentVisit: number | null;\n} & SharedDataPropertiesType;\n\nexport type OperatingSystemDataType = {\n operatingSystem: OperatingSystemType;\n} & SharedDataPropertiesType;\n\nexport type CookieDataType = {\n cookie: CookieType[];\n} & SharedDataPropertiesType;\n\nexport type GeolocationDataType = GeolocationInfoType &\n SharedDataPropertiesType;\n\nexport type PageViewDataType = {\n urlAddress: string;\n title: string;\n referrers?: number[];\n timestamps: number[];\n} & SharedDataPropertiesType;\n\nexport type UserAgentDataType = {\n value: string;\n} & SharedDataPropertiesType;\n\nexport type ApplicationVersionDataType = {\n version: 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 operating system type\n * */\nexport enum OperatingSystemType {\n WindowsPhone = 'WINDOWS_PHONE',\n Windows = 'WINDOWS',\n Android = 'ANDROID',\n Linux = 'LINUX',\n Mac = 'MAC',\n IOS = 'IOS',\n}\n\n/**\n * @param {string} country - a country of a visitor\n * @param {string | undefined} region - an optional parameter containing a region of a visitor, has no default value\n * @param {string | undefined} city - an optional parameter containing a city of a visitor, has no default value\n * @param {string | undefined} postalCode - an optional parameter containing a postal code of a visitor, has no default value\n * @param {[number, number] | undefined} coordinates - an optional parameter containing a pair of coordinates (longitude and latitude) of a visitor, has no default value. Coordinate `number` represents decimal degrees (double that can be negative)\n * */\nexport type GeolocationInfoType = {\n country: string;\n region?: string;\n city?: string;\n postalCode?: string;\n coordinates?: [number, number];\n};\n\n/**\n * @param {string} key - a key of a cookie\n * @param {string} value - a value of a cookie\n * */\nexport type CookieType = {\n key: string;\n value: string;\n};\n\nexport type OptionalCookieType = Omit<CookieType, 'key'> & {\n key?: string;\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 OperatingSystemIndexMap = {\n [OperatingSystemType.Windows]: 0,\n [OperatingSystemType.Mac]: 1,\n [OperatingSystemType.IOS]: 2,\n [OperatingSystemType.Linux]: 3,\n [OperatingSystemType.Android]: 4,\n [OperatingSystemType.WindowsPhone]: 5,\n} as const;\n\nexport const OperatingSystemTypeMap = constructTypeMap<OperatingSystemType>(\n OperatingSystemIndexMap,\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\nexport const BrowserTypeMap = constructTypeMap<BrowserType>(BrowserIndexMap);\n"],"mappings":"aAeA,IAAAA,QAAA,CAAAC,OAAA,cAA6CC,MAAA,CAAAC,cAAA,CAAAC,OAAA,eAAAC,KAAA,MAAAD,OAAA,CAAAE,sBAAA,CAAAF,OAAA,CAAAG,mBAAA,CAAAH,OAAA,CAAAI,uBAAA,CAAAJ,OAAA,CAAAK,aAAA,CAAAL,OAAA,CAAAM,UAAA,CAAAN,OAAA,CAAAO,cAAA,CAA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AACyB,GAAG,EAAG,CAAC,CAC5B,CAACzB,mBAAmB,CAAC0B,GAAG,EAAG,CAAC,CAC5B,CAAC1B,mBAAmB,CAACwB,KAAK,EAAG,CAAC,CAC9B,CAACxB,mBAAmB,CAACuB,OAAO,EAAG,CAAC,CAChC,CAACvB,mBAAmB,CAACqB,YAAY,EAAG,CACtC,CAAU,CAEGtB,sBAAsB,CAAAF,OAAA,CAAAE,sBAAA,CAAG,GAAAkC,yBAAgB,EACpDhC,uBACF,CAAC,CAEYK,eAAe,CAAAT,OAAA,CAAAS,eAAA,CAAG,CAC7B,CAACD,WAAW,CAACsB,MAAM,EAAG,CAAC,CACvB,CAACtB,WAAW,CAACuB,gBAAgB,EAAG,CAAC,CACjC,CAACvB,WAAW,CAACwB,OAAO,EAAG,CAAC,CACxB,CAACxB,WAAW,CAACyB,MAAM,EAAG,CAAC,CACvB,CAACzB,WAAW,CAAC0B,KAAK,EAAG,CAAC,CACtB,CAAC1B,WAAW,CAAC2B,KAAK,EAAG,CACvB,CAAU,CAEG5B,cAAc,CAAAP,OAAA,CAAAO,cAAA,CAAG,GAAA6B,yBAAgB,EAAc3B,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.js","names":["_helpers","require","Object","defineProperty","exports","value","OperatingSystemTypeMap","OperatingSystemType","OperatingSystemIndexMap","KameleoonData","DeviceType","BrowserTypeMap","BrowserType","BrowserIndexMap","CustomData","PageView","GeolocationData","Browser","Conversion","Cookie","Device","OperatingSystem","UserAgent","ApplicationVersion","VisitsData","KameleoonConversionScore","Phone","Tablet","Desktop","WindowsPhone","Windows","Android","Linux","Mac","IOS","Chrome","InternetExplorer","Firefox","Safari","Opera","Other","constructTypeMap"],"sources":["../../src/kameleoonData/types.ts"],"sourcesContent":["import {\n DereferencedTargetingDataType,\n TargetingDataType,\n} from 'src/targeting';\nimport { FeatureFlagVariationsType, IStorage } from 'src/storage';\nimport {\n Browser,\n Conversion,\n Cookie,\n CustomData,\n Device,\n GeolocationData,\n OperatingSystem,\n PageView,\n UserAgent,\n ApplicationVersion,\n VisitsData,\n KameleoonConversionScore,\n} from 'src/kameleoonData';\nimport { constructTypeMap } from './helpers';\n\n// --- Note ---\n// -- `Conversion`s are stored by `KameleoonData.Conversion` key in a form of an `KameleoonDataType[]` array\n// -- `PageView`s are store by `timestamp` (number) key in a form of `KameleoonDataType`\n// -- All the other unsent data types are stored in a form of `KameleoonData` key and `KameleoonDataType` value\nexport type UnsentVisitorTargetingDataType = Map<\n KameleoonData | number,\n KameleoonDataType | KameleoonDataType[]\n>;\n\nexport type UnsentTargetingDataType = {\n [visitorCode: string]: UnsentVisitorTargetingDataType | undefined;\n};\n\nexport type FieldParametersType = {\n visitorCode: string;\n key: KameleoonData;\n value:\n | BrowserDataType\n | CookieDataType\n | DeviceDataType\n | GeolocationDataType\n | OperatingSystemDataType\n | UserAgentDataType\n | VisitsDataType;\n data: DereferencedTargetingDataType;\n};\n\nexport type ArrayFieldParametersType = {\n visitorCode: string;\n key: KameleoonData;\n value: ConversionDataType;\n data: DereferencedTargetingDataType;\n};\n\nexport type NestedFieldParametersType = {\n visitorCode: string;\n key: KameleoonData.CustomData | KameleoonData.PageView;\n nestedKey: string;\n value: CustomDataType | PageViewDataType;\n data: DereferencedTargetingDataType;\n};\n\nexport type DereferenceTargetingDataResultType = {\n data: KameleoonVisitorDataType;\n visitorReference: string;\n};\n\nexport type DataManagerParametersType = {\n targetingCleanupInterval?: number;\n storage: IStorage<TargetingDataType>;\n};\n\nexport type KameleoonDataItemType =\n | BrowserDataType\n | ConversionDataType\n | CustomDataType\n | DeviceDataType\n | PageViewDataType\n | UserAgentDataType\n | CookieDataType\n | GeolocationDataType\n | OperatingSystemDataType\n | ApplicationVersionDataType\n | KCSDataType\n | VisitsDataType;\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 /**\n * @property url - url for the current data type used for events tracking\n * */\n readonly url: string;\n /**\n * @property data - data of the current class instance\n * */\n readonly data: KameleoonDataItemType;\n /**\n * @property isSent - signifying if the data was sent already tracked\n * */\n isSent: boolean;\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 | VisitsData\n | GeolocationData\n | OperatingSystem\n | Cookie\n | ApplicationVersion\n | KameleoonConversionScore;\n\nexport type ActivityTimePropertyType = {\n lastActivityTime: number;\n};\n\nexport type ExistingCustomDataType = NonNullable<\n KameleoonVisitorDataType[KameleoonData.CustomData]\n>;\n\nexport type ExistingPageViewDataType = NonNullable<\n KameleoonVisitorDataType[KameleoonData.PageView]\n>;\n\nexport type ExistingNestedDataType =\n | ExistingCustomDataType\n | ExistingPageViewDataType;\n\nexport type ExistingArrayDataType = ExistingConversionDataType;\n\nexport type ExistingConversionDataType = NonNullable<\n KameleoonVisitorDataType[KameleoonData.Conversion]\n>;\n\nexport type ExistingVisitsDataType = NonNullable<\n KameleoonVisitorDataType[KameleoonData.VisitsData]\n>;\n\nexport type ExistingDataType<T extends KameleoonData> = NonNullable<\n KameleoonVisitorDataType[T]\n>;\n\nexport type KameleoonVisitorDataType<T = ActivityTimePropertyType> = {\n [KameleoonData.CustomData]?: {\n [index: string]: (CustomDataType & T) | undefined;\n };\n [KameleoonData.Conversion]?: (ConversionDataType & T)[];\n [KameleoonData.GeolocationData]?: GeolocationDataType & T;\n [KameleoonData.UserAgent]?: UserAgentDataType & T;\n [KameleoonData.PageView]?: { [url: string]: PageViewDataType & T };\n [KameleoonData.Browser]?: BrowserDataType & T;\n [KameleoonData.Device]?: DeviceDataType & T;\n [KameleoonData.Cookie]?: CookieDataType & T;\n [KameleoonData.KameleoonConversionScore]?: KCSDataType & T;\n [KameleoonData.OperatingSystem]?: OperatingSystemDataType & T;\n [KameleoonData.ApplicationVersion]?: ApplicationVersionDataType & T;\n [KameleoonData.VisitsData]?: VisitsDataType & T;\n};\n\nexport enum KameleoonData {\n CustomData = 'customData',\n PageView = 'pageView',\n GeolocationData = 'geolocation',\n Browser = 'browser',\n Conversion = 'conversion',\n Cookie = 'cookie',\n Device = 'device',\n OperatingSystem = 'operatingSystem',\n UserAgent = 'userAgent',\n ApplicationVersion = 'applicationVersion',\n VisitsData = 'visitsData',\n KameleoonConversionScore = 'kameleoonConversionScore',\n}\n\ntype SharedDataPropertiesType = {\n type: KameleoonData;\n sent: boolean;\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[];\n isIdentifier: boolean;\n} & SharedDataPropertiesType;\n\nexport type DeviceDataType = {\n device: DeviceType;\n} & SharedDataPropertiesType;\n\nexport type KCSDataType = {\n kcs: KCSType;\n} & SharedDataPropertiesType;\n\nexport type VisitsDataType = {\n visits: number[];\n} & SharedDataPropertiesType;\n\nexport type OperatingSystemDataType = {\n operatingSystem: OperatingSystemType;\n} & SharedDataPropertiesType;\n\nexport type CookieDataType = {\n cookie: CookieType[];\n} & SharedDataPropertiesType;\n\nexport type GeolocationDataType = GeolocationInfoType &\n SharedDataPropertiesType;\n\nexport type PageViewDataType = {\n urlAddress: string;\n title: string;\n referrers?: number[];\n timestamps: number[];\n} & SharedDataPropertiesType;\n\nexport type UserAgentDataType = {\n value: string;\n} & SharedDataPropertiesType;\n\nexport type ApplicationVersionDataType = {\n version: 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 operating system type\n * */\nexport enum OperatingSystemType {\n WindowsPhone = 'WINDOWS_PHONE',\n Windows = 'WINDOWS',\n Android = 'ANDROID',\n Linux = 'LINUX',\n Mac = 'MAC',\n IOS = 'IOS',\n}\n\n/**\n * @param {string} country - a country of a visitor\n * @param {string | undefined} region - an optional parameter containing a region of a visitor, has no default value\n * @param {string | undefined} city - an optional parameter containing a city of a visitor, has no default value\n * @param {string | undefined} postalCode - an optional parameter containing a postal code of a visitor, has no default value\n * @param {[number, number] | undefined} coordinates - an optional parameter containing a pair of coordinates (longitude and latitude) of a visitor, has no default value. Coordinate `number` represents decimal degrees (double that can be negative)\n * */\nexport type GeolocationInfoType = {\n country: string;\n region?: string;\n city?: string;\n postalCode?: string;\n coordinates?: [number, number];\n};\n\n/**\n * @param {string} key - a key of a cookie\n * @param {string} value - a value of a cookie\n * */\nexport type CookieType = {\n key: string;\n value: string;\n};\n\n/**\n * @type Nested object of key moments and goals with their respective scores\n * */\nexport type KCSType = {\n [keyMoment: string]: {\n [goalId: string]: number;\n };\n};\n\nexport type OptionalCookieType = Omit<CookieType, 'key'> & {\n key?: string;\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 OperatingSystemIndexMap = {\n [OperatingSystemType.Windows]: 0,\n [OperatingSystemType.Mac]: 1,\n [OperatingSystemType.IOS]: 2,\n [OperatingSystemType.Linux]: 3,\n [OperatingSystemType.Android]: 4,\n [OperatingSystemType.WindowsPhone]: 5,\n} as const;\n\nexport const OperatingSystemTypeMap = constructTypeMap<OperatingSystemType>(\n OperatingSystemIndexMap,\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\nexport const BrowserTypeMap = constructTypeMap<BrowserType>(BrowserIndexMap);\n\nexport type SingleDataType = {\n [KameleoonData.Device]: Device | null;\n [KameleoonData.Browser]: Browser | null;\n [KameleoonData.GeolocationData]: GeolocationData | null;\n [KameleoonData.OperatingSystem]: OperatingSystem | null;\n [KameleoonData.KameleoonConversionScore]: KameleoonConversionScore | null;\n};\n\nexport type MultipleDataType = {\n [KameleoonData.CustomData]: Map<number, CustomData>;\n [KameleoonData.PageView]: Map<string, PageView>;\n [KameleoonData.Conversion]: Map<number, Conversion>;\n};\n\nexport type VisitProcessorDataType = {\n visitorData: KameleoonDataType[];\n storageVisitorData: KameleoonDataType[];\n visitsData: VisitsData;\n experimentData: FeatureFlagVariationsType;\n};\n"],"mappings":"aAmBA,IAAAA,QAAA,CAAAC,OAAA,cAA6CC,MAAA,CAAAC,cAAA,CAAAC,OAAA,eAAAC,KAAA,MAAAD,OAAA,CAAAE,sBAAA,CAAAF,OAAA,CAAAG,mBAAA,CAAAH,OAAA,CAAAI,uBAAA,CAAAJ,OAAA,CAAAK,aAAA,CAAAL,OAAA,CAAAM,UAAA,CAAAN,OAAA,CAAAO,cAAA,CAAAP,OAAA,CAAAQ,WAAA,CAAAR,OAAA,CAAAS,eAAA,WAyJjC,CAAAJ,aAAa,CAAAL,OAAA,CAAAK,aAAA,UAAbA,CAAa,QAAb,CAAAA,CAAa,CAAAK,UAAA,cAAbL,CAAa,CAAAM,QAAA,YAAbN,CAAa,CAAAO,eAAA,eAAbP,CAAa,CAAAQ,OAAA,WAAbR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sB,YAAY,EAAG,CACtC,CAAU,CAEGvB,sBAAsB,CAAAF,OAAA,CAAAE,sBAAA,CAAG,GAAAmC,yBAAgB,EACpDjC,uBACF,CAAC,CAEYK,eAAe,CAAAT,OAAA,CAAAS,eAAA,CAAG,CAC7B,CAACD,WAAW,CAACuB,MAAM,EAAG,CAAC,CACvB,CAACvB,WAAW,CAACwB,gBAAgB,EAAG,CAAC,CACjC,CAACxB,WAAW,CAACyB,OAAO,EAAG,CAAC,CACxB,CAACzB,WAAW,CAAC0B,MAAM,EAAG,CAAC,CACvB,CAAC1B,WAAW,CAAC2B,KAAK,EAAG,CAAC,CACtB,CAAC3B,WAAW,CAAC4B,KAAK,EAAG,CACvB,CAAU,CAEG7B,cAAc,CAAAP,OAAA,CAAAO,cAAA,CAAG,GAAA8B,yBAAgB,EAAc5B,eAAe,CAAC"}
|
|
@@ -7,17 +7,8 @@ export declare class UserAgent implements IKameleoonData {
|
|
|
7
7
|
private value;
|
|
8
8
|
private sent;
|
|
9
9
|
constructor(value: string);
|
|
10
|
-
/**
|
|
11
|
-
* @property url - url for the current data type used for events tracking
|
|
12
|
-
* */
|
|
13
10
|
get url(): string;
|
|
14
|
-
/**
|
|
15
|
-
* @property data - data of the current class instance
|
|
16
|
-
* */
|
|
17
11
|
get data(): UserAgentDataType;
|
|
18
|
-
/**
|
|
19
|
-
* @property isSent - signifying if the data was sent already tracked
|
|
20
|
-
* */
|
|
21
12
|
get isSent(): boolean;
|
|
22
13
|
set isSent(value: boolean);
|
|
23
14
|
}
|