@kameleoon/javascript-sdk-core 2.10.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cacheManager/cacheManager.d.ts +38 -0
- package/dist/cacheManager/cacheManager.js +2 -0
- package/dist/cacheManager/cacheManager.js.map +1 -0
- package/dist/cacheManager/index.d.ts +2 -0
- package/dist/cacheManager/index.js +2 -0
- package/dist/cacheManager/index.js.map +1 -0
- package/dist/cacheManager/types.d.ts +14 -0
- package/dist/cacheManager/types.js +2 -0
- package/dist/cacheManager/types.js.map +1 -0
- package/dist/clientConfiguration/clientConfiguration.d.ts +52 -0
- package/dist/clientConfiguration/clientConfiguration.js +2 -0
- package/dist/clientConfiguration/clientConfiguration.js.map +1 -0
- package/dist/clientConfiguration/constants.d.ts +2 -0
- package/dist/clientConfiguration/constants.js +2 -0
- package/dist/clientConfiguration/constants.js.map +1 -0
- package/dist/clientConfiguration/index.d.ts +2 -0
- package/dist/clientConfiguration/index.js +2 -0
- package/dist/clientConfiguration/index.js.map +1 -0
- package/dist/clientConfiguration/types.d.ts +114 -0
- package/dist/clientConfiguration/types.js +2 -0
- package/dist/clientConfiguration/types.js.map +1 -0
- package/dist/clientSettings/clientSettings.d.ts +12 -0
- package/dist/clientSettings/clientSettings.js +2 -0
- package/dist/clientSettings/clientSettings.js.map +1 -0
- package/dist/clientSettings/index.d.ts +2 -0
- package/dist/clientSettings/index.js +2 -0
- package/dist/clientSettings/index.js.map +1 -0
- package/dist/clientSettings/types.d.ts +6 -0
- package/dist/clientSettings/types.js +2 -0
- package/dist/clientSettings/types.js.map +1 -0
- package/dist/constants.d.ts +34 -0
- package/dist/constants.js +2 -0
- package/dist/constants.js.map +1 -0
- package/dist/eventSource/constants.d.ts +1 -0
- package/dist/eventSource/constants.js +2 -0
- package/dist/eventSource/constants.js.map +1 -0
- package/dist/eventSource/externalEventSource.d.ts +12 -0
- package/dist/eventSource/externalEventSource.js +2 -0
- package/dist/eventSource/externalEventSource.js.map +1 -0
- package/dist/eventSource/index.d.ts +3 -0
- package/dist/eventSource/index.js +2 -0
- package/dist/eventSource/index.js.map +1 -0
- package/dist/eventSource/types.d.ts +47 -0
- package/dist/eventSource/types.js +2 -0
- package/dist/eventSource/types.js.map +1 -0
- package/dist/hasher/hasher.d.ts +5 -0
- package/dist/hasher/hasher.js +2 -0
- package/dist/hasher/hasher.js.map +1 -0
- package/dist/hasher/index.d.ts +1 -0
- package/dist/hasher/index.js +2 -0
- package/dist/hasher/index.js.map +1 -0
- package/dist/hasher/types.d.ts +5 -0
- package/dist/hasher/types.js +2 -0
- package/dist/hasher/types.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/kameleoonClient.d.ts +231 -0
- package/dist/kameleoonClient.js +2 -0
- package/dist/kameleoonClient.js.map +1 -0
- package/dist/kameleoonData/applicationVersion.d.ts +26 -0
- package/dist/kameleoonData/applicationVersion.js +2 -0
- package/dist/kameleoonData/applicationVersion.js.map +1 -0
- package/dist/kameleoonData/browser.d.ts +41 -0
- package/dist/kameleoonData/browser.js +2 -0
- package/dist/kameleoonData/browser.js.map +1 -0
- package/dist/kameleoonData/constants.d.ts +4 -0
- package/dist/kameleoonData/constants.js +2 -0
- package/dist/kameleoonData/constants.js.map +1 -0
- package/dist/kameleoonData/conversion.d.ts +36 -0
- package/dist/kameleoonData/conversion.js +2 -0
- package/dist/kameleoonData/conversion.js.map +1 -0
- package/dist/kameleoonData/cookie.d.ts +33 -0
- package/dist/kameleoonData/cookie.js +2 -0
- package/dist/kameleoonData/cookie.js.map +1 -0
- package/dist/kameleoonData/customData.d.ts +46 -0
- package/dist/kameleoonData/customData.js +2 -0
- package/dist/kameleoonData/customData.js.map +1 -0
- package/dist/kameleoonData/dataManager.d.ts +38 -0
- package/dist/kameleoonData/dataManager.js +2 -0
- package/dist/kameleoonData/dataManager.js.map +1 -0
- package/dist/kameleoonData/dataProcessor.d.ts +26 -0
- package/dist/kameleoonData/dataProcessor.js +2 -0
- package/dist/kameleoonData/dataProcessor.js.map +1 -0
- package/dist/kameleoonData/device.d.ts +34 -0
- package/dist/kameleoonData/device.js +2 -0
- package/dist/kameleoonData/device.js.map +1 -0
- package/dist/kameleoonData/geolocation.d.ts +52 -0
- package/dist/kameleoonData/geolocation.js +2 -0
- package/dist/kameleoonData/geolocation.js.map +1 -0
- package/dist/kameleoonData/helpers.d.ts +1 -0
- package/dist/kameleoonData/helpers.js +2 -0
- package/dist/kameleoonData/helpers.js.map +1 -0
- package/dist/kameleoonData/index.d.ts +14 -0
- package/dist/kameleoonData/index.js +2 -0
- package/dist/kameleoonData/index.js.map +1 -0
- package/dist/kameleoonData/operatingSystem.d.ts +34 -0
- package/dist/kameleoonData/operatingSystem.js +2 -0
- package/dist/kameleoonData/operatingSystem.js.map +1 -0
- package/dist/kameleoonData/pageView.d.ts +42 -0
- package/dist/kameleoonData/pageView.js +2 -0
- package/dist/kameleoonData/pageView.js.map +1 -0
- package/dist/kameleoonData/types.d.ts +226 -0
- package/dist/kameleoonData/types.js +2 -0
- package/dist/kameleoonData/types.js.map +1 -0
- package/dist/kameleoonData/userAgent.d.ts +23 -0
- package/dist/kameleoonData/userAgent.js +2 -0
- package/dist/kameleoonData/userAgent.js.map +1 -0
- package/dist/kameleoonData/visitsData.d.ts +34 -0
- package/dist/kameleoonData/visitsData.js +2 -0
- package/dist/kameleoonData/visitsData.js.map +1 -0
- package/dist/kameleoonError/constants.d.ts +28 -0
- package/dist/kameleoonError/constants.js +2 -0
- package/dist/kameleoonError/constants.js.map +1 -0
- package/dist/kameleoonError/helpers.d.ts +1 -0
- package/dist/kameleoonError/helpers.js +2 -0
- package/dist/kameleoonError/helpers.js.map +1 -0
- package/dist/kameleoonError/index.d.ts +3 -0
- package/dist/kameleoonError/index.js +2 -0
- package/dist/kameleoonError/index.js.map +1 -0
- package/dist/kameleoonError/kameleoonError.d.ts +26 -0
- package/dist/kameleoonError/kameleoonError.js +2 -0
- package/dist/kameleoonError/kameleoonError.js.map +1 -0
- package/dist/kameleoonError/types.d.ts +30 -0
- package/dist/kameleoonError/types.js +2 -0
- package/dist/kameleoonError/types.js.map +1 -0
- package/dist/kameleoonUtils.d.ts +13 -0
- package/dist/kameleoonUtils.js +2 -0
- package/dist/kameleoonUtils.js.map +1 -0
- package/dist/requester/constants.d.ts +18 -0
- package/dist/requester/constants.js +2 -0
- package/dist/requester/constants.js.map +1 -0
- package/dist/requester/index.d.ts +3 -0
- package/dist/requester/index.js +2 -0
- package/dist/requester/index.js.map +1 -0
- package/dist/requester/requester.d.ts +24 -0
- package/dist/requester/requester.js +2 -0
- package/dist/requester/requester.js.map +1 -0
- package/dist/requester/types.d.ts +165 -0
- package/dist/requester/types.js +2 -0
- package/dist/requester/types.js.map +1 -0
- package/dist/storage/constants.d.ts +11 -0
- package/dist/storage/constants.js +2 -0
- package/dist/storage/constants.js.map +1 -0
- package/dist/storage/index.d.ts +2 -0
- package/dist/storage/index.js +2 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/types.d.ts +65 -0
- package/dist/storage/types.js +2 -0
- package/dist/storage/types.js.map +1 -0
- package/dist/targeting/conditions/applicationVersion.d.ts +10 -0
- package/dist/targeting/conditions/applicationVersion.js +2 -0
- package/dist/targeting/conditions/applicationVersion.js.map +1 -0
- package/dist/targeting/conditions/browser.d.ts +13 -0
- package/dist/targeting/conditions/browser.js +2 -0
- package/dist/targeting/conditions/browser.js.map +1 -0
- package/dist/targeting/conditions/conditionFactory.d.ts +6 -0
- package/dist/targeting/conditions/conditionFactory.js +2 -0
- package/dist/targeting/conditions/conditionFactory.js.map +1 -0
- package/dist/targeting/conditions/conversion.d.ts +9 -0
- package/dist/targeting/conditions/conversion.js +2 -0
- package/dist/targeting/conditions/conversion.js.map +1 -0
- package/dist/targeting/conditions/cookie.d.ts +15 -0
- package/dist/targeting/conditions/cookie.js +2 -0
- package/dist/targeting/conditions/cookie.js.map +1 -0
- package/dist/targeting/conditions/customData.d.ts +14 -0
- package/dist/targeting/conditions/customData.js +2 -0
- package/dist/targeting/conditions/customData.js.map +1 -0
- package/dist/targeting/conditions/device.d.ts +9 -0
- package/dist/targeting/conditions/device.js +2 -0
- package/dist/targeting/conditions/device.js.map +1 -0
- package/dist/targeting/conditions/exclusiveCampaign.d.ts +7 -0
- package/dist/targeting/conditions/exclusiveCampaign.js +2 -0
- package/dist/targeting/conditions/exclusiveCampaign.js.map +1 -0
- package/dist/targeting/conditions/firstVisit.d.ts +12 -0
- package/dist/targeting/conditions/firstVisit.js +2 -0
- package/dist/targeting/conditions/firstVisit.js.map +1 -0
- package/dist/targeting/conditions/geolocation.d.ts +11 -0
- package/dist/targeting/conditions/geolocation.js +2 -0
- package/dist/targeting/conditions/geolocation.js.map +1 -0
- package/dist/targeting/conditions/index.d.ts +24 -0
- package/dist/targeting/conditions/index.js +2 -0
- package/dist/targeting/conditions/index.js.map +1 -0
- package/dist/targeting/conditions/lastVisit.d.ts +12 -0
- package/dist/targeting/conditions/lastVisit.js +2 -0
- package/dist/targeting/conditions/lastVisit.js.map +1 -0
- package/dist/targeting/conditions/newVisitor.d.ts +9 -0
- package/dist/targeting/conditions/newVisitor.js +2 -0
- package/dist/targeting/conditions/newVisitor.js.map +1 -0
- package/dist/targeting/conditions/operatingSystem.d.ts +9 -0
- package/dist/targeting/conditions/operatingSystem.js +2 -0
- package/dist/targeting/conditions/operatingSystem.js.map +1 -0
- package/dist/targeting/conditions/pageTitle.d.ts +11 -0
- package/dist/targeting/conditions/pageTitle.js +2 -0
- package/dist/targeting/conditions/pageTitle.js.map +1 -0
- package/dist/targeting/conditions/pageUrl.d.ts +11 -0
- package/dist/targeting/conditions/pageUrl.js +2 -0
- package/dist/targeting/conditions/pageUrl.js.map +1 -0
- package/dist/targeting/conditions/previousPage.d.ts +12 -0
- package/dist/targeting/conditions/previousPage.js +2 -0
- package/dist/targeting/conditions/previousPage.js.map +1 -0
- package/dist/targeting/conditions/sameDayVisits.d.ts +11 -0
- package/dist/targeting/conditions/sameDayVisits.js +2 -0
- package/dist/targeting/conditions/sameDayVisits.js.map +1 -0
- package/dist/targeting/conditions/sdkLanguage.d.ts +12 -0
- package/dist/targeting/conditions/sdkLanguage.js +2 -0
- package/dist/targeting/conditions/sdkLanguage.js.map +1 -0
- package/dist/targeting/conditions/segment.d.ts +9 -0
- package/dist/targeting/conditions/segment.js +2 -0
- package/dist/targeting/conditions/segment.js.map +1 -0
- package/dist/targeting/conditions/targetFeatureFlag.d.ts +11 -0
- package/dist/targeting/conditions/targetFeatureFlag.js +2 -0
- package/dist/targeting/conditions/targetFeatureFlag.js.map +1 -0
- package/dist/targeting/conditions/types.d.ts +49 -0
- package/dist/targeting/conditions/types.js +2 -0
- package/dist/targeting/conditions/types.js.map +1 -0
- package/dist/targeting/conditions/visitedPages.d.ts +11 -0
- package/dist/targeting/conditions/visitedPages.js +2 -0
- package/dist/targeting/conditions/visitedPages.js.map +1 -0
- package/dist/targeting/conditions/visitorCode.d.ts +11 -0
- package/dist/targeting/conditions/visitorCode.js +2 -0
- package/dist/targeting/conditions/visitorCode.js.map +1 -0
- package/dist/targeting/conditions/visits.d.ts +11 -0
- package/dist/targeting/conditions/visits.js +2 -0
- package/dist/targeting/conditions/visits.js.map +1 -0
- package/dist/targeting/index.d.ts +3 -0
- package/dist/targeting/index.js +2 -0
- package/dist/targeting/index.js.map +1 -0
- package/dist/targeting/node.d.ts +23 -0
- package/dist/targeting/node.js +2 -0
- package/dist/targeting/node.js.map +1 -0
- package/dist/targeting/tree.d.ts +22 -0
- package/dist/targeting/tree.js +2 -0
- package/dist/targeting/tree.js.map +1 -0
- package/dist/targeting/types.d.ts +164 -0
- package/dist/targeting/types.js +2 -0
- package/dist/targeting/types.js.map +1 -0
- package/dist/types.d.ts +200 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utilities/constants.d.ts +2 -0
- package/dist/utilities/constants.js +2 -0
- package/dist/utilities/constants.js.map +1 -0
- package/dist/utilities/index.d.ts +3 -0
- package/dist/utilities/index.js +2 -0
- package/dist/utilities/index.js.map +1 -0
- package/dist/utilities/types.d.ts +119 -0
- package/dist/utilities/types.js +2 -0
- package/dist/utilities/types.js.map +1 -0
- package/dist/utilities/utilities.d.ts +40 -0
- package/dist/utilities/utilities.js +2 -0
- package/dist/utilities/utilities.js.map +1 -0
- package/dist/variationConfiguration/index.d.ts +2 -0
- package/dist/variationConfiguration/index.js +2 -0
- package/dist/variationConfiguration/index.js.map +1 -0
- package/dist/variationConfiguration/types.d.ts +21 -0
- package/dist/variationConfiguration/types.js +2 -0
- package/dist/variationConfiguration/types.js.map +1 -0
- package/dist/variationConfiguration/variationConfiguration.d.ts +27 -0
- package/dist/variationConfiguration/variationConfiguration.js +2 -0
- package/dist/variationConfiguration/variationConfiguration.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { VisitType } from '../requester';
|
|
2
|
+
import { IKameleoonData, GeolocationInfoType, GeolocationDataType } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* @class
|
|
5
|
+
* Geolocation - a class for creating an instance for geolocation data
|
|
6
|
+
* */
|
|
7
|
+
export declare class GeolocationData implements IKameleoonData {
|
|
8
|
+
private country;
|
|
9
|
+
private region?;
|
|
10
|
+
private city?;
|
|
11
|
+
private postalCode?;
|
|
12
|
+
private coordinates?;
|
|
13
|
+
private sent;
|
|
14
|
+
/**
|
|
15
|
+
* @param {GeolocationInfoType} geolocationInfo - an object containing information about geolocation of a visitor
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* // Visitor is located at Triumph Arch in Paris, France
|
|
19
|
+
* const location: GeolocationDataType = {
|
|
20
|
+
* country: 'France',
|
|
21
|
+
* region: 'Île-de-France',
|
|
22
|
+
* city: 'Paris',
|
|
23
|
+
* postalCode: '75008',
|
|
24
|
+
* coordinates: [48.8738, 2.295]
|
|
25
|
+
* };
|
|
26
|
+
*
|
|
27
|
+
* const geolocation = new GeolocationData(location);
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* */
|
|
31
|
+
constructor({ country, region, city, postalCode, coordinates, }: GeolocationInfoType);
|
|
32
|
+
/**
|
|
33
|
+
* @property url - url for the current data type used for events tracking
|
|
34
|
+
* */
|
|
35
|
+
get url(): string;
|
|
36
|
+
/**
|
|
37
|
+
* @property data - data of the current class instance
|
|
38
|
+
* */
|
|
39
|
+
get data(): GeolocationDataType;
|
|
40
|
+
/**
|
|
41
|
+
* @property isSent - signifying if the data was sent already tracked
|
|
42
|
+
* */
|
|
43
|
+
get isSent(): boolean;
|
|
44
|
+
set isSent(value: boolean);
|
|
45
|
+
/**
|
|
46
|
+
* @private
|
|
47
|
+
* @method _fromVisits - an internal method for creating an instance of GeolocationData class from a list of visits
|
|
48
|
+
* @param {VisitType[]} visits - a list of visits
|
|
49
|
+
* @returns {GeolocationData | undefined} an instance of GeolocationData class or undefined if geolocation can not be found among visits
|
|
50
|
+
* */
|
|
51
|
+
static _fromVisits(visits: VisitType[]): GeolocationData | undefined;
|
|
52
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GeolocationData=void 0;var _requester=require("../requester"),_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 _createForOfIteratorHelper(a,b){var c="undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(!c){if(Array.isArray(a)||(c=_unsupportedIterableToArray(a))||b&&a&&"number"==typeof a.length){c&&(a=c);var d=0,e=function(){};return{s:e,n:function n(){return d>=a.length?{done:!0}:{done:!1,value:a[d++]}},e:function e(a){throw a},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var f,g=!0,h=!1;return{s:function s(){c=c.call(a)},n:function n(){var a=c.next();return g=a.done,a},e:function e(a){h=!0,f=a},f:function f(){try{g||null==c.return||c.return()}finally{if(h)throw f}}}}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 _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)}var GeolocationData=function(){function a(b){var c=b.country,d=b.region,e=b.city,f=b.postalCode,g=b.coordinates;_classCallCheck(this,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=c,this.region=d,this.city=e,this.postalCode=f,this.coordinates=g,this.sent=!1}return _createClass(a,[{key:"url",get:function get(){var 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}},{key:"data",get:function get(){return{type:_types.KameleoonData.GeolocationData,country:this.country,region:this.region,city:this.city,postalCode:this.postalCode,coordinates:this.coordinates,sent:this.sent}}},{key:"isSent",get:function get(){return this.sent},set:function set(a){this.sent=a}}],[{key:"_fromVisits",value:function _fromVisits(b){for(var c,d=void 0,e=b.length-1;0<=e;e--)if(c=b[e],!!c.geolocationEvents){var f,g=c.geolocationEvents,h=_createForOfIteratorHelper(g);try{for(h.s();!(f=h.n()).done;){var j=f.value,k=j.data;k.country&&(d=k)}}catch(a){h.e(a)}finally{h.f()}}var l=d||{},m=l.country,n=l.region,o=l.city;if(m)return n&&o?new a({country:m,region:n,city:o}):n?new a({country:m,region:n}):new a({country:m})}}]),a}();exports.GeolocationData=GeolocationData;
|
|
2
|
+
//# sourceMappingURL=geolocation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geolocation.js","names":["GeolocationData","a","b","country","region","city","postalCode","coordinates","_classCallCheck","_defineProperty","sent","_createClass","key","get","UrlParameter","Region","encodeURIComponent","City","PostalCode","Latitude","Longitude","UrlEventType","Geolocation","Country","type","KameleoonData","set","value","_fromVisits","visits","visit","geolocationData","i","length","geolocationEvents","f","h","_createForOfIteratorHelper","s","n","done","geolocationEvent","data","e","l","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 /**\n * @property url - url for the current data type used for events tracking\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 /**\n * @property data - data of the current class instance\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 /**\n * @property isSent - signifying if the data was sent already tracked\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 _fromVisits - an internal method for creating an instance of GeolocationData class from a list of visits\n * @param {VisitType[]} visits - a list of visits\n * @returns {GeolocationData | undefined} an instance of GeolocationData class or undefined if geolocation can not be found among visits\n * */\n public static _fromVisits(visits: VisitType[]): GeolocationData | undefined {\n let geolocationData: GeolocationEventType['data'] | undefined = undefined;\n\n // --- Note ---\n // Going backwards to get the latest visit data\n for (let i = visits.length - 1; i >= 0; i--) {\n const visit = visits[i];\n\n if (!visit.geolocationEvents) {\n continue;\n }\n\n const geolocationEvents = visit.geolocationEvents;\n\n for (const geolocationEvent of geolocationEvents) {\n const { data } = geolocationEvent;\n\n if (data.country) {\n geolocationData = data;\n }\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":"+hFAaa,CAAAA,eAAe,YAyB1B,SAAAC,EAAAC,CAAA,CAMwB,IALtB,CAAAC,CAAO,CAAAD,CAAA,CAAPC,OAAO,CACPC,CAAM,CAAAF,CAAA,CAANE,MAAM,CACNC,CAAI,CAAAH,CAAA,CAAJG,IAAI,CACJC,CAAU,CAAAJ,CAAA,CAAVI,UAAU,CACVC,CAAW,CAAAL,CAAA,CAAXK,WAAW,CAAAC,eAAA,MAAAP,CAAA,EAAAQ,eAAA,wBAAAA,eAAA,uBAAAA,eAAA,qBAAAA,eAAA,2BAAAA,eAAA,4BAAAA,eAAA,qBAEX,IAAI,CAACN,OAAO,CAAGA,CAAO,CACtB,IAAI,CAACC,MAAM,CAAGA,CAAM,CACpB,IAAI,CAACC,IAAI,CAAGA,CAAI,CAChB,IAAI,CAACC,UAAU,CAAGA,CAAU,CAC5B,IAAI,CAACC,WAAW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,GAAI,CAAAJ,CAAe,CAAC,CAAEG,OAAO,CAAPA,CAAO,CAAEC,MAAM,CAANA,CAAO,CAAC,CAAC,CAExC,GAAI,CAAAJ,CAAe,CAAC,CAAEG,OAAO,CAAPA,CAAQ,CAAC,CAG5C,CAAC,IAAAF,CAAA,IAAA4C,OAAA,CAAA7C,eAAA,CAAAA,eAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function constructTypeMap<T extends string>(indexMap: Record<T, number>): Record<number, T>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.constructTypeMap=constructTypeMap;function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure 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 _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 _iterableToArrayLimit(a,b){var c=null==a?null:"undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(null!=c){var d,e,f,g,h=[],i=!0,j=!1;try{if(f=(c=c.call(a)).next,0===b){if(Object(c)!==c)return;i=!1}else for(;!(i=(d=f.call(c)).done)&&(h.push(d.value),h.length!==b);i=!0);}catch(a){j=!0,e=a}finally{try{if(!i&&null!=c.return&&(g=c.return(),Object(g)!==g))return}finally{if(j)throw e}}return h}}function _arrayWithHoles(a){if(Array.isArray(a))return a}function constructTypeMap(a){return Object.fromEntries(Object.entries(a).map(function(a){var b=_slicedToArray(a,2),c=b[0],d=b[1];return[d,c]}))}
|
|
2
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","names":["constructTypeMap","indexMap","Object","fromEntries","entries","map","a","b","_slicedToArray","key","value"],"sources":["../../src/kameleoonData/helpers.ts"],"sourcesContent":["export function constructTypeMap<T extends string>(\n indexMap: Record<T, number>,\n): Record<number, T> {\n return Object.fromEntries(\n Object.entries(indexMap).map(([key, value]) => [value, key]),\n ) as Record<number, T>;\n}\n"],"mappings":"21CAAO,QAAS,CAAAA,gBAAgBA,CAC9BC,CAA2B,CACR,CACnB,MAAO,CAAAC,MAAM,CAACC,WAAW,CACvBD,MAAM,CAACE,OAAO,CAACH,CAAQ,CAAC,CAACI,GAAG,CAAC,SAAAC,CAAA,MAAAC,CAAA,CAAAC,cAAA,CAAAF,CAAA,IAAEG,CAAG,CAAAF,CAAA,IAAEG,CAAK,CAAAH,CAAA,UAAM,CAACG,CAAK,CAAED,CAAG,CAAC,EAAC,CAEhE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { Device } from './device';
|
|
2
|
+
export { Cookie } from './cookie';
|
|
3
|
+
export { Browser } from './browser';
|
|
4
|
+
export { PageView } from './pageView';
|
|
5
|
+
export { UserAgent } from './userAgent';
|
|
6
|
+
export { CustomData } from './customData';
|
|
7
|
+
export { Conversion } from './conversion';
|
|
8
|
+
export { GeolocationData } from './geolocation';
|
|
9
|
+
export { OperatingSystem } from './operatingSystem';
|
|
10
|
+
export { ApplicationVersion } from './applicationVersion';
|
|
11
|
+
export { VisitsData } from './visitsData';
|
|
12
|
+
export { DEFAULT_CLEANUP_INTERVAL } from './constants';
|
|
13
|
+
export { DeviceType, CookieType, VisitsDataType, BrowserType, KameleoonData, DeviceDataType, CustomDataType, BrowserDataType, BrowserIndexMap, PageViewDataType, KameleoonDataType, UserAgentDataType, ConversionDataType, OperatingSystemType, GeolocationInfoType, KameleoonDataItemType, PageViewParametersType, ConversionParametersType, ApplicationVersionDataType, } from './types';
|
|
14
|
+
export { DataManager } from './dataManager';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"ApplicationVersion",{enumerable:!0,get:function get(){return _applicationVersion.ApplicationVersion}}),Object.defineProperty(exports,"ApplicationVersionDataType",{enumerable:!0,get:function get(){return _types.ApplicationVersionDataType}}),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,"Cookie",{enumerable:!0,get:function get(){return _cookie.Cookie}}),Object.defineProperty(exports,"CookieType",{enumerable:!0,get:function get(){return _types.CookieType}}),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,"DEFAULT_CLEANUP_INTERVAL",{enumerable:!0,get:function get(){return _constants.DEFAULT_CLEANUP_INTERVAL}}),Object.defineProperty(exports,"DataManager",{enumerable:!0,get:function get(){return _dataManager.DataManager}}),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,"GeolocationData",{enumerable:!0,get:function get(){return _geolocation.GeolocationData}}),Object.defineProperty(exports,"GeolocationInfoType",{enumerable:!0,get:function get(){return _types.GeolocationInfoType}}),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,"OperatingSystem",{enumerable:!0,get:function get(){return _operatingSystem.OperatingSystem}}),Object.defineProperty(exports,"OperatingSystemType",{enumerable:!0,get:function get(){return _types.OperatingSystemType}}),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}}),Object.defineProperty(exports,"VisitsData",{enumerable:!0,get:function get(){return _visitsData.VisitsData}}),Object.defineProperty(exports,"VisitsDataType",{enumerable:!0,get:function get(){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");
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { VisitType } from '../requester';
|
|
2
|
+
import { IKameleoonData, OperatingSystemDataType, OperatingSystemType } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* @class
|
|
5
|
+
* OperatingSystem - a class for creating an instance for Operating System of a certain type
|
|
6
|
+
* */
|
|
7
|
+
export declare class OperatingSystem implements IKameleoonData {
|
|
8
|
+
private operatingSystem;
|
|
9
|
+
private sent;
|
|
10
|
+
/**
|
|
11
|
+
* @param {OperatingSystemType} operatingSystem - one of the available operating system types from `OperatingSystemType` enum
|
|
12
|
+
* */
|
|
13
|
+
constructor(operatingSystem: OperatingSystemType);
|
|
14
|
+
/**
|
|
15
|
+
* @property url - url for the current data type used for events tracking
|
|
16
|
+
* */
|
|
17
|
+
get url(): string;
|
|
18
|
+
/**
|
|
19
|
+
* @property data - data of the current class instance
|
|
20
|
+
* */
|
|
21
|
+
get data(): OperatingSystemDataType;
|
|
22
|
+
/**
|
|
23
|
+
* @property isSent - signifying if the data was sent already tracked
|
|
24
|
+
* */
|
|
25
|
+
get isSent(): boolean;
|
|
26
|
+
set isSent(value: boolean);
|
|
27
|
+
/**
|
|
28
|
+
* @private
|
|
29
|
+
* @method _fromVisits - a static method for creating an instance of OperatingSystem class from a list of visits
|
|
30
|
+
* @param {VisitType[]} visits - a list of visits
|
|
31
|
+
* @returns {OperatingSystem | undefined} an instance of OperatingSystem class or undefined
|
|
32
|
+
* */
|
|
33
|
+
static _fromVisits(visits: VisitType[]): OperatingSystem | undefined;
|
|
34
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.OperatingSystem=void 0;var _requester=require("../requester"),_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)}var OperatingSystem=function(){function a(b){_classCallCheck(this,a),_defineProperty(this,"operatingSystem",void 0),_defineProperty(this,"sent",void 0),this.operatingSystem=b,this.sent=!1}return _createClass(a,[{key:"url",get:function get(){return this.operatingSystem?_requester.UrlEventType.StaticData+_requester.UrlParameter.Os+this.operatingSystem+_requester.UrlParameter.OsIndex+_types.OperatingSystemIndexMap[this.operatingSystem]:""}},{key:"data",get:function get(){return{operatingSystem:this.operatingSystem,type:_types.KameleoonData.OperatingSystem,sent:this.sent}}},{key:"isSent",get:function get(){return this.sent},set:function set(a){this.sent=a}}],[{key:"_fromVisits",value:function _fromVisits(b){for(var c,d={},e=b.length-1;0<=e;e--)if(c=b[e],!!c.staticDataEvent){var f=c.staticDataEvent.data,g=f.os,h=f.osIndex;(g||null!==h)&&(d={operatingSystemType:g,osIndex:h})}var j=d,k=j.operatingSystemType,l=j.osIndex;if(k||"number"==typeof l){var m=k||_types.OperatingSystemTypeMap[l];return new a(m)}}}]),a}();exports.OperatingSystem=OperatingSystem;
|
|
2
|
+
//# sourceMappingURL=operatingSystem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operatingSystem.js","names":["OperatingSystem","a","operatingSystem","_classCallCheck","_defineProperty","sent","_createClass","key","get","UrlEventType","StaticData","UrlParameter","Os","OsIndex","OperatingSystemIndexMap","type","KameleoonData","set","value","_fromVisits","visits","visit","operatingSystemData","i","length","staticDataEvent","f","data","operatingSystemType","os","osIndex","j","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 /**\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.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 /**\n * @property data - data of the current class instance\n * */\n get data(): OperatingSystemDataType {\n return {\n operatingSystem: this.operatingSystem,\n type: KameleoonData.OperatingSystem,\n sent: this.sent,\n };\n }\n\n /**\n * @property isSent - signifying if the data was sent already tracked\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 _fromVisits - a static method for creating an instance of OperatingSystem class from a list of visits\n * @param {VisitType[]} visits - a list of visits\n * @returns {OperatingSystem | undefined} an instance of OperatingSystem class or undefined\n * */\n public static _fromVisits(visits: VisitType[]): OperatingSystem | undefined {\n let operatingSystemData: {\n operatingSystemType?: OperatingSystemType | null;\n osIndex?: number | null;\n } = {};\n\n // --- Note ---\n // Going backwards to get the latest visit data\n for (let i = visits.length - 1; i >= 0; i--) {\n const visit = visits[i];\n\n if (!visit.staticDataEvent) {\n continue;\n }\n\n const { os: operatingSystemType, osIndex } = visit.staticDataEvent.data;\n\n if (operatingSystemType || osIndex !== null) {\n operatingSystemData = { operatingSystemType, osIndex };\n }\n }\n\n const { operatingSystemType, osIndex } = operatingSystemData;\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}\n"],"mappings":"g5CAca,CAAAA,eAAe,YAO1B,SAAAC,EAAYC,CAAoC,CAAE,CAAAC,eAAA,MAAAF,CAAA,EAAAG,eAAA,gCAAAA,eA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,mBAAmB,CAAnBA,CAAmB,CAAEE,OAAO,CAAPA,CAAQ,CAAC,EAI1D,IAAAC,CAAA,CAAyCT,CAAmB,CAApDM,CAAmB,CAAAG,CAAA,CAAnBH,mBAAmB,CAAEE,CAAO,CAAAC,CAAA,CAAPD,OAAO,CAEpC,GAAIF,CAAmB,EAAuB,QAAQ,EAA3B,MAAO,CAAAE,CAAoB,CAAE,CACtD,GAAM,CAAA5B,CAAe,CACnB0B,CAAmB,EAAII,6BAAsB,CAACF,CAAO,CAAW,CAElE,MAAO,IAAI,CAAA9B,CAAe,CAACE,CAAe,CAC5C,CACF,CAAC,IAAAD,CAAA,IAAAgC,OAAA,CAAAjC,eAAA,CAAAA,eAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { VisitType } from '../requester';
|
|
2
|
+
import { IKameleoonData, PageViewDataType, PageViewParametersType } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* @class
|
|
5
|
+
* PageView - a class for creating an instance of a page view data
|
|
6
|
+
* */
|
|
7
|
+
export declare class PageView implements IKameleoonData {
|
|
8
|
+
private urlAddress;
|
|
9
|
+
private title;
|
|
10
|
+
private referrers?;
|
|
11
|
+
private sent;
|
|
12
|
+
private timestampList;
|
|
13
|
+
/**
|
|
14
|
+
* @param {PageViewParametersType} pageViewParameters - an object with page view parameters
|
|
15
|
+
* */
|
|
16
|
+
constructor({ urlAddress, title, referrers }: PageViewParametersType);
|
|
17
|
+
/**
|
|
18
|
+
* @property url - url for the current data type used for events tracking
|
|
19
|
+
* */
|
|
20
|
+
get url(): string;
|
|
21
|
+
/**
|
|
22
|
+
* @property data - data of the current class instance
|
|
23
|
+
* */
|
|
24
|
+
get data(): PageViewDataType;
|
|
25
|
+
/**
|
|
26
|
+
* @property isSent - signifying if the data was sent already tracked
|
|
27
|
+
* */
|
|
28
|
+
get isSent(): boolean;
|
|
29
|
+
set isSent(value: boolean);
|
|
30
|
+
/**
|
|
31
|
+
* @property timestamps - a list of timestamps for the current data type
|
|
32
|
+
* */
|
|
33
|
+
get timestamps(): number[];
|
|
34
|
+
set timestamps(value: number[]);
|
|
35
|
+
/**
|
|
36
|
+
* @private
|
|
37
|
+
* @method _listFromVisits - an internal method for creating a list of page view data from a list of visits
|
|
38
|
+
* @param {VisitType[]} visits - a list of visits
|
|
39
|
+
* @returns {PageView[]} a list of PageView instances
|
|
40
|
+
* */
|
|
41
|
+
static _listFromVisits(visits: VisitType[]): PageView[];
|
|
42
|
+
}
|
|
@@ -0,0 +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 _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 _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 _createForOfIteratorHelper(a,b){var c="undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(!c){if(Array.isArray(a)||(c=_unsupportedIterableToArray(a))||b&&a&&"number"==typeof a.length){c&&(a=c);var d=0,e=function(){};return{s:e,n:function n(){return d>=a.length?{done:!0}:{done:!1,value:a[d++]}},e:function e(a){throw a},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var f,g=!0,h=!1;return{s:function s(){c=c.call(a)},n:function n(){var a=c.next();return g=a.done,a},e:function e(a){h=!0,f=a},f:function f(){try{g||null==c.return||c.return()}finally{if(h)throw f}}}}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 _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)}var PageView=function(){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,"referrers",void 0),_defineProperty(this,"sent",void 0),_defineProperty(this,"timestampList",[]),this.urlAddress=c,this.title=d,this.referrers=e,this.sent=!1}return _createClass(a,[{key:"url",get:function get(){var a;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}},{key:"data",get:function get(){return{urlAddress:this.urlAddress,title:this.title,referrers:this.referrers,type:_types2.KameleoonData.PageView,sent:this.sent,timestamps:this.timestampList}}},{key:"isSent",get:function get(){return this.sent},set:function set(a){this.sent=a}},{key:"timestamps",get:function get(){return this.timestampList},set:function set(a){var b=this;this.timestampList.length?a.forEach(function(a){_utilities.Utilities.insertInOrderedListMutably({list:b.timestampList,element:a,order:_types.Order.Ascending})}):this.timestampList=a}}],[{key:"_listFromVisits",value:function _listFromVisits(b){for(var c,d=[],e=new Map,f=b.length-1;0<=f;f--)if(c=b[f],!!c.pageEvents){var g,h=c.pageEvents,j=_createForOfIteratorHelper(h);try{for(j.s();!(g=j.n()).done;){var k=g.value,l=[],m=k.time,n=k.data,o=n.href,p=n.title,q=n.referrersIndices;"number"==typeof q[0]&&(l=q);var r=void 0;if(e.has(o)){var s=e.get(o).timestamps;r=new a({urlAddress:o,title:p,referrers:l}),r.timestamps=[].concat(_toConsumableArray(s),[m])}else r=new a({urlAddress:o,title:p,referrers:l}),r.timestamps=[m];e.set(o,r)}}catch(a){j.e(a)}finally{j.f()}}return e.forEach(function(a){a.isSent=!0,d.push(a)}),d}}]),a}();exports.PageView=PageView;
|
|
2
|
+
//# sourceMappingURL=pageView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pageView.js","names":["PageView","a","b","urlAddress","title","referrers","_classCallCheck","_defineProperty","sent","_createClass","key","get","titleParameter","UrlParameter","Title","encodeURIComponent","referrersParameter","length","ReferrersIndices","JSON","stringify","UrlEventType","Page","Href","type","KameleoonData","timestamps","timestampList","set","value","forEach","timestamp","Utilities","insertInOrderedListMutably","list","element","order","Order","Ascending","_listFromVisits","visits","visit","resultData","pageViewMap","Map","i","pageEvents","g","j","_createForOfIteratorHelper","s","n","done","pageEvent","time","data","href","referrersIndices","pageView","has","existingTimestamps","concat","_toConsumableArray","e","f","isSent","push","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 /**\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 );\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 sent: this.sent,\n timestamps: this.timestampList,\n };\n }\n\n /**\n * @property isSent - signifying if the data was sent already tracked\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 if (this.timestampList.length) {\n // --- Note ---\n // We want to keep the list in ascending order\n value.forEach((timestamp) => {\n Utilities.insertInOrderedListMutably({\n list: this.timestampList,\n element: timestamp,\n order: Order.Ascending,\n });\n });\n } else {\n this.timestampList = value;\n }\n }\n\n /**\n * @private\n * @method _listFromVisits - an internal method for creating a list of page view data from a list of visits\n * @param {VisitType[]} visits - a list of visits\n * @returns {PageView[]} a list of PageView instances\n * */\n public static _listFromVisits(visits: VisitType[]): PageView[] {\n const resultData: PageView[] = [];\n const pageViewMap = new Map<string, PageView>();\n\n // --- Note ---\n // Going backwards to get the latest visit data\n for (let i = visits.length - 1; i >= 0; i--) {\n const visit = visits[i];\n\n if (!visit.pageEvents) {\n continue;\n }\n\n const pageEvents = visit.pageEvents;\n\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 (pageViewMap.has(href)) {\n const existingTimestamps = pageViewMap.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 pageViewMap.set(href, pageView);\n }\n }\n\n pageViewMap.forEach((value) => {\n // --- Note ---\n // We don't want to track collected pages again\n value.isSent = true;\n resultData.push(value);\n });\n\n return resultData;\n }\n}\n"],"mappings":"knGAca,CAAAA,QAAQ,YAYnB,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,MAA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"}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { TargetingDataType } from '../targeting';
|
|
2
|
+
import { IExternalStorage } from '../storage';
|
|
3
|
+
import { Browser, Conversion, Cookie, CustomData, Device, GeolocationData, OperatingSystem, PageView, UserAgent, ApplicationVersion, VisitsData } from '../kameleoonData';
|
|
4
|
+
export type UnsentVisitorTargetingDataType = Map<KameleoonData | number, KameleoonDataType | KameleoonDataType[]>;
|
|
5
|
+
export type UnsentTargetingDataType = {
|
|
6
|
+
[visitorCode: string]: UnsentVisitorTargetingDataType | undefined;
|
|
7
|
+
};
|
|
8
|
+
export type FieldParametersType = {
|
|
9
|
+
visitorCode: string;
|
|
10
|
+
key: KameleoonData;
|
|
11
|
+
value: BrowserDataType | CookieDataType | DeviceDataType | GeolocationDataType | OperatingSystemDataType | UserAgentDataType | VisitsDataType;
|
|
12
|
+
data: TargetingDataType;
|
|
13
|
+
};
|
|
14
|
+
export type ArrayFieldParametersType = {
|
|
15
|
+
visitorCode: string;
|
|
16
|
+
key: KameleoonData;
|
|
17
|
+
value: ConversionDataType;
|
|
18
|
+
data: TargetingDataType;
|
|
19
|
+
};
|
|
20
|
+
export type NestedFieldParametersType = {
|
|
21
|
+
visitorCode: string;
|
|
22
|
+
key: KameleoonData.CustomData | KameleoonData.PageView;
|
|
23
|
+
nestedKey: string;
|
|
24
|
+
value: CustomDataType | PageViewDataType;
|
|
25
|
+
data: TargetingDataType;
|
|
26
|
+
};
|
|
27
|
+
export type DataManagerParametersType = {
|
|
28
|
+
targetingCleanupInterval?: number;
|
|
29
|
+
storage: IExternalStorage<TargetingDataType>;
|
|
30
|
+
};
|
|
31
|
+
export type KameleoonDataItemType = BrowserDataType | ConversionDataType | CustomDataType | DeviceDataType | PageViewDataType | UserAgentDataType | CookieDataType | GeolocationDataType | OperatingSystemDataType | ApplicationVersionDataType | VisitsDataType;
|
|
32
|
+
/**
|
|
33
|
+
* @interface an interface of KameleoonData
|
|
34
|
+
* each class instance will have url getter method
|
|
35
|
+
* for handling url of different data types
|
|
36
|
+
* */
|
|
37
|
+
export interface IKameleoonData {
|
|
38
|
+
readonly url: string;
|
|
39
|
+
readonly data: KameleoonDataItemType;
|
|
40
|
+
isSent: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @type a tuple of each possible type of data for `addData` method
|
|
44
|
+
* of KameleoonClient
|
|
45
|
+
* */
|
|
46
|
+
export type KameleoonDataType = Browser | Conversion | CustomData | Device | PageView | UserAgent | VisitsData | GeolocationData | OperatingSystem | Cookie | ApplicationVersion;
|
|
47
|
+
export type ActivityTimePropertyType = {
|
|
48
|
+
lastActivityTime: number;
|
|
49
|
+
};
|
|
50
|
+
export type ExistingCustomDataType = NonNullable<KameleoonVisitorDataType[KameleoonData.CustomData]>;
|
|
51
|
+
export type ExistingPageViewDataType = NonNullable<KameleoonVisitorDataType[KameleoonData.PageView]>;
|
|
52
|
+
export type ExistingNestedDataType = ExistingCustomDataType | ExistingPageViewDataType;
|
|
53
|
+
export type ExistingArrayDataType = ExistingConversionDataType;
|
|
54
|
+
export type ExistingConversionDataType = NonNullable<KameleoonVisitorDataType[KameleoonData.Conversion]>;
|
|
55
|
+
export type ExistingVisitsDataType = NonNullable<KameleoonVisitorDataType[KameleoonData.VisitsData]>;
|
|
56
|
+
export type ExistingDataType<T extends KameleoonData> = NonNullable<KameleoonVisitorDataType[T]>;
|
|
57
|
+
export type KameleoonVisitorDataType<T = ActivityTimePropertyType> = {
|
|
58
|
+
[KameleoonData.CustomData]?: {
|
|
59
|
+
[index: string]: (CustomDataType & T) | undefined;
|
|
60
|
+
};
|
|
61
|
+
[KameleoonData.Conversion]?: (ConversionDataType & T)[];
|
|
62
|
+
[KameleoonData.GeolocationData]?: GeolocationDataType & T;
|
|
63
|
+
[KameleoonData.UserAgent]?: UserAgentDataType & T;
|
|
64
|
+
[KameleoonData.PageView]?: {
|
|
65
|
+
[url: string]: PageViewDataType & T;
|
|
66
|
+
};
|
|
67
|
+
[KameleoonData.Browser]?: BrowserDataType & T;
|
|
68
|
+
[KameleoonData.Device]?: DeviceDataType & T;
|
|
69
|
+
[KameleoonData.Cookie]?: CookieDataType & T;
|
|
70
|
+
[KameleoonData.OperatingSystem]?: OperatingSystemDataType & T;
|
|
71
|
+
[KameleoonData.ApplicationVersion]?: ApplicationVersionDataType & T;
|
|
72
|
+
[KameleoonData.VisitsData]?: VisitsDataType & T;
|
|
73
|
+
};
|
|
74
|
+
export declare enum KameleoonData {
|
|
75
|
+
CustomData = "customData",
|
|
76
|
+
PageView = "pageView",
|
|
77
|
+
GeolocationData = "geolocation",
|
|
78
|
+
Browser = "browser",
|
|
79
|
+
Conversion = "conversion",
|
|
80
|
+
Cookie = "cookie",
|
|
81
|
+
Device = "device",
|
|
82
|
+
OperatingSystem = "operatingSystem",
|
|
83
|
+
UserAgent = "userAgent",
|
|
84
|
+
ApplicationVersion = "applicationVersion",
|
|
85
|
+
VisitsData = "visitsData"
|
|
86
|
+
}
|
|
87
|
+
type SharedDataPropertiesType = {
|
|
88
|
+
type: KameleoonData;
|
|
89
|
+
sent: boolean;
|
|
90
|
+
};
|
|
91
|
+
export type BrowserDataType = {
|
|
92
|
+
browser: BrowserType;
|
|
93
|
+
version?: number;
|
|
94
|
+
} & SharedDataPropertiesType;
|
|
95
|
+
export type ConversionDataType = {
|
|
96
|
+
goalId: number;
|
|
97
|
+
revenue: number;
|
|
98
|
+
negative: boolean;
|
|
99
|
+
} & SharedDataPropertiesType;
|
|
100
|
+
export type CustomDataType = {
|
|
101
|
+
index: number;
|
|
102
|
+
value: string[];
|
|
103
|
+
} & SharedDataPropertiesType;
|
|
104
|
+
export type DeviceDataType = {
|
|
105
|
+
device: DeviceType;
|
|
106
|
+
} & SharedDataPropertiesType;
|
|
107
|
+
export type VisitsDataType = {
|
|
108
|
+
previousVisits: number[];
|
|
109
|
+
currentVisit: number | null;
|
|
110
|
+
} & SharedDataPropertiesType;
|
|
111
|
+
export type OperatingSystemDataType = {
|
|
112
|
+
operatingSystem: OperatingSystemType;
|
|
113
|
+
} & SharedDataPropertiesType;
|
|
114
|
+
export type CookieDataType = {
|
|
115
|
+
cookie: CookieType[];
|
|
116
|
+
} & SharedDataPropertiesType;
|
|
117
|
+
export type GeolocationDataType = GeolocationInfoType & SharedDataPropertiesType;
|
|
118
|
+
export type PageViewDataType = {
|
|
119
|
+
urlAddress: string;
|
|
120
|
+
title: string;
|
|
121
|
+
referrers?: number[];
|
|
122
|
+
timestamps: number[];
|
|
123
|
+
} & SharedDataPropertiesType;
|
|
124
|
+
export type UserAgentDataType = {
|
|
125
|
+
value: string;
|
|
126
|
+
} & SharedDataPropertiesType;
|
|
127
|
+
export type ApplicationVersionDataType = {
|
|
128
|
+
version: string;
|
|
129
|
+
} & SharedDataPropertiesType;
|
|
130
|
+
/**
|
|
131
|
+
* @param {number} goalId - an id of a goal to track
|
|
132
|
+
* @param {number | undefined} revenue - an optional parameter for revenue, default value is `0`
|
|
133
|
+
* @param {boolean | undefined} negative - an optional parameter identifying whether the conversion should be removed, default value is `false`
|
|
134
|
+
* */
|
|
135
|
+
export type ConversionParametersType = {
|
|
136
|
+
goalId: number;
|
|
137
|
+
revenue?: number;
|
|
138
|
+
negative?: boolean;
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* @param {string} urlAddress - url address of the page to track
|
|
142
|
+
* @param {string} title - title of the web page
|
|
143
|
+
* @param {number[] | undefined} referrers - an optional parameter containing a list of referrersIndices, has no default value
|
|
144
|
+
* */
|
|
145
|
+
export type PageViewParametersType = {
|
|
146
|
+
urlAddress: string;
|
|
147
|
+
title: string;
|
|
148
|
+
referrers?: number[];
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* @readonly
|
|
152
|
+
* @enum {string} an Enum containing all possible variants for device type
|
|
153
|
+
* */
|
|
154
|
+
export declare enum DeviceType {
|
|
155
|
+
Phone = "PHONE",
|
|
156
|
+
Tablet = "TABLET",
|
|
157
|
+
Desktop = "DESKTOP"
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* @readonly
|
|
161
|
+
* @enum {string} an Enum containing all possible variants for operating system type
|
|
162
|
+
* */
|
|
163
|
+
export declare enum OperatingSystemType {
|
|
164
|
+
WindowsPhone = "WINDOWS_PHONE",
|
|
165
|
+
Windows = "WINDOWS",
|
|
166
|
+
Android = "ANDROID",
|
|
167
|
+
Linux = "LINUX",
|
|
168
|
+
Mac = "MAC",
|
|
169
|
+
IOS = "IOS"
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* @param {string} country - a country of a visitor
|
|
173
|
+
* @param {string | undefined} region - an optional parameter containing a region of a visitor, has no default value
|
|
174
|
+
* @param {string | undefined} city - an optional parameter containing a city of a visitor, has no default value
|
|
175
|
+
* @param {string | undefined} postalCode - an optional parameter containing a postal code of a visitor, has no default value
|
|
176
|
+
* @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)
|
|
177
|
+
* */
|
|
178
|
+
export type GeolocationInfoType = {
|
|
179
|
+
country: string;
|
|
180
|
+
region?: string;
|
|
181
|
+
city?: string;
|
|
182
|
+
postalCode?: string;
|
|
183
|
+
coordinates?: [number, number];
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* @param {string} key - a key of a cookie
|
|
187
|
+
* @param {string} value - a value of a cookie
|
|
188
|
+
* */
|
|
189
|
+
export type CookieType = {
|
|
190
|
+
key: string;
|
|
191
|
+
value: string;
|
|
192
|
+
};
|
|
193
|
+
export type OptionalCookieType = Omit<CookieType, 'key'> & {
|
|
194
|
+
key?: string;
|
|
195
|
+
};
|
|
196
|
+
/**
|
|
197
|
+
* @readonly
|
|
198
|
+
* @enum {string} an Enum containing all possible variants for browser type
|
|
199
|
+
* */
|
|
200
|
+
export declare enum BrowserType {
|
|
201
|
+
Chrome = "CHROME",
|
|
202
|
+
InternetExplorer = "IE",
|
|
203
|
+
Firefox = "FIREFOX",
|
|
204
|
+
Safari = "SAFARI",
|
|
205
|
+
Opera = "OPERA",
|
|
206
|
+
Other = "OTHER"
|
|
207
|
+
}
|
|
208
|
+
export declare const OperatingSystemIndexMap: {
|
|
209
|
+
readonly WINDOWS: 0;
|
|
210
|
+
readonly MAC: 1;
|
|
211
|
+
readonly IOS: 2;
|
|
212
|
+
readonly LINUX: 3;
|
|
213
|
+
readonly ANDROID: 4;
|
|
214
|
+
readonly WINDOWS_PHONE: 5;
|
|
215
|
+
};
|
|
216
|
+
export declare const OperatingSystemTypeMap: Record<number, OperatingSystemType>;
|
|
217
|
+
export declare const BrowserIndexMap: {
|
|
218
|
+
readonly CHROME: 0;
|
|
219
|
+
readonly IE: 1;
|
|
220
|
+
readonly FIREFOX: 2;
|
|
221
|
+
readonly SAFARI: 3;
|
|
222
|
+
readonly OPERA: 4;
|
|
223
|
+
readonly OTHER: 5;
|
|
224
|
+
};
|
|
225
|
+
export declare const BrowserTypeMap: Record<number, BrowserType>;
|
|
226
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.OperatingSystemTypeMap=exports.OperatingSystemType=exports.OperatingSystemIndexMap=exports.KameleoonData=exports.DeviceType=exports.BrowserTypeMap=exports.BrowserType=exports.BrowserIndexMap=void 0;var _OperatingSystemIndex,_BrowserIndexMap,_helpers=require("./helpers");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 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}({});exports.KameleoonData=KameleoonData;var DeviceType=function(a){return a.Phone="PHONE",a.Tablet="TABLET",a.Desktop="DESKTOP",a}({});exports.DeviceType=DeviceType;var OperatingSystemType=function(a){return a.WindowsPhone="WINDOWS_PHONE",a.Windows="WINDOWS",a.Android="ANDROID",a.Linux="LINUX",a.Mac="MAC",a.IOS="IOS",a}({});exports.OperatingSystemType=OperatingSystemType;var BrowserType=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 OperatingSystemIndexMap=(_OperatingSystemIndex={},_defineProperty(_OperatingSystemIndex,OperatingSystemType.Windows,0),_defineProperty(_OperatingSystemIndex,OperatingSystemType.Mac,1),_defineProperty(_OperatingSystemIndex,OperatingSystemType.IOS,2),_defineProperty(_OperatingSystemIndex,OperatingSystemType.Linux,3),_defineProperty(_OperatingSystemIndex,OperatingSystemType.Android,4),_defineProperty(_OperatingSystemIndex,OperatingSystemType.WindowsPhone,5),_OperatingSystemIndex);exports.OperatingSystemIndexMap=OperatingSystemIndexMap;var OperatingSystemTypeMap=(0,_helpers.constructTypeMap)(OperatingSystemIndexMap);exports.OperatingSystemTypeMap=OperatingSystemTypeMap;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;var BrowserTypeMap=(0,_helpers.constructTypeMap)(BrowserIndexMap);exports.BrowserTypeMap=BrowserTypeMap;
|
|
2
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":["KameleoonData","CustomData","PageView","GeolocationData","Browser","Conversion","Cookie","Device","OperatingSystem","UserAgent","ApplicationVersion","VisitsData","exports","DeviceType","Phone","Tablet","Desktop","OperatingSystemType","WindowsPhone","Windows","Android","Linux","Mac","IOS","BrowserType","Chrome","InternetExplorer","Firefox","Safari","Opera","Other","OperatingSystemIndexMap","_OperatingSystemIndex","_defineProperty","OperatingSystemTypeMap","constructTypeMap","BrowserIndexMap","_BrowserIndexMap","BrowserTypeMap"],"sources":["../../src/kameleoonData/types.ts"],"sourcesContent":["import { TargetingDataType } from 'src/targeting';\nimport { IExternalStorage } 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: IExternalStorage<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} & 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":"koCAsJY,CAAAA,aAAa,UAAbA,CAAa,QAAb,CAAAA,CAAa,CAAAC,UAAA,cAAbD,CAAa,CAAAE,QAAA,YAAbF,CAAa,CAAAG,eAAA,eAAbH,CAAa,CAAAI,OAAA,WAAbJ,CAAa,CAAAK,UAAA,cAAbL,CAAa,CAAAM,MAAA,UAAbN,CAAa,CAAAO,MAAA,UAAbP,CAAa,CAAAQ,eAAA,mBAAbR,CAAa,CAAAS,SAAA,aAAbT,CAAa,CAAAU,kBAAA,sBAAbV,CAAa,CAAAW,UAAA,cAAbX,CAAa,MAAAY,OAAA,CAAAZ,aAAA,CAAAA,aAAA,IAgGb,CAAAa,UAAU,UAAVA,CAAU,QAAV,CAAAA,CAAU,CAAAC,KAAA,SAAVD,CAAU,CAAAE,MAAA,UAAVF,CAAU,CAAAG,OAAA,WAAVH,CAAU,MAAAD,OAAA,CAAAC,UAAA,CAAAA,UAAA,IAUV,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AA,CACzBb,WAAW,CAACC,MAAM,CAAG,CAAC,EAAAQ,eAAA,CAAAI,gBAAA,CACtBb,WAAW,CAACE,gBAAgB,CAAG,CAAC,EAAAO,eAAA,CAAAI,gBAAA,CAChCb,WAAW,CAACG,OAAO,CAAG,CAAC,EAAAM,eAAA,CAAAI,gBAAA,CACvBb,WAAW,CAACI,MAAM,CAAG,CAAC,EAAAK,eAAA,CAAAI,gBAAA,CACtBb,WAAW,CAACK,KAAK,CAAG,CAAC,EAAAI,eAAA,CAAAI,gBAAA,CACrBb,WAAW,CAACM,KAAK,CAAG,CAAC,EAAAO,gBAAA,CACd,CAACzB,OAAA,CAAAwB,eAAA,CAAAA,eAAA,CAEJ,GAAM,CAAAE,cAAc,CAAG,GAAAH,yBAAgB,EAAcC,eAAe,CAAC,CAACxB,OAAA,CAAA0B,cAAA,CAAAA,cAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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 sent;
|
|
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
|
+
/**
|
|
19
|
+
* @property isSent - signifying if the data was sent already tracked
|
|
20
|
+
* */
|
|
21
|
+
get isSent(): boolean;
|
|
22
|
+
set isSent(value: boolean);
|
|
23
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var _types=require("./types");Object.defineProperty(exports,"__esModule",{value:!0}),exports.UserAgent=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 _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)}var UserAgent=function(){function a(b){_classCallCheck(this,a),_defineProperty(this,"value",void 0),_defineProperty(this,"sent",void 0),this.value=b,this.sent=!1}return _createClass(a,[{key:"url",get:function get(){return""}},{key:"data",get:function get(){return{value:this.value,type:_types.KameleoonData.UserAgent,sent:this.sent}}},{key:"isSent",get:function get(){return this.sent},set:function set(a){this.sent=a}}]),a}();exports.UserAgent=UserAgent;
|
|
2
|
+
//# sourceMappingURL=userAgent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userAgent.js","names":["_types","require","Object","defineProperty","exports","value","UserAgent","_typeof","a","Symbol","iterator","constructor","prototype","_classCallCheck","b","TypeError","_defineProperties","c","d","length","enumerable","configurable","writable","_toPropertyKey","key","_createClass","_defineProperty","_toPrimitive","toPrimitive","call","String","Number","sent","get","type","KameleoonData","set"],"sources":["../../src/kameleoonData/userAgent.ts"],"sourcesContent":["import { 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 sent: boolean;\n\n constructor(value: string) {\n this.value = value;\n this.sent = false;\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 sent: this.sent,\n };\n }\n\n /**\n * @property isSent - signifying if the data was sent already tracked\n * */\n get isSent(): boolean {\n return this.sent;\n }\n\n set isSent(value: boolean) {\n this.sent = value;\n }\n}\n"],"mappings":"aAAA,IAAAA,MAAA,CAAAC,OAAA,YAA2EC,MAAA,CAAAC,cAAA,CAAAC,OAAA,eAAAC,KAAA,MAAAD,OAAA,CAAAE,SAAA,iBAAAC,QAAAC,CAAA,mCAAAD,OAAA,oBAAAE,MAAA,mBAAAA,MAAA,CAAAC,QAAA,UAAAF,CAAA,gBAAAA,CAAA,WAAAA,CAAA,SAAAA,CAAA,qBAAAC,MAAA,EAAAD,CAAA,CAAAG,WAAA,GAAAF,MAAA,EAAAD,CAAA,GAAAC,MAAA,CAAAG,SAAA,iBAAAJ,CAAA,EAAAD,OAAA,CAAAC,CAAA,WAAAK,gBAAAL,CAAA,CAAAM,CAAA,OAAAN,CAAA,YAAAM,CAAA,YAAAC,SAAA,+CAAAC,kBAAAR,CAAA,CAAAM,CAAA,UAAAG,CAAA,CAAAC,CAAA,GAAAA,CAAA,CAAAJ,CAAA,CAAAK,MAAA,CAAAD,CAAA,GAAAD,CAAA,CAAAH,CAAA,CAAAI,CAAA,EAAAD,CAAA,CAAAG,UAAA,CAAAH,CAAA,CAAAG,UAAA,KAAAH,CAAA,CAAAI,YAAA,cAAAJ,CAAA,GAAAA,CAAA,CAAAK,QAAA,KAAApB,MAAA,CAAAC,cAAA,CAAAK,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A,CAAAjB,CAAA,GAAAgB,GAAA,OAAAS,GAAA,CAKD,SAAAA,IAAA,CAAkB,CAChB,MAAO,EACT,CAAC,GAAAT,GAAA,QAAAS,GAAA,CAKD,SAAAA,IAAA,CAA8B,CAC5B,MAAO,CACL5B,KAAK,CAAE,IAAI,CAACA,KAAK,CACjB6B,IAAI,CAAEC,oBAAa,CAAC7B,SAAS,CAC7B0B,IAAI,CAAE,IAAI,CAACA,IACb,CACF,CAAC,GAAAR,GAAA,UAAAS,GAAA,CAKD,SAAAA,IAAA,CAAsB,CACpB,MAAO,KAAI,CAACD,IACd,CAAC,CAAAI,GAAA,CAED,SAAAA,IAAW/B,CAAc,CAAE,CACzB,IAAI,CAAC2B,IAAI,CAAG3B,CACd,CAAC,IAAAG,CAAA,IAAAJ,OAAA,CAAAE,SAAA,CAAAA,SAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { VisitType } from '../requester';
|
|
2
|
+
import { IKameleoonData, VisitsDataType } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* @class
|
|
5
|
+
* Visits - a class for creating an instance of a stored visits data
|
|
6
|
+
* */
|
|
7
|
+
export declare class VisitsData implements IKameleoonData {
|
|
8
|
+
private previousVisits;
|
|
9
|
+
private currentVisit;
|
|
10
|
+
/**
|
|
11
|
+
* @param {number} currentVisit - a current visit
|
|
12
|
+
* @param {number[]} previousVisits - a list of previous visits
|
|
13
|
+
* */
|
|
14
|
+
constructor(currentVisit: number | null, previousVisits: number[]);
|
|
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(): VisitsDataType;
|
|
23
|
+
/**
|
|
24
|
+
* @property isSent - signifying if the data was sent already tracked
|
|
25
|
+
* */
|
|
26
|
+
get isSent(): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* @private
|
|
29
|
+
* @method _fromRemoteVisits - an internal method for creating an instance of Visits class from a list of visits
|
|
30
|
+
* @param {VisitType[]} visits - a list of visits
|
|
31
|
+
* @returns {VisitsData | undefined} an instance of Visits class or undefined if there were not any visits
|
|
32
|
+
* */
|
|
33
|
+
static _fromRemoteVisits(visits: VisitType[], hasCurrent: boolean): VisitsData | undefined;
|
|
34
|
+
}
|