@kameleoon/javascript-sdk-core 3.6.0 → 4.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/CHANGELOG.md +369 -0
- package/CHANGELOG_INTERNAL.md +3 -0
- package/dist/cacheManager/cacheManager.js +1 -1
- package/dist/cacheManager/cacheManager.js.map +1 -1
- package/dist/cacheManager/index.js +1 -1
- package/dist/clientConfiguration/clientConfiguration.d.ts +2 -3
- package/dist/clientConfiguration/clientConfiguration.js +1 -1
- package/dist/clientConfiguration/clientConfiguration.js.map +1 -1
- package/dist/clientConfiguration/constants.js +1 -1
- package/dist/clientConfiguration/constants.js.map +1 -1
- package/dist/clientConfiguration/index.js +1 -1
- package/dist/clientConfiguration/types.d.ts +7 -8
- package/dist/clientConfiguration/types.js +1 -1
- package/dist/clientConfiguration/types.js.map +1 -1
- package/dist/clientSettings/clientSettings.js +1 -1
- package/dist/clientSettings/clientSettings.js.map +1 -1
- package/dist/clientSettings/index.js +1 -1
- package/dist/constants.d.ts +0 -8
- package/dist/constants.js +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/eventSource/constants.js +1 -1
- package/dist/eventSource/constants.js.map +1 -1
- package/dist/eventSource/eventSource.d.ts +17 -0
- package/dist/eventSource/eventSource.js +2 -0
- package/dist/eventSource/eventSource.js.map +1 -0
- package/dist/eventSource/index.d.ts +2 -2
- package/dist/eventSource/index.js +1 -1
- package/dist/eventSource/index.js.map +1 -1
- package/dist/eventSource/types.d.ts +8 -19
- package/dist/eventSource/types.js.map +1 -1
- package/dist/hasher/hasher.js +1 -1
- package/dist/hasher/hasher.js.map +1 -1
- package/dist/hasher/index.js +1 -1
- package/dist/hasher/index.js.map +1 -1
- package/dist/index.d.ts +7 -6
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/kameleoonClient.d.ts +2 -207
- package/dist/kameleoonClient.js +1 -1
- package/dist/kameleoonClient.js.map +1 -1
- package/dist/kameleoonClientInterface.d.ts +199 -0
- package/dist/kameleoonClientInterface.js +2 -0
- package/dist/kameleoonClientInterface.js.map +1 -0
- package/dist/kameleoonData/applicationVersion.js +1 -1
- package/dist/kameleoonData/applicationVersion.js.map +1 -1
- package/dist/kameleoonData/browser.js +1 -1
- package/dist/kameleoonData/browser.js.map +1 -1
- package/dist/kameleoonData/constants.js +1 -1
- package/dist/kameleoonData/constants.js.map +1 -1
- package/dist/kameleoonData/conversion.js +1 -1
- package/dist/kameleoonData/conversion.js.map +1 -1
- package/dist/kameleoonData/cookie.js +1 -1
- package/dist/kameleoonData/cookie.js.map +1 -1
- package/dist/kameleoonData/customData.js +1 -1
- package/dist/kameleoonData/customData.js.map +1 -1
- package/dist/kameleoonData/dataManager.js +1 -1
- package/dist/kameleoonData/dataManager.js.map +1 -1
- package/dist/kameleoonData/dataProcessor.d.ts +2 -2
- package/dist/kameleoonData/dataProcessor.js +1 -1
- package/dist/kameleoonData/dataProcessor.js.map +1 -1
- package/dist/kameleoonData/device.js +1 -1
- package/dist/kameleoonData/device.js.map +1 -1
- package/dist/kameleoonData/geolocation.js +1 -1
- package/dist/kameleoonData/geolocation.js.map +1 -1
- package/dist/kameleoonData/helpers.js +1 -1
- package/dist/kameleoonData/helpers.js.map +1 -1
- package/dist/kameleoonData/index.js +1 -1
- package/dist/kameleoonData/operatingSystem.js +1 -1
- package/dist/kameleoonData/operatingSystem.js.map +1 -1
- package/dist/kameleoonData/pageView.js +1 -1
- package/dist/kameleoonData/pageView.js.map +1 -1
- package/dist/kameleoonData/types.d.ts +2 -2
- package/dist/kameleoonData/types.js +1 -1
- package/dist/kameleoonData/types.js.map +1 -1
- package/dist/kameleoonData/userAgent.js +1 -1
- package/dist/kameleoonData/userAgent.js.map +1 -1
- package/dist/kameleoonData/visitsData.js +1 -1
- package/dist/kameleoonData/visitsData.js.map +1 -1
- package/dist/kameleoonError/constants.d.ts +1 -0
- package/dist/kameleoonError/constants.js +1 -1
- package/dist/kameleoonError/constants.js.map +1 -1
- package/dist/kameleoonError/helpers.js.map +1 -1
- package/dist/kameleoonError/index.js +1 -1
- package/dist/kameleoonError/kameleoonError.d.ts +1 -1
- package/dist/kameleoonError/kameleoonError.js +1 -1
- package/dist/kameleoonError/kameleoonError.js.map +1 -1
- package/dist/kameleoonError/types.d.ts +1 -0
- package/dist/kameleoonError/types.js +1 -1
- package/dist/kameleoonError/types.js.map +1 -1
- package/dist/kameleoonUtils.js +1 -1
- package/dist/kameleoonUtils.js.map +1 -1
- package/dist/requester/constants.js +1 -1
- package/dist/requester/constants.js.map +1 -1
- package/dist/requester/index.js +1 -1
- package/dist/requester/requester.js +1 -1
- package/dist/requester/requester.js.map +1 -1
- package/dist/requester/types.js +1 -1
- package/dist/requester/types.js.map +1 -1
- package/dist/storage/constants.js +1 -1
- package/dist/storage/constants.js.map +1 -1
- package/dist/storage/index.d.ts +2 -1
- package/dist/storage/index.js +1 -1
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/storage.d.ts +13 -0
- package/dist/storage/storage.js +2 -0
- package/dist/storage/storage.js.map +1 -0
- package/dist/storage/types.d.ts +15 -30
- package/dist/storage/types.js.map +1 -1
- package/dist/targeting/conditions/applicationVersion.js +1 -1
- package/dist/targeting/conditions/applicationVersion.js.map +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/conversion.js +1 -1
- package/dist/targeting/conditions/conversion.js.map +1 -1
- package/dist/targeting/conditions/cookie.js +1 -1
- package/dist/targeting/conditions/cookie.js.map +1 -1
- package/dist/targeting/conditions/customData.js +1 -1
- package/dist/targeting/conditions/customData.js.map +1 -1
- package/dist/targeting/conditions/device.js +1 -1
- package/dist/targeting/conditions/device.js.map +1 -1
- package/dist/targeting/conditions/exclusiveCampaign.js +1 -1
- package/dist/targeting/conditions/exclusiveCampaign.js.map +1 -1
- 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.js +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/operatingSystem.js +1 -1
- package/dist/targeting/conditions/operatingSystem.js.map +1 -1
- package/dist/targeting/conditions/pageTitle.js +1 -1
- package/dist/targeting/conditions/pageTitle.js.map +1 -1
- package/dist/targeting/conditions/pageUrl.js +1 -1
- package/dist/targeting/conditions/pageUrl.js.map +1 -1
- package/dist/targeting/conditions/previousPage.js +1 -1
- package/dist/targeting/conditions/previousPage.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/sdkLanguage.js +1 -1
- package/dist/targeting/conditions/sdkLanguage.js.map +1 -1
- package/dist/targeting/conditions/segment.js +1 -1
- package/dist/targeting/conditions/segment.js.map +1 -1
- package/dist/targeting/conditions/targetFeatureFlag.js +1 -1
- package/dist/targeting/conditions/targetFeatureFlag.js.map +1 -1
- package/dist/targeting/conditions/visitedPages.js +1 -1
- package/dist/targeting/conditions/visitedPages.js.map +1 -1
- package/dist/targeting/conditions/visitorCode.js +1 -1
- package/dist/targeting/conditions/visitorCode.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.js +1 -1
- package/dist/targeting/node.js +1 -1
- package/dist/targeting/node.js.map +1 -1
- package/dist/targeting/tree.js +1 -1
- package/dist/targeting/tree.js.map +1 -1
- package/dist/targeting/types.js +1 -1
- package/dist/targeting/types.js.map +1 -1
- package/dist/types.d.ts +14 -26
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utilities/constants.js +1 -1
- package/dist/utilities/constants.js.map +1 -1
- package/dist/utilities/index.js +1 -1
- package/dist/utilities/types.d.ts +7 -7
- package/dist/utilities/types.js +1 -1
- package/dist/utilities/types.js.map +1 -1
- package/dist/utilities/utilities.js +1 -1
- package/dist/utilities/utilities.js.map +1 -1
- package/dist/variationConfiguration/index.js +1 -1
- package/dist/variationConfiguration/variationConfiguration.d.ts +3 -3
- package/dist/variationConfiguration/variationConfiguration.js +1 -1
- package/dist/variationConfiguration/variationConfiguration.js.map +1 -1
- package/dist/visitorCodeManager/constants.d.ts +3 -0
- package/dist/visitorCodeManager/constants.js +2 -0
- package/dist/visitorCodeManager/constants.js.map +1 -0
- package/dist/visitorCodeManager/index.d.ts +2 -0
- package/dist/visitorCodeManager/index.js +1 -1
- package/dist/visitorCodeManager/index.js.map +1 -1
- package/dist/visitorCodeManager/types.d.ts +7 -0
- package/dist/visitorCodeManager/types.js +2 -0
- package/dist/visitorCodeManager/types.js.map +1 -0
- package/dist/visitorCodeManager/visitorCodeManager.d.ts +11 -8
- package/dist/visitorCodeManager/visitorCodeManager.js +1 -1
- package/dist/visitorCodeManager/visitorCodeManager.js.map +1 -1
- package/package.json +4 -8
- package/dist/eventSource/externalEventSource.d.ts +0 -12
- package/dist/eventSource/externalEventSource.js +0 -2
- package/dist/eventSource/externalEventSource.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pageView.js","names":["PageView","
|
|
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","_listFromVisits","visits","resultData","pageViewMap","Map","i","visit","pageEvents","pageEvent","time","href","referrersIndices","pageView","has","existingTimestamps","get","set","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 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 _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":"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,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GAAIT,CAAW,CAACU,GAAG,CAACH,CAAI,CAAC,CAAE,CACzB,KAAM,CAAAI,CAAkB,CAAGX,CAAW,CAACY,GAAG,CAACL,CAAI,CAAC,CAAEzB,UAAU,CAE5D2B,CAAQ,CAAG,GAAI,CAAAnD,QAAQ,CAAC,CACtBG,UAAU,CAAE8C,CAAI,CAChB7C,KAAK,CAALA,CAAK,CACLC,SAAS,CAATA,CACF,CAAC,CAAC,CAEF8C,CAAQ,CAAC3B,UAAU,CAAG,CAAC,GAAG6B,CAAkB,CAAEL,CAAI,CACpD,CAAC,IACC,CAAAG,CAAQ,CAAG,GAAI,CAAAnD,QAAQ,CAAC,CACtBG,UAAU,CAAE8C,CAAI,CAChB7C,KAAK,CAALA,CAAK,CACLC,SAAS,CAATA,CACF,CAAC,CAAC,CAEF8C,CAAQ,CAAC3B,UAAU,CAAG,CAACwB,CAAI,CAAC,CAG9BN,CAAW,CAACa,GAAG,CAACN,CAAI,CAAEE,CAAQ,CAChC,CACF,CASA,MAPA,CAAAT,CAAW,CAACZ,OAAO,CAAEH,CAAK,EAAK,CAG7BA,CAAK,CAACD,MAAM,GAAO,CACnBe,CAAU,CAACe,IAAI,CAAC7B,CAAK,CACvB,CAAC,CAAC,CAEKc,CACT,CACF,CAACgB,OAAA,CAAAzD,QAAA,CAAAA,QAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TargetingDataType } from '../targeting';
|
|
2
|
-
import {
|
|
2
|
+
import { IStorage } from '../storage';
|
|
3
3
|
import { Browser, Conversion, Cookie, CustomData, Device, GeolocationData, OperatingSystem, PageView, UserAgent, ApplicationVersion, VisitsData } from '../kameleoonData';
|
|
4
4
|
export type UnsentVisitorTargetingDataType = Map<KameleoonData | number, KameleoonDataType | KameleoonDataType[]>;
|
|
5
5
|
export type UnsentTargetingDataType = {
|
|
@@ -26,7 +26,7 @@ export type NestedFieldParametersType = {
|
|
|
26
26
|
};
|
|
27
27
|
export type DataManagerParametersType = {
|
|
28
28
|
targetingCleanupInterval?: number;
|
|
29
|
-
storage:
|
|
29
|
+
storage: IStorage<TargetingDataType>;
|
|
30
30
|
};
|
|
31
31
|
export type KameleoonDataItemType = BrowserDataType | ConversionDataType | CustomDataType | DeviceDataType | PageViewDataType | UserAgentDataType | CookieDataType | GeolocationDataType | OperatingSystemDataType | ApplicationVersionDataType | VisitsDataType;
|
|
32
32
|
/**
|
|
@@ -1,2 +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;
|
|
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);
|
|
2
2
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +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 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":"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,IAiGb,CAAAa,UAAU,UAAVA,CAAU,QAAV,C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AAgB,EACpDJ,uBAAuB,CACxB,CAACnB,OAAA,CAAAsB,sBAAA,CAAAA,sBAAA,CAEK,GAAM,CAAAE,eAAe,EAAAC,gBAAA,IAAAJ,eAAA,CAAAI,gBAAA,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"}
|
|
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,CAAA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AAA,CAAG,CACrC,CAACD,mBAAmB,CAACsB,OAAO,EAAG,CAAC,CAChC,CAACtB,mBAAmB,CAACyB,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,2 +1,2 @@
|
|
|
1
|
-
"use strict";var _types=require("./types");Object.defineProperty(exports,"__esModule",{value:!0}),exports.UserAgent=void 0;function
|
|
1
|
+
"use strict";var _types=require("./types");Object.defineProperty(exports,"__esModule",{value:!0}),exports.UserAgent=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 UserAgent{constructor(a){_defineProperty(this,"value",void 0),_defineProperty(this,"sent",void 0),this.value=a,this.sent=!1}get url(){return""}get data(){return{value:this.value,type:_types.KameleoonData.UserAgent,sent:this.sent}}get isSent(){return this.sent}set isSent(a){this.sent=a}}exports.UserAgent=UserAgent;
|
|
2
2
|
//# sourceMappingURL=userAgent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userAgent.js","names":["_types","require","Object","defineProperty","exports","value","UserAgent","
|
|
1
|
+
{"version":3,"file":"userAgent.js","names":["_types","require","Object","defineProperty","exports","value","UserAgent","_defineProperty","a","b","c","_toPropertyKey","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","d","call","TypeError","String","Number","constructor","sent","url","data","type","KameleoonData","isSent"],"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,gBAAAC,CAAA,CAAAC,CAAA,CAAAC,CAAA,SAAAD,CAAA,CAAAE,cAAA,CAAAF,CAAA,EAAAA,CAAA,IAAAD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.defineProperty(exports,"__esModule",{value:!0}),exports.VisitsData=void 0;function
|
|
1
|
+
"use strict";var _types=require("./types");Object.defineProperty(exports,"__esModule",{value:!0}),exports.VisitsData=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 VisitsData{constructor(a,b){_defineProperty(this,"previousVisits",void 0),_defineProperty(this,"currentVisit",void 0),this.previousVisits=b,this.currentVisit=a}get url(){return""}get data(){return{currentVisit:this.currentVisit,previousVisits:this.previousVisits,type:_types.KameleoonData.VisitsData,sent:!0}}get isSent(){return!0}static _fromRemoteVisits(a,b){const c=[],d=b?1:0,e=b?a[0].timeStarted:null;for(let e=a.length-1;e>=d;e--){const b=a[e];c.push(b.timeStarted)}if(c.length||e)return new VisitsData(e,c)}}exports.VisitsData=VisitsData;
|
|
2
2
|
//# sourceMappingURL=visitsData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visitsData.js","names":["_types","require","Object","defineProperty","exports","value","VisitsData","
|
|
1
|
+
{"version":3,"file":"visitsData.js","names":["_types","require","Object","defineProperty","exports","value","VisitsData","_defineProperty","a","b","c","_toPropertyKey","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","d","call","TypeError","String","Number","constructor","currentVisit","previousVisits","url","data","type","KameleoonData","sent","isSent","_fromRemoteVisits","visits","hasCurrent","visitsList","limit","timeStarted","i","length","visit","push"],"sources":["../../src/kameleoonData/visitsData.ts"],"sourcesContent":["import { VisitType } from 'src/requester';\nimport { IKameleoonData, KameleoonData, VisitsDataType } from './types';\n\n/**\n * @class\n * Visits - a class for creating an instance of a stored visits data\n * */\nexport class VisitsData implements IKameleoonData {\n // --- Note ---\n // Ascending order\n private previousVisits: number[];\n private currentVisit: number | null;\n\n /**\n * @param {number} currentVisit - a current visit\n * @param {number[]} previousVisits - a list of previous visits\n * */\n constructor(currentVisit: number | null, previousVisits: number[]) {\n this.previousVisits = previousVisits;\n this.currentVisit = currentVisit;\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(): VisitsDataType {\n return {\n currentVisit: this.currentVisit,\n previousVisits: this.previousVisits,\n type: KameleoonData.VisitsData,\n sent: true,\n };\n }\n\n /**\n * @property isSent - signifying if the data was sent already tracked\n * */\n get isSent(): boolean {\n return true;\n }\n\n /**\n * @private\n * @method _fromRemoteVisits - an internal method for creating an instance of Visits class from a list of visits\n * @param {VisitType[]} visits - a list of visits\n * @returns {VisitsData | undefined} an instance of Visits class or undefined if there were not any visits\n * */\n public static _fromRemoteVisits(\n visits: VisitType[],\n hasCurrent: boolean,\n ): VisitsData | undefined {\n const visitsList: number[] = [];\n const limit = hasCurrent ? 1 : 0;\n const currentVisit = hasCurrent ? visits[0].timeStarted : null;\n\n // --- Note ---\n // Going backwards to get the latest visit data\n for (let i = visits.length - 1; i >= limit; i--) {\n const visit = visits[i];\n\n visitsList.push(visit.timeStarted);\n }\n\n if (visitsList.length || currentVisit) {\n return new VisitsData(currentVisit, visitsList);\n }\n }\n}\n"],"mappings":"aACA,IAAAA,MAAA,CAAAC,OAAA,YAAwEC,MAAA,CAAAC,cAAA,CAAAC,OAAA,eAAAC,KAAA,MAAAD,OAAA,CAAAE,UAAA,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,CA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,GAAI,CAAAC,CAAC,CAAGL,CAAM,CAACM,MAAM,CAAG,CAAC,CAAED,CAAC,EAAIF,CAAK,CAAEE,CAAC,EAAE,CAAE,CAC/C,KAAM,CAAAE,CAAK,CAAGP,CAAM,CAACK,CAAC,CAAC,CAEvBH,CAAU,CAACM,IAAI,CAACD,CAAK,CAACH,WAAW,CACnC,CAEA,GAAIF,CAAU,CAACI,MAAM,EAAIf,CAAY,CACnC,MAAO,IAAI,CAAAlB,UAAU,CAACkB,CAAY,CAAEW,CAAU,CAElD,CACF,CAAC/B,OAAA,CAAAE,UAAA,CAAAA,UAAA"}
|
|
@@ -20,6 +20,7 @@ export declare const ERROR_MESSAGES: {
|
|
|
20
20
|
VisitorCodeEmpty: () => string;
|
|
21
21
|
StorageWrite: (err: unknown) => string;
|
|
22
22
|
StorageRead: (key: KameleoonStorageKey) => string;
|
|
23
|
+
StorageEmpty: () => string;
|
|
23
24
|
StorageParse: (err: unknown, key: KameleoonStorageKey) => string;
|
|
24
25
|
ClientConfiguration: () => string;
|
|
25
26
|
TargetingCondition: (targetingType: TargetingType) => string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";var _types=require("./types");Object.defineProperty(exports,"__esModule",{value:!0}),exports.ERROR_MESSAGES=void 0;const ERROR_MESSAGES=exports.ERROR_MESSAGES={[_types.KameleoonException.CookieParse]:a=>"Couldn't parse cookie string: ".concat(a),[_types.KameleoonException.JSONParse]:a=>"Couldn't parse JSON variable: ".concat(a),[_types.KameleoonException.NumberParse]:a=>"It's not possible to parse value ".concat(a," to Number"),[_types.KameleoonException.VersionParse]:a=>"It's not possible to parse a version value ".concat(a," to Number, version should be in format x.x"),[_types.KameleoonException.SemanticVersionParse]:a=>"It's not possible to parse a version value ".concat(a," to Number, version should be in format x.x.x"),[_types.KameleoonException.Initialization]:()=>"It seems that the client wasn't properly initialized, make sure to run `initialize` method before invoking other methods",[_types.KameleoonException.Credentials]:()=>"KameleoonClient can not be created without credentials",[_types.KameleoonException.StorageInitialization]:()=>"There was an error while initializing React Native SDK storage, it seems that the storage library dependency wasn't installed",[_types.KameleoonException.EventSourceInitialization]:()=>"There was an error while initializing Real Time Update service, it seems that the event source library dependency wasn't installed",[_types.KameleoonException.FeatureFlagConfigurationNotFound]:a=>"No feature flag with key ".concat(a," was found."),[_types.KameleoonException.FeatureFlagEnvironmentDisabled]:(a,b)=>"Feature flag with key ".concat(a," is disabled in ").concat(b," environment."),[_types.KameleoonException.FeatureFlagVariableNotFound]:(a,b)=>"No feature flag variable with key ".concat(a," was found for ").concat(b," visitorCode."),[_types.KameleoonException.FeatureFlagVariationNotFound]:(a,b)=>"No feature flag variation with key ".concat(a," was found for ").concat(b," visitorCode."),[_types.KameleoonException.NotTargeted]:a=>"Visitor code ".concat(a," is not targeted"),[_types.KameleoonException.VisitAmount]:()=>"Visit amount must be a number between 1 and 25",[_types.KameleoonException.VisitorCodeMaxLength]:()=>"Visitor code can not be more than 255 characters long",[_types.KameleoonException.VisitorCodeEmpty]:()=>"Visitor code can not be empty",[_types.KameleoonException.StorageWrite]:a=>"Couldn't update storage for kameleoonClient: ".concat(a),[_types.KameleoonException.StorageRead]:a=>"No data found in storage under ".concat(a," key"),[_types.KameleoonException.StorageEmpty]:()=>"No data found in storage",[_types.KameleoonException.StorageParse]:(a,b)=>"Couldn't parse ".concat(b," storage data, the data may be corrupted. Error: ").concat(a),[_types.KameleoonException.ClientConfiguration]:()=>"Couldn't retrieve client configuration from Kameleoon Api",[_types.KameleoonException.TargetingCondition]:a=>"".concat(a," targeting condition is not yet supported."),[_types.KameleoonException.AmongValuesCheck]:(a,b)=>"Couldn't parse value \"".concat(b,"\": ").concat(a),[_types.KameleoonException.RemoteData]:()=>"Couldn't retrieve data from Kameleoon server",[_types.KameleoonException.MaximumRetriesReached]:()=>"Maximum retries reached, request failed"};
|
|
2
2
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":["
|
|
1
|
+
{"version":3,"file":"constants.js","names":["_types","require","Object","defineProperty","exports","value","ERROR_MESSAGES","KameleoonException","CookieParse","reason","concat","JSONParse","err","NumberParse","VersionParse","SemanticVersionParse","Initialization","Credentials","StorageInitialization","EventSourceInitialization","FeatureFlagConfigurationNotFound","featureKey","FeatureFlagEnvironmentDisabled","environment","FeatureFlagVariableNotFound","variableKey","visitorCode","FeatureFlagVariationNotFound","variationKey","NotTargeted","VisitAmount","VisitorCodeMaxLength","VisitorCodeEmpty","StorageWrite","StorageRead","key","StorageEmpty","StorageParse","ClientConfiguration","TargetingCondition","targetingType","AmongValuesCheck","RemoteData","MaximumRetriesReached"],"sources":["../../src/kameleoonError/constants.ts"],"sourcesContent":["import { KameleoonStorageKey } from 'src/storage';\nimport { TargetingType } from 'src/targeting';\nimport { KameleoonException } from './types';\n\nexport const ERROR_MESSAGES = {\n [KameleoonException.CookieParse]: (reason: string) =>\n `Couldn't parse cookie string: ${reason}`,\n [KameleoonException.JSONParse]: (err: unknown) =>\n `Couldn't parse JSON variable: ${err}`,\n [KameleoonException.NumberParse]: (value: string) =>\n `It's not possible to parse value ${value} to Number`,\n [KameleoonException.VersionParse]: (value: string) =>\n `It's not possible to parse a version value ${value} to Number, version should be in format x.x`,\n [KameleoonException.SemanticVersionParse]: (value: string) =>\n `It's not possible to parse a version value ${value} to Number, version should be in format x.x.x`,\n [KameleoonException.Initialization]: () =>\n \"It seems that the client wasn't properly initialized, make sure to run `initialize` method before invoking other methods\",\n [KameleoonException.Credentials]: () =>\n 'KameleoonClient can not be created without credentials',\n [KameleoonException.StorageInitialization]: () =>\n \"There was an error while initializing React Native SDK storage, it seems that the storage library dependency wasn't installed\",\n [KameleoonException.EventSourceInitialization]: () =>\n \"There was an error while initializing Real Time Update service, it seems that the event source library dependency wasn't installed\",\n [KameleoonException.FeatureFlagConfigurationNotFound]: (featureKey: string) =>\n `No feature flag with key ${featureKey} was found.`,\n [KameleoonException.FeatureFlagEnvironmentDisabled]: (\n featureKey: string,\n environment: string,\n ) =>\n `Feature flag with key ${featureKey} is disabled in ${environment} environment.`,\n [KameleoonException.FeatureFlagVariableNotFound]: (\n variableKey: string,\n visitorCode: string,\n ) =>\n `No feature flag variable with key ${variableKey} was found for ${visitorCode} visitorCode.`,\n [KameleoonException.FeatureFlagVariationNotFound]: (\n variationKey: string,\n visitorCode: string,\n ) =>\n `No feature flag variation with key ${variationKey} was found for ${visitorCode} visitorCode.`,\n [KameleoonException.NotTargeted]: (visitorCode: string) =>\n `Visitor code ${visitorCode} is not targeted`,\n [KameleoonException.VisitAmount]: () =>\n 'Visit amount must be a number between 1 and 25',\n [KameleoonException.VisitorCodeMaxLength]: () =>\n 'Visitor code can not be more than 255 characters long',\n [KameleoonException.VisitorCodeEmpty]: () => 'Visitor code can not be empty',\n [KameleoonException.StorageWrite]: (err: unknown) =>\n `Couldn't update storage for kameleoonClient: ${err}`,\n [KameleoonException.StorageRead]: (key: KameleoonStorageKey) =>\n `No data found in storage under ${key} key`,\n [KameleoonException.StorageEmpty]: () => 'No data found in storage',\n [KameleoonException.StorageParse]: (err: unknown, key: KameleoonStorageKey) =>\n `Couldn't parse ${key} storage data, the data may be corrupted. Error: ${err}`,\n [KameleoonException.ClientConfiguration]: () =>\n \"Couldn't retrieve client configuration from Kameleoon Api\",\n [KameleoonException.TargetingCondition]: (targetingType: TargetingType) =>\n `${targetingType} targeting condition is not yet supported.`,\n [KameleoonException.AmongValuesCheck]: (err: unknown, value: string) =>\n `Couldn't parse value \"${value}\": ${err}`,\n [KameleoonException.RemoteData]: () =>\n `Couldn't retrieve data from Kameleoon server`,\n [KameleoonException.MaximumRetriesReached]: () =>\n `Maximum retries reached, request failed`,\n};\n"],"mappings":"aAEA,IAAAA,MAAA,CAAAC,OAAA,YAA6CC,MAAA,CAAAC,cAAA,CAAAC,OAAA,eAAAC,KAAA,MAAAD,OAAA,CAAAE,cAAA,QAEtC,KAAM,CAAAA,cAAc,CAAAF,OAAA,CA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C/C,CAACnB,yBAAkB,CAACuB,WAAW,EAAG,IAChC,gDAAgD,CAClD,CAACvB,yBAAkB,CAACwB,oBAAoB,EAAG,IACzC,uDAAuD,CACzD,CAACxB,yBAAkB,CAACyB,gBAAgB,EAAG,IAAM,+BAA+B,CAC5E,CAACzB,yBAAkB,CAAC0B,YAAY,EAAIrB,CAAY,kDAAAF,MAAA,CACEE,CAAG,CAAE,CACvD,CAACL,yBAAkB,CAAC2B,WAAW,EAAIC,CAAwB,oCAAAzB,MAAA,CACvByB,CAAG,QAAM,CAC7C,CAAC5B,yBAAkB,CAAC6B,YAAY,EAAG,IAAM,0BAA0B,CACnE,CAAC7B,yBAAkB,CAAC8B,YAAY,EAAG,CAACzB,CAAY,CAAEuB,CAAwB,qBAAAzB,MAAA,CACtDyB,CAAG,sDAAAzB,MAAA,CAAoDE,CAAG,CAAE,CAChF,CAACL,yBAAkB,CAAC+B,mBAAmB,EAAG,IACxC,2DAA2D,CAC7D,CAAC/B,yBAAkB,CAACgC,kBAAkB,EAAIC,CAA4B,KAAA9B,MAAA,CACjE8B,CAAa,8CAA4C,CAC9D,CAACjC,yBAAkB,CAACkC,gBAAgB,EAAG,CAAC7B,CAAY,CAAEP,CAAa,6BAAAK,MAAA,CACxCL,CAAK,SAAAK,MAAA,CAAME,CAAG,CAAE,CAC3C,CAACL,yBAAkB,CAACmC,UAAU,EAAG,kDACe,CAChD,CAACnC,yBAAkB,CAACoC,qBAAqB,EAAG,6CAE9C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","names":["exhaustCheck","option","Error","concat"],"sources":["../../src/kameleoonError/helpers.ts"],"sourcesContent":["export function exhaustCheck(option: never): never {\n throw new Error(`Reaching an impossible state because of ${option}`);\n}\n"],"mappings":"sGAAO,QAAS,CAAAA,YAAYA,CAACC,CAAa,CAAS,CACjD,KAAM,IAAI,CAAAC,KAAK,4CAAAC,MAAA,CAA4CF,CAAM,
|
|
1
|
+
{"version":3,"file":"helpers.js","names":["exhaustCheck","option","Error","concat"],"sources":["../../src/kameleoonError/helpers.ts"],"sourcesContent":["export function exhaustCheck(option: never): never {\n throw new Error(`Reaching an impossible state because of ${option}`);\n}\n"],"mappings":"sGAAO,QAAS,CAAAA,YAAYA,CAACC,CAAa,CAAS,CACjD,KAAM,IAAI,CAAAC,KAAK,4CAAAC,MAAA,CAA4CF,CAAM,CAAE,CACrE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"KameleoonError",{enumerable:!0,get:function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"KameleoonError",{enumerable:!0,get:function(){return _kameleoonError.KameleoonError}}),Object.defineProperty(exports,"KameleoonException",{enumerable:!0,get:function(){return _types.KameleoonException}}),Object.defineProperty(exports,"exhaustCheck",{enumerable:!0,get:function(){return _helpers.exhaustCheck}});var _kameleoonError=require("./kameleoonError"),_types=require("./types"),_helpers=require("./helpers");
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -10,7 +10,7 @@ export declare class KameleoonError extends Error {
|
|
|
10
10
|
/**
|
|
11
11
|
* @param {KameleoonException} type - type of KameleoonError represented by `KameleoonException` enum
|
|
12
12
|
* */
|
|
13
|
-
constructor(type: KameleoonException.Initialization | KameleoonException.Credentials | KameleoonException.ClientConfiguration | KameleoonException.VisitorCodeMaxLength | KameleoonException.VisitorCodeEmpty | KameleoonException.VisitAmount | KameleoonException.StorageInitialization | KameleoonException.EventSourceInitialization | KameleoonException.RemoteData | KameleoonException.MaximumRetriesReached);
|
|
13
|
+
constructor(type: KameleoonException.Initialization | KameleoonException.Credentials | KameleoonException.ClientConfiguration | KameleoonException.VisitorCodeMaxLength | KameleoonException.VisitorCodeEmpty | KameleoonException.VisitAmount | KameleoonException.StorageInitialization | KameleoonException.EventSourceInitialization | KameleoonException.RemoteData | KameleoonException.MaximumRetriesReached | KameleoonException.StorageEmpty);
|
|
14
14
|
constructor(type: KameleoonException.FeatureFlagConfigurationNotFound | KameleoonException.FeatureFlagEnvironmentDisabled, featureKey: string);
|
|
15
15
|
constructor(type: KameleoonException.FeatureFlagConfigurationNotFound | KameleoonException.FeatureFlagEnvironmentDisabled, featureKey: string, environment: string);
|
|
16
16
|
constructor(type: KameleoonException.FeatureFlagVariableNotFound, variableKey: string, visitorCode: string);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.KameleoonError=void 0;var _constants=require("./constants"),_helpers=require("./helpers"),_types=require("./types");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.KameleoonError=void 0;var _constants=require("./constants"),_helpers=require("./helpers"),_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 KameleoonError extends Error{constructor(a,b,c){super("Error: ".concat(a)),_defineProperty(this,"errorType",void 0),this.name="KameleoonError",this.errorType=a;a===_types.KameleoonException.Initialization||a===_types.KameleoonException.Credentials||a===_types.KameleoonException.ClientConfiguration||a===_types.KameleoonException.VisitorCodeMaxLength||a===_types.KameleoonException.VisitorCodeEmpty||a===_types.KameleoonException.StorageInitialization||a===_types.KameleoonException.VisitAmount||a===_types.KameleoonException.EventSourceInitialization||a===_types.KameleoonException.RemoteData||a===_types.KameleoonException.MaximumRetriesReached||a===_types.KameleoonException.StorageEmpty?this.message=_constants.ERROR_MESSAGES[a]():a===_types.KameleoonException.CookieParse||a===_types.KameleoonException.NotTargeted||a===_types.KameleoonException.FeatureFlagConfigurationNotFound||a===_types.KameleoonException.NumberParse||a===_types.KameleoonException.VersionParse||a===_types.KameleoonException.SemanticVersionParse?this.message=_constants.ERROR_MESSAGES[a](b):a===_types.KameleoonException.FeatureFlagVariationNotFound||a===_types.KameleoonException.FeatureFlagEnvironmentDisabled||a===_types.KameleoonException.FeatureFlagVariableNotFound?this.message=_constants.ERROR_MESSAGES[a](b,c):a===_types.KameleoonException.StorageWrite||a===_types.KameleoonException.JSONParse?this.message=_constants.ERROR_MESSAGES[a](b):a===_types.KameleoonException.StorageRead?this.message=_constants.ERROR_MESSAGES[a](b):a===_types.KameleoonException.StorageParse?this.message=_constants.ERROR_MESSAGES[a](b,c):a===_types.KameleoonException.TargetingCondition?this.message=_constants.ERROR_MESSAGES[a](b):a===_types.KameleoonException.AmongValuesCheck?this.message=_constants.ERROR_MESSAGES[a](b,c):(0,_helpers.exhaustCheck)(a)}get type(){return this.errorType}}exports.KameleoonError=KameleoonError;
|
|
2
2
|
//# sourceMappingURL=kameleoonError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kameleoonError.js","names":["KameleoonError","
|
|
1
|
+
{"version":3,"file":"kameleoonError.js","names":["KameleoonError","Error","constructor","type","secondParam","thirdParam","concat","_defineProperty","name","errorType","KameleoonException","Initialization","Credentials","ClientConfiguration","VisitorCodeMaxLength","VisitorCodeEmpty","StorageInitialization","VisitAmount","EventSourceInitialization","RemoteData","MaximumRetriesReached","StorageEmpty","message","ERROR_MESSAGES","CookieParse","NotTargeted","FeatureFlagConfigurationNotFound","NumberParse","VersionParse","SemanticVersionParse","FeatureFlagVariationNotFound","FeatureFlagEnvironmentDisabled","FeatureFlagVariableNotFound","StorageWrite","JSONParse","StorageRead","StorageParse","TargetingCondition","AmongValuesCheck","exhaustCheck","exports"],"sources":["../../src/kameleoonError/kameleoonError.ts"],"sourcesContent":["import { KameleoonStorageKey } from 'src/storage';\nimport { TargetingType } from 'src/targeting';\nimport { ERROR_MESSAGES } from './constants';\nimport { exhaustCheck } from './helpers';\nimport { KameleoonException } from './types';\n\n/**\n * @class\n * KameleoonError - extends standard `Error` by adding custom `type` property with the type of `KameleoonException`\n * */\nexport class KameleoonError extends Error {\n private errorType: KameleoonException;\n\n /**\n * @param {KameleoonException} type - type of KameleoonError represented by `KameleoonException` enum\n * */\n constructor(\n type:\n | KameleoonException.Initialization\n | KameleoonException.Credentials\n | KameleoonException.ClientConfiguration\n | KameleoonException.VisitorCodeMaxLength\n | KameleoonException.VisitorCodeEmpty\n | KameleoonException.VisitAmount\n | KameleoonException.StorageInitialization\n | KameleoonException.EventSourceInitialization\n | KameleoonException.RemoteData\n | KameleoonException.MaximumRetriesReached\n | KameleoonException.StorageEmpty,\n );\n constructor(\n type:\n | KameleoonException.FeatureFlagConfigurationNotFound\n | KameleoonException.FeatureFlagEnvironmentDisabled,\n featureKey: string,\n );\n constructor(\n type:\n | KameleoonException.FeatureFlagConfigurationNotFound\n | KameleoonException.FeatureFlagEnvironmentDisabled,\n featureKey: string,\n environment: string,\n );\n constructor(\n type: KameleoonException.FeatureFlagVariableNotFound,\n variableKey: string,\n visitorCode: string,\n );\n constructor(\n type: KameleoonException.FeatureFlagVariationNotFound,\n variationKey: string,\n visitorCode: string,\n );\n constructor(type: KameleoonException.NotTargeted, visitorCode: string);\n constructor(type: KameleoonException.CookieParse, message: string);\n constructor(\n type: KameleoonException.StorageWrite | KameleoonException.JSONParse,\n err: unknown,\n );\n constructor(type: KameleoonException.StorageRead, storageKey: string);\n constructor(\n type: KameleoonException.StorageParse,\n err: unknown,\n key: KameleoonStorageKey,\n );\n constructor(\n type: KameleoonException.TargetingCondition,\n targetingType: TargetingType,\n );\n constructor(\n type: KameleoonException.AmongValuesCheck,\n err: unknown,\n value: string,\n );\n constructor(\n type:\n | KameleoonException.NumberParse\n | KameleoonException.VersionParse\n | KameleoonException.SemanticVersionParse,\n value: string,\n );\n constructor(\n type: KameleoonException,\n secondParam?:\n | number\n | string\n | unknown\n | KameleoonStorageKey\n | TargetingType,\n thirdParam?: string | KameleoonStorageKey,\n ) {\n super(`Error: ${type}`);\n\n this.name = 'KameleoonError';\n this.errorType = type;\n\n switch (type) {\n case KameleoonException.Initialization:\n case KameleoonException.Credentials:\n case KameleoonException.ClientConfiguration:\n case KameleoonException.VisitorCodeMaxLength:\n case KameleoonException.VisitorCodeEmpty:\n case KameleoonException.StorageInitialization:\n case KameleoonException.VisitAmount:\n case KameleoonException.EventSourceInitialization:\n case KameleoonException.RemoteData:\n case KameleoonException.MaximumRetriesReached:\n case KameleoonException.StorageEmpty:\n this.message = ERROR_MESSAGES[type]();\n break;\n case KameleoonException.CookieParse:\n case KameleoonException.NotTargeted:\n case KameleoonException.FeatureFlagConfigurationNotFound:\n case KameleoonException.NumberParse:\n case KameleoonException.VersionParse:\n case KameleoonException.SemanticVersionParse:\n this.message = ERROR_MESSAGES[type](secondParam as string);\n break;\n case KameleoonException.FeatureFlagVariationNotFound:\n case KameleoonException.FeatureFlagEnvironmentDisabled:\n case KameleoonException.FeatureFlagVariableNotFound:\n this.message = ERROR_MESSAGES[type](\n secondParam as string,\n thirdParam as string,\n );\n break;\n case KameleoonException.StorageWrite:\n case KameleoonException.JSONParse:\n this.message = ERROR_MESSAGES[type](secondParam);\n break;\n case KameleoonException.StorageRead:\n this.message = ERROR_MESSAGES[type](secondParam as KameleoonStorageKey);\n break;\n case KameleoonException.StorageParse:\n this.message = ERROR_MESSAGES[type](\n secondParam,\n thirdParam as KameleoonStorageKey,\n );\n break;\n case KameleoonException.TargetingCondition:\n this.message = ERROR_MESSAGES[type](secondParam as TargetingType);\n break;\n case KameleoonException.AmongValuesCheck:\n this.message = ERROR_MESSAGES[type](secondParam, thirdParam as string);\n break;\n default:\n exhaustCheck(type);\n }\n }\n\n get type(): KameleoonException {\n return this.errorType;\n }\n}\n"],"mappings":"msBAUO,KAAM,CAAAA,cAAc,QAAS,CAAAC,KAAM,CAuExCC,WAAWA,CACT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ACjD,IAAI,CAACV,OAAO,CAAGC,yBAAc,CAACpB,CAAI,CAAC,CACjCC,CAAW,CACXC,CACF,CAAC,CA5BGF,CAAI,GA8BLO,yBAAkB,CAACuB,YAAY,EA9B9B9B,CAAI,GA+BLO,yBAAkB,CAACwB,SAAS,CAC/B,IAAI,CAACZ,OAAO,CAAGC,yBAAc,CAACpB,CAAI,CAAC,CAACC,CAAW,CAAC,CAhC5CD,CAAI,GAkCLO,yBAAkB,CAACyB,WAAW,CACjC,IAAI,CAACb,OAAO,CAAGC,yBAAc,CAACpB,CAAI,CAAC,CAACC,CAAkC,CAAC,CAnCnED,CAAI,GAqCLO,yBAAkB,CAAC0B,YAAY,CAClC,IAAI,CAACd,OAAO,CAAGC,yBAAc,CAACpB,CAAI,CAAC,CACjCC,CAAW,CACXC,CACF,CAAC,CAzCGF,CAAI,GA2CLO,yBAAkB,CAAC2B,kBAAkB,CACxC,IAAI,CAACf,OAAO,CAAGC,yBAAc,CAACpB,CAAI,CAAC,CAACC,CAA4B,CAAC,CA5C7DD,CAAI,GA8CLO,yBAAkB,CAAC4B,gBAAgB,CACtC,IAAI,CAAChB,OAAO,CAAGC,yBAAc,CAACpB,CAAI,CAAC,CAACC,CAAW,CAAEC,CAAoB,CAAC,CAGtE,GAAAkC,qBAAY,EAACpC,CAAI,CAEvB,CAEA,GAAI,CAAAA,IAAIA,CAAA,CAAuB,CAC7B,MAAO,KAAI,CAACM,SACd,CACF,CAAC+B,OAAA,CAAAxC,cAAA,CAAAA,cAAA"}
|
|
@@ -17,6 +17,7 @@ export declare enum KameleoonException {
|
|
|
17
17
|
StorageWrite = "StorageWrite",
|
|
18
18
|
StorageRead = "StorageRead",
|
|
19
19
|
StorageParse = "StorageParse",
|
|
20
|
+
StorageEmpty = "StorageEmpty",
|
|
20
21
|
ClientConfiguration = "ClientConfiguration",
|
|
21
22
|
TargetingCondition = "TargetingCondition",
|
|
22
23
|
AmongValuesCheck = "AmongValuesCheck",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.KameleoonException=void 0;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.KameleoonException=void 0;let KameleoonException=exports.KameleoonException=function(a){return a.Credentials="Credentials",a.EventSourceInitialization="EventSourceInitialization",a.FeatureFlagConfigurationNotFound="FeatureFlagConfigurationNotFound",a.FeatureFlagVariableNotFound="FeatureFlagVariableNotFound",a.FeatureFlagVariationNotFound="FeatureFlagVariationNotFound",a.FeatureFlagEnvironmentDisabled="FeatureFlagEnvironmentDisabled",a.NotTargeted="NotTargeted",a.VisitAmount="VisitAmount",a.VisitorCodeMaxLength="VisitorCodeMaxLength",a.VisitorCodeEmpty="VisitorCodeEmpty",a.StorageInitialization="StorageInitialization",a.StorageWrite="StorageWrite",a.StorageRead="StorageRead",a.StorageParse="StorageParse",a.StorageEmpty="StorageEmpty",a.ClientConfiguration="ClientConfiguration",a.TargetingCondition="TargetingCondition",a.AmongValuesCheck="AmongValuesCheck",a.Initialization="Initialization",a.JSONParse="JSONParse",a.NumberParse="NumberParse",a.VersionParse="VersionParse",a.CookieParse="CookieParse",a.SemanticVersionParse="SemanticVersionParse",a.RemoteData="RemoteData",a.MaximumRetriesReached="MaximumRetriesReached",a}({});
|
|
2
2
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["KameleoonException","Credentials","EventSourceInitialization","FeatureFlagConfigurationNotFound","FeatureFlagVariableNotFound","FeatureFlagVariationNotFound","FeatureFlagEnvironmentDisabled","NotTargeted","VisitAmount","VisitorCodeMaxLength","VisitorCodeEmpty","StorageInitialization","StorageWrite","StorageRead","StorageParse","ClientConfiguration","TargetingCondition","AmongValuesCheck","Initialization","JSONParse","NumberParse","VersionParse","CookieParse","SemanticVersionParse","RemoteData","MaximumRetriesReached"
|
|
1
|
+
{"version":3,"file":"types.js","names":["KameleoonException","exports","Credentials","EventSourceInitialization","FeatureFlagConfigurationNotFound","FeatureFlagVariableNotFound","FeatureFlagVariationNotFound","FeatureFlagEnvironmentDisabled","NotTargeted","VisitAmount","VisitorCodeMaxLength","VisitorCodeEmpty","StorageInitialization","StorageWrite","StorageRead","StorageParse","StorageEmpty","ClientConfiguration","TargetingCondition","AmongValuesCheck","Initialization","JSONParse","NumberParse","VersionParse","CookieParse","SemanticVersionParse","RemoteData","MaximumRetriesReached"],"sources":["../../src/kameleoonError/types.ts"],"sourcesContent":["/**\n * @readonly\n * @enum {string} an Enum containing all possible variants of exception types `KameleoonError`\n * */\nexport enum KameleoonException {\n Credentials = 'Credentials',\n EventSourceInitialization = 'EventSourceInitialization',\n FeatureFlagConfigurationNotFound = 'FeatureFlagConfigurationNotFound',\n FeatureFlagVariableNotFound = 'FeatureFlagVariableNotFound',\n FeatureFlagVariationNotFound = 'FeatureFlagVariationNotFound',\n FeatureFlagEnvironmentDisabled = 'FeatureFlagEnvironmentDisabled',\n NotTargeted = 'NotTargeted',\n VisitAmount = 'VisitAmount',\n VisitorCodeMaxLength = 'VisitorCodeMaxLength',\n VisitorCodeEmpty = 'VisitorCodeEmpty',\n StorageInitialization = 'StorageInitialization',\n StorageWrite = 'StorageWrite',\n StorageRead = 'StorageRead',\n StorageParse = 'StorageParse',\n StorageEmpty = 'StorageEmpty',\n ClientConfiguration = 'ClientConfiguration',\n TargetingCondition = 'TargetingCondition',\n AmongValuesCheck = 'AmongValuesCheck',\n Initialization = 'Initialization',\n JSONParse = 'JSONParse',\n NumberParse = 'NumberParse',\n VersionParse = 'VersionParse',\n CookieParse = 'CookieParse',\n SemanticVersionParse = 'SemanticVersionParse',\n RemoteData = 'RemoteData',\n MaximumRetriesReached = 'MaximumRetriesReached',\n}\n"],"mappings":"yGAIY,CAAAA,kBAAkB,CAAAC,OAAA,CAAAD,kBAAA,UAAlBA,CAAkB,QAAlB,CAAAA,CAAkB,CAAAE,WAAA,eAAlBF,CAAkB,CAAAG,yBAAA,6BAAlBH,CAAkB,CAAAI,gCAAA,oCAAlBJ,CAAkB,CAAAK,2BAAA,+BAAlBL,CAAkB,CAAAM,4BAAA,gCAAlBN,CAAkB,CAAAO,8BAAA,kCAAlBP,CAAkB,CAAAQ,WAAA,eAAlBR,CAAkB,CAAAS,WAAA,eAAlBT,CAAkB,CAAAU,oBAAA,wBAAlBV,CAAkB,CAAAW,gBAAA,oBAAlBX,CAAkB,CAAAY,qBAAA,yBAAlBZ,CAAkB,CAAAa,YAAA,gBAAlBb,CAAkB,CAAAc,WAAA,eAAlBd,CAAkB,CAAAe,YAAA,gBAAlBf,CAAkB,CAAAgB,YAAA,gBAAlBhB,CAAkB,CAAAiB,mBAAA,uBAAlBjB,CAAkB,CAAAkB,kBAAA,sBAAlBlB,CAAkB,CAAAmB,gBAAA,oBAAlBnB,CAAkB,CAAAoB,cAAA,kBAAlBpB,CAAkB,CAAAqB,SAAA,aAAlBrB,CAAkB,CAAAsB,WAAA,eAAlBtB,CAAkB,CAAAuB,YAAA,gBAAlBvB,CAAkB,CAAAwB,WAAA,eAAlBxB,CAAkB,CAAAyB,oBAAA,wBAAlBzB,CAAkB,CAAA0B,UAAA,cAAlB1B,CAAkB,CAAA2B,qBAAA,yBAAlB3B,CAAkB"}
|
package/dist/kameleoonUtils.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var _requester=require("./requester");Object.defineProperty(exports,"__esModule",{value:!0}),exports.KameleoonUtils=void 0;
|
|
1
|
+
"use strict";var _requester=require("./requester");Object.defineProperty(exports,"__esModule",{value:!0}),exports.KameleoonUtils=void 0;class KameleoonUtils{getClientConfigurationUrl(a,b){return b?_requester.URL.CLIENT_CONFIGURATION+a+_requester.UrlFirstParameter.Environment+b:_requester.URL.CLIENT_CONFIGURATION+a}}exports.KameleoonUtils=KameleoonUtils;
|
|
2
2
|
//# sourceMappingURL=kameleoonUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kameleoonUtils.js","names":["_requester","require","Object","defineProperty","exports","value","KameleoonUtils","
|
|
1
|
+
{"version":3,"file":"kameleoonUtils.js","names":["_requester","require","Object","defineProperty","exports","value","KameleoonUtils","getClientConfigurationUrl","siteCode","environment","URL","CLIENT_CONFIGURATION","UrlFirstParameter","Environment"],"sources":["../src/kameleoonUtils.ts"],"sourcesContent":["import { URL, UrlFirstParameter } from './requester';\nimport { Environment } from './types';\n\n/**\n * @abstract\n * KameleoonUtils - an abstract class for extending kameleoon utils with pre-defined method signatures\n * */\nexport abstract class KameleoonUtils {\n protected getClientConfigurationUrl(\n siteCode: string,\n environment?: Environment,\n ): string {\n if (environment) {\n return (\n URL.CLIENT_CONFIGURATION +\n siteCode +\n UrlFirstParameter.Environment +\n environment\n );\n }\n\n return URL.CLIENT_CONFIGURATION + siteCode;\n }\n}\n"],"mappings":"aAAA,IAAAA,UAAA,CAAAC,OAAA,gBAAqDC,MAAA,CAAAC,cAAA,CAAAC,OAAA,eAAAC,KAAA,MAAAD,OAAA,CAAAE,cAAA,QAO9C,KAAe,CAAAA,cAAe,CACzBC,yBAAyBA,CACjCC,CAAgB,CAChBC,CAAyB,CACjB,OACJ,CAAAA,CAAW,CAEXC,cAAG,CAACC,oBAAoB,CACxBH,CAAQ,CACRI,4BAAiB,CAACC,WAAW,CAC7BJ,CAAW,CAIRC,cAAG,CAACC,oBAAoB,CAAGH,CACpC,CACF,CAACJ,OAAA,CAAAE,cAAA,CAAAA,cAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.UrlTracking=exports.UrlQuery=exports.UrlParameter=exports.UrlFirstParameter=exports.UrlEventType=exports.URL=exports.RETRIES_DELAY=exports.NUMBER_OF_RETRIES=exports.Header=exports.DEFAULT_REQUEST_TIMEOUT=void 0;
|
|
1
|
+
"use strict";var _types=require("../types");Object.defineProperty(exports,"__esModule",{value:!0}),exports.UrlTracking=exports.UrlQuery=exports.UrlParameter=exports.UrlFirstParameter=exports.UrlEventType=exports.URL=exports.RETRIES_DELAY=exports.NUMBER_OF_RETRIES=exports.Header=exports.DEFAULT_REQUEST_TIMEOUT=void 0;const DEFAULT_REQUEST_TIMEOUT=exports.DEFAULT_REQUEST_TIMEOUT=10*_types.Milliseconds.Second,RETRIES_DELAY=exports.RETRIES_DELAY=5*_types.Milliseconds.Second,NUMBER_OF_RETRIES=exports.NUMBER_OF_RETRIES=3;let Header=exports.Header=function(a){return a.UserAgent="User-Agent",a.ContentType="Content-Type",a.SdkVersion="X-Kameleoon-SDK-Version",a.SdkType="X-Kameleoon-SDK-Type",a.Authorization="Authorization",a.AcceptEncoding="Accept-Encoding",a}({});const UrlEventType=exports.UrlEventType={CustomData:"eventType=customData",StaticData:"eventType=staticData",Page:"eventType=page",Conversion:"eventType=conversion",Activity:"eventType=activity",Experiment:"eventType=experiment",Geolocation:"eventType=geolocation"},UrlParameter=exports.UrlParameter={Title:"&title=",ReferrersIndices:"&referrersIndices=",Negative:"&negative=",Revenue:"&revenue=",Overwrite:"&overwrite=",Index:"&index=",BrowserIndex:"&browserIndex=",BrowserVersion:"&browserVersion=",Href:"&href=",DeviceType:"&deviceType=",SiteCode:"&siteCode=",GoalId:"&goalId=",VisitorCode:"&visitorCode=",VariationId:"&variationId=",Ts:"&ts=",Key:"&key=",SdkName:"&sdkName=",SdkVersion:"&sdkVersion=",ValuesCountMap:"&valuesCountMap=",Nonce:"&nonce=",Id:"&id=",CustomData:"&customData=",CurrentVisit:"¤tVisit=",MaxNumberPreviousVisits:"&maxNumberPreviousVisits=",Os:"&os=",OsIndex:"&osIndex=",Country:"&country=",City:"&city=",Region:"®ion=",Latitude:"&latitude=",Longitude:"&longitude=",PostalCode:"&postalCode=",Conversion:"&conversion=",StaticData:"&staticData=",Geolocation:"&geolocation=",Page:"&page=",Experiment:"&experiment=",Browser:"&browser=",Environment:"&environment=",MappingIdentifier:"&mappingIdentifier=",MappingValue:"&mappingValue="},UrlFirstParameter=exports.UrlFirstParameter={CustomData:"?customData=",StaticData:"?staticData=",Page:"?page=",Conversion:"?conversion=",Geolocation:"?geolocation=",Experiment:"?experiment=",ValuesCountMap:"?valuesCountMap=",Id:"?id=",Nonce:"?nonce=",Country:"?country=",Environment:"?environment=",City:"?city=",Region:"?region=",Latitude:"?latitude=",Longitude:"?longitude=",PostalCode:"?postalCode=",SdkName:"?sdkName=",SdkVersion:"?sdkVersion=",BrowserIndex:"?browserIndex=",BrowserVersion:"?browserVersion=",SiteCode:"?siteCode=",VisitorCode:"?visitorCode=",CurrentVisit:"?currentVisit=",MaxNumberPreviousVisits:"?maxNumberPreviousVisits=",Negative:"?negative=",Revenue:"?revenue=",Title:"?title=",Os:"?os=",OsIndex:"?osIndex=",Browser:"?browser=",ReferrersIndices:"?referrersIndices=",Overwrite:"?overwrite=",Index:"?index=",Href:"?href=",VariationId:"?variationId=",DeviceType:"?deviceType=",GoalId:"?goalId=",Ts:"?ts=",Key:"?key=",MappingIdentifier:"?mappingIdentifier=",MappingValue:"?mappingValue="},UrlQuery=exports.UrlQuery={Sse:"sse?siteCode=",Map:"map?siteCode=",Events:"events?siteCode=",Visitor:"visitor?siteCode="},UrlTracking=exports.UrlTracking={Visit:"visit/",Map:"map/"},topLevelDomain="io",URL_DATA_API="https://data.kameleoon.".concat(topLevelDomain),URL=exports.URL={SERVER_SENT_EVENTS:"https://events.kameleoon.com:8110/",CLIENT_CONFIGURATION:"https://sdk-config.kameleoon.eu/",VISIT_EVENT:"".concat(URL_DATA_API,"/").concat(UrlTracking.Visit+UrlQuery.Events),VISIT_DATA:"".concat(URL_DATA_API,"/").concat(UrlTracking.Visit+UrlQuery.Visitor),DATA_MAP:"".concat(URL_DATA_API,"/").concat(UrlTracking.Map+UrlQuery.Map)};
|
|
2
2
|
//# sourceMappingURL=constants.js.map
|