@kameleoon/javascript-sdk-core 4.4.8 → 5.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 +32 -0
- package/dist/cacheManager/cacheManager.js +1 -1
- package/dist/cacheManager/cacheManager.js.map +1 -1
- package/dist/cacheManager/index.js.map +1 -1
- package/dist/cacheManager/types.js.map +1 -1
- package/dist/clientConfiguration/clientConfiguration.d.ts +2 -6
- package/dist/clientConfiguration/clientConfiguration.js +1 -1
- package/dist/clientConfiguration/clientConfiguration.js.map +1 -1
- package/dist/clientConfiguration/constants.js.map +1 -1
- package/dist/clientConfiguration/index.js.map +1 -1
- package/dist/clientConfiguration/types.d.ts +2 -5
- package/dist/clientConfiguration/types.js +1 -1
- package/dist/clientConfiguration/types.js.map +1 -1
- package/dist/clientSettings/clientSettings.d.ts +2 -1
- package/dist/clientSettings/clientSettings.js +1 -1
- package/dist/clientSettings/clientSettings.js.map +1 -1
- package/dist/clientSettings/index.js.map +1 -1
- package/dist/clientSettings/types.d.ts +1 -0
- package/dist/clientSettings/types.js.map +1 -1
- package/dist/constants.d.ts +0 -1
- package/dist/constants.js +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/eventManager/eventManager.js +1 -1
- package/dist/eventManager/eventManager.js.map +1 -1
- package/dist/eventManager/index.js.map +1 -1
- package/dist/eventManager/types.js.map +1 -1
- package/dist/eventSource/constants.js.map +1 -1
- package/dist/eventSource/eventSource.js +1 -1
- package/dist/eventSource/eventSource.js.map +1 -1
- package/dist/eventSource/index.js.map +1 -1
- package/dist/eventSource/types.js.map +1 -1
- package/dist/hasher/hasher.js.map +1 -1
- package/dist/hasher/index.js.map +1 -1
- package/dist/hasher/types.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/kameleoonClient.d.ts +6 -13
- package/dist/kameleoonClient.js +1 -1
- package/dist/kameleoonClient.js.map +1 -1
- package/dist/kameleoonClientInterface.d.ts +18 -16
- package/dist/kameleoonClientInterface.js.map +1 -1
- package/dist/kameleoonData/applicationVersion.d.ts +2 -3
- package/dist/kameleoonData/applicationVersion.js +1 -1
- package/dist/kameleoonData/applicationVersion.js.map +1 -1
- package/dist/kameleoonData/browser.d.ts +9 -3
- package/dist/kameleoonData/browser.js +1 -1
- package/dist/kameleoonData/browser.js.map +1 -1
- package/dist/kameleoonData/conversion.d.ts +12 -3
- package/dist/kameleoonData/conversion.js +1 -1
- package/dist/kameleoonData/conversion.js.map +1 -1
- package/dist/kameleoonData/cookie.d.ts +2 -3
- package/dist/kameleoonData/cookie.js +1 -1
- package/dist/kameleoonData/cookie.js.map +1 -1
- package/dist/kameleoonData/customData.d.ts +11 -3
- package/dist/kameleoonData/customData.js +1 -1
- package/dist/kameleoonData/customData.js.map +1 -1
- package/dist/kameleoonData/dataManager.d.ts +34 -23
- package/dist/kameleoonData/dataManager.js +1 -1
- package/dist/kameleoonData/dataManager.js.map +1 -1
- package/dist/kameleoonData/dataProcessor.d.ts +22 -24
- package/dist/kameleoonData/dataProcessor.js +1 -1
- package/dist/kameleoonData/dataProcessor.js.map +1 -1
- package/dist/kameleoonData/device.d.ts +9 -3
- package/dist/kameleoonData/device.js +1 -1
- package/dist/kameleoonData/device.js.map +1 -1
- package/dist/kameleoonData/geolocation.d.ts +9 -3
- package/dist/kameleoonData/geolocation.js +1 -1
- package/dist/kameleoonData/geolocation.js.map +1 -1
- package/dist/kameleoonData/helpers.js.map +1 -1
- package/dist/kameleoonData/index.d.ts +2 -1
- package/dist/kameleoonData/index.js +1 -1
- package/dist/kameleoonData/index.js.map +1 -1
- package/dist/kameleoonData/kameleoonConversionScore.d.ts +2 -1
- package/dist/kameleoonData/kameleoonConversionScore.js +1 -1
- package/dist/kameleoonData/kameleoonConversionScore.js.map +1 -1
- package/dist/kameleoonData/operatingSystem.d.ts +9 -3
- package/dist/kameleoonData/operatingSystem.js +1 -1
- package/dist/kameleoonData/operatingSystem.js.map +1 -1
- package/dist/kameleoonData/pageView.d.ts +12 -8
- package/dist/kameleoonData/pageView.js +1 -1
- package/dist/kameleoonData/pageView.js.map +1 -1
- package/dist/kameleoonData/types.d.ts +97 -31
- package/dist/kameleoonData/types.js +1 -1
- package/dist/kameleoonData/types.js.map +1 -1
- package/dist/kameleoonData/uniqueIdentifier.d.ts +19 -0
- package/dist/kameleoonData/uniqueIdentifier.js +2 -0
- package/dist/kameleoonData/uniqueIdentifier.js.map +1 -0
- package/dist/kameleoonData/userAgent.d.ts +2 -3
- package/dist/kameleoonData/userAgent.js +1 -1
- package/dist/kameleoonData/userAgent.js.map +1 -1
- package/dist/kameleoonData/visitProcessor.d.ts +3 -4
- package/dist/kameleoonData/visitProcessor.js +1 -1
- package/dist/kameleoonData/visitProcessor.js.map +1 -1
- package/dist/kameleoonData/visitsData.d.ts +2 -0
- package/dist/kameleoonData/visitsData.js +1 -1
- package/dist/kameleoonData/visitsData.js.map +1 -1
- package/dist/kameleoonError/constants.js +1 -1
- package/dist/kameleoonError/constants.js.map +1 -1
- package/dist/kameleoonError/helpers.js +1 -1
- package/dist/kameleoonError/helpers.js.map +1 -1
- package/dist/kameleoonError/index.js.map +1 -1
- package/dist/kameleoonError/kameleoonError.js +1 -1
- package/dist/kameleoonError/kameleoonError.js.map +1 -1
- package/dist/kameleoonError/types.js.map +1 -1
- package/dist/kameleoonUtils.d.ts +1 -11
- 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.d.ts +1 -1
- package/dist/requester/index.js +1 -1
- package/dist/requester/index.js.map +1 -1
- package/dist/requester/requester.d.ts +5 -7
- package/dist/requester/requester.js +1 -1
- package/dist/requester/requester.js.map +1 -1
- package/dist/requester/types.d.ts +7 -26
- package/dist/requester/types.js +1 -1
- package/dist/requester/types.js.map +1 -1
- package/dist/requester/urlProvider.d.ts +2 -2
- package/dist/requester/urlProvider.js +1 -1
- package/dist/requester/urlProvider.js.map +1 -1
- package/dist/storage/constants.d.ts +6 -2
- package/dist/storage/constants.js +1 -1
- package/dist/storage/constants.js.map +1 -1
- package/dist/storage/index.d.ts +3 -2
- package/dist/storage/index.js +1 -1
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/integrityChecker.d.ts +20 -0
- package/dist/storage/integrityChecker.js +2 -0
- package/dist/storage/integrityChecker.js.map +1 -0
- package/dist/storage/storage.d.ts +0 -1
- package/dist/storage/storage.js +1 -1
- package/dist/storage/storage.js.map +1 -1
- package/dist/storage/types.d.ts +25 -17
- 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.map +1 -1
- package/dist/targeting/conditions/conversion.js +1 -1
- package/dist/targeting/conditions/conversion.js.map +1 -1
- package/dist/targeting/conditions/conversionLikelihood.js +1 -1
- package/dist/targeting/conditions/conversionLikelihood.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.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.map +1 -1
- package/dist/targeting/conditions/lastVisit.js +1 -1
- package/dist/targeting/conditions/lastVisit.js.map +1 -1
- package/dist/targeting/conditions/newVisitor.js +1 -1
- package/dist/targeting/conditions/newVisitor.js.map +1 -1
- package/dist/targeting/conditions/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/types.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.d.ts +1 -1
- package/dist/targeting/index.js.map +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.map +1 -1
- package/dist/tracking/bodyProvider.d.ts +26 -0
- package/dist/tracking/bodyProvider.js +2 -0
- package/dist/tracking/bodyProvider.js.map +1 -0
- package/dist/tracking/constants.d.ts +2 -0
- package/dist/tracking/constants.js +2 -0
- package/dist/tracking/constants.js.map +1 -0
- package/dist/tracking/index.d.ts +1 -0
- package/dist/tracking/index.js +2 -0
- package/dist/tracking/index.js.map +1 -0
- package/dist/tracking/tracker.d.ts +21 -0
- package/dist/tracking/tracker.js +2 -0
- package/dist/tracking/tracker.js.map +1 -0
- package/dist/tracking/types.d.ts +45 -0
- package/dist/tracking/types.js +2 -0
- package/dist/tracking/types.js.map +1 -0
- package/dist/types.d.ts +44 -15
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utilities/constants.d.ts +0 -1
- package/dist/utilities/constants.js +1 -1
- package/dist/utilities/constants.js.map +1 -1
- package/dist/utilities/index.d.ts +3 -2
- package/dist/utilities/index.js +1 -1
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/parser.d.ts +10 -0
- package/dist/utilities/parser.js +2 -0
- package/dist/utilities/parser.js.map +1 -0
- package/dist/utilities/types.d.ts +3 -40
- package/dist/utilities/types.js.map +1 -1
- package/dist/utilities/utilities.d.ts +5 -21
- package/dist/utilities/utilities.js +1 -1
- package/dist/utilities/utilities.js.map +1 -1
- package/dist/utilities/validator.d.ts +5 -0
- package/dist/utilities/validator.js +2 -0
- package/dist/utilities/validator.js.map +1 -0
- package/dist/variationConfiguration/index.js.map +1 -1
- package/dist/variationConfiguration/types.d.ts +7 -2
- package/dist/variationConfiguration/types.js.map +1 -1
- package/dist/variationConfiguration/variationConfiguration.d.ts +15 -7
- package/dist/variationConfiguration/variationConfiguration.js +1 -1
- package/dist/variationConfiguration/variationConfiguration.js.map +1 -1
- package/dist/visitorCodeManager/constants.d.ts +2 -0
- package/dist/visitorCodeManager/constants.js +1 -1
- package/dist/visitorCodeManager/constants.js.map +1 -1
- package/dist/visitorCodeManager/index.js.map +1 -1
- package/dist/visitorCodeManager/types.d.ts +3 -0
- package/dist/visitorCodeManager/types.js.map +1 -1
- package/dist/visitorCodeManager/visitorCodeManager.d.ts +4 -0
- package/dist/visitorCodeManager/visitorCodeManager.js +1 -1
- package/dist/visitorCodeManager/visitorCodeManager.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uniqueIdentifier.js","names":["UniqueIdentifier","constructor","value","_defineProperty","_value","status","TrackingStatus","Sent","url","data","type","KameleoonData","_fromRaw","exports"],"sources":["../../src/kameleoonData/uniqueIdentifier.ts"],"sourcesContent":["import { TrackingStatus } from 'src/types';\nimport { IKameleoonData, IdentifierDataType, KameleoonData } from './types';\n\nexport class UniqueIdentifier implements IKameleoonData {\n public status: TrackingStatus;\n\n private _value: boolean;\n\n /**\n * @param {boolean} value - a boolean value that indicates if the visitor has a unique identifier\n * */\n constructor(value: boolean) {\n this._value = value;\n this.status = TrackingStatus.Sent;\n }\n\n get url(): string {\n return '';\n }\n\n get data(): IdentifierDataType {\n return {\n value: this._value,\n type: KameleoonData.UniqueIdentifier,\n status: TrackingStatus.Sent,\n };\n }\n\n /**\n * @private\n * @method _fromRaw - an internal method for creating a UniqueIdentifier instance from raw data\n * @param {IdentifierDataType} data - a raw data\n * @return {UniqueIdentifier} a UniqueIdentifier instance\n * */\n public static _fromRaw(data: IdentifierDataType): UniqueIdentifier {\n return new UniqueIdentifier(data.value);\n }\n}\n"],"mappings":"+pBAGO,KAAM,CAAAA,gBAA2C,CAQtDC,WAAWA,CAACC,CAAc,CAAE,CAAAC,eAAA,uBAAAA,eAAA,uBAC1B,IAAI,CAACC,MAAM,CAAGF,CAAK,CACnB,IAAI,CAACG,MAAM,CAAGC,qBAAc,CAACC,IAC/B,CAEA,GAAI,CAAAC,GAAGA,CAAA,CAAW,CAChB,MAAO,EACT,CAEA,GAAI,CAAAC,IAAIA,CAAA,CAAuB,CAC7B,MAAO,CACLP,KAAK,CAAE,IAAI,CAACE,MAAM,CAClBM,IAAI,CAAEC,qBAAa,CAACX,gBAAgB,CACpCK,MAAM,CAAEC,qBAAc,CAACC,IACzB,CACF,CAQA,MAAc,CAAAK,QAAQA,CAACH,CAAwB,CAAoB,CACjE,MAAO,IAAI,CAAAT,gBAAgB,CAACS,CAAI,CAACP,KAAK,CACxC,CACF,CAACW,OAAA,CAAAb,gBAAA,CAAAA,gBAAA","ignoreList":[]}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { UserAgentDataType, IKameleoonData } from './types';
|
|
2
|
+
import { TrackingStatus } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* @class
|
|
4
5
|
* UserAgent - a class for creating an instance for user agent
|
|
5
6
|
* */
|
|
6
7
|
export declare class UserAgent implements IKameleoonData {
|
|
8
|
+
status: TrackingStatus;
|
|
7
9
|
private value;
|
|
8
|
-
private sent;
|
|
9
10
|
constructor(value: string);
|
|
10
11
|
get url(): string;
|
|
11
12
|
get data(): UserAgentDataType;
|
|
12
|
-
get isSent(): boolean;
|
|
13
|
-
set isSent(value: boolean);
|
|
14
13
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.UserAgent=void 0;var _types=require("./types"),_types2=require("../types");function _defineProperty(a,b,c){return(b=_toPropertyKey(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,"status",void 0),_defineProperty(this,"value",void 0),this.value=a,this.status=_types2.TrackingStatus.Sent}get url(){return""}get data(){return{value:this.value,type:_types.KameleoonData.UserAgent,status:this.status}}}exports.UserAgent=UserAgent;
|
|
2
2
|
//# sourceMappingURL=userAgent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userAgent.js","names":["
|
|
1
|
+
{"version":3,"file":"userAgent.js","names":["UserAgent","constructor","value","_defineProperty","status","TrackingStatus","Sent","url","data","type","KameleoonData","exports"],"sources":["../../src/kameleoonData/userAgent.ts"],"sourcesContent":["import { UserAgentDataType, IKameleoonData, KameleoonData } from './types';\nimport { TrackingStatus } from 'src/types';\n\n/**\n * @class\n * UserAgent - a class for creating an instance for user agent\n * */\nexport class UserAgent implements IKameleoonData {\n public status: TrackingStatus;\n\n private value: string;\n\n constructor(value: string) {\n this.value = value;\n this.status = TrackingStatus.Sent;\n }\n\n get url(): string {\n return '';\n }\n\n get data(): UserAgentDataType {\n return {\n value: this.value,\n type: KameleoonData.UserAgent,\n status: this.status,\n };\n }\n}\n"],"mappings":"wpBAOO,KAAM,CAAAA,SAAoC,CAK/CC,WAAWA,CAACC,CAAa,CAAE,CAAAC,eAAA,uBAAAA,eAAA,sBACzB,IAAI,CAACD,KAAK,CAAGA,CAAK,CAClB,IAAI,CAACE,MAAM,CAAGC,sBAAc,CAACC,IAC/B,CAEA,GAAI,CAAAC,GAAGA,CAAA,CAAW,CAChB,MAAO,EACT,CAEA,GAAI,CAAAC,IAAIA,CAAA,CAAsB,CAC5B,MAAO,CACLN,KAAK,CAAE,IAAI,CAACA,KAAK,CACjBO,IAAI,CAAEC,oBAAa,CAACV,SAAS,CAC7BI,MAAM,CAAE,IAAI,CAACA,MACf,CACF,CACF,CAACO,OAAA,CAAAX,SAAA,CAAAA,SAAA","ignoreList":[]}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { VisitType } from '../requester';
|
|
2
|
-
import {
|
|
3
|
-
import { VisitProcessorDataType, KCSType } from './types';
|
|
4
|
-
import { DataManager } from './dataManager';
|
|
2
|
+
import { VisitProcessorDataType, KCSType, VisitorProcessorParametersType } from './types';
|
|
5
3
|
interface IVisitProcessor {
|
|
6
4
|
processVisit(visit: VisitType): void;
|
|
7
5
|
processKcs(kcsData?: KCSType): void;
|
|
@@ -13,10 +11,11 @@ export declare class VisitProcessor implements IVisitProcessor {
|
|
|
13
11
|
private storageVisitorData;
|
|
14
12
|
private experimentData;
|
|
15
13
|
private filters;
|
|
14
|
+
private visitorDataTypes;
|
|
16
15
|
private dataManager;
|
|
17
16
|
private singleDataTypes;
|
|
18
17
|
private multipleDataTypes;
|
|
19
|
-
constructor(filters
|
|
18
|
+
constructor({ filters, dataManager, visitorCode, }: VisitorProcessorParametersType);
|
|
20
19
|
get data(): VisitProcessorDataType;
|
|
21
20
|
processVisit(visit: VisitType): void;
|
|
22
21
|
processMultipleDataTypes(): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.VisitProcessor=void 0;var _pageView=require("./pageView"),_types=require("./types"),_customData=require("./customData"),_conversion=require("./conversion"),_browser=require("./browser"),_device=require("./device"),_operatingSystem=require("./operatingSystem"),_geolocation=require("./geolocation"),_visitsData=require("./visitsData"),_kameleoonConversionScore=require("./kameleoonConversionScore");function _defineProperty(a,b,c){return
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.VisitProcessor=void 0;var _pageView=require("./pageView"),_types=require("./types"),_customData=require("./customData"),_conversion=require("./conversion"),_browser=require("./browser"),_device=require("./device"),_operatingSystem=require("./operatingSystem"),_geolocation=require("./geolocation"),_visitsData=require("./visitsData"),_kameleoonConversionScore=require("./kameleoonConversionScore"),_types2=require("../types");function _defineProperty(a,b,c){return(b=_toPropertyKey(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 VisitProcessor{constructor(a){let{filters:b,dataManager:c,visitorCode:d}=a;_defineProperty(this,"visitsData",new _visitsData.VisitsData([])),_defineProperty(this,"visitorData",[]),_defineProperty(this,"storageVisitorData",[]),_defineProperty(this,"experimentData",{}),_defineProperty(this,"filters",void 0),_defineProperty(this,"visitorDataTypes",void 0),_defineProperty(this,"dataManager",void 0),_defineProperty(this,"singleDataTypes",{[_types.KameleoonData.Device]:null,[_types.KameleoonData.Browser]:null,[_types.KameleoonData.GeolocationData]:null,[_types.KameleoonData.OperatingSystem]:null,[_types.KameleoonData.KameleoonConversionScore]:null}),_defineProperty(this,"multipleDataTypes",{[_types.KameleoonData.CustomData]:new Map,[_types.KameleoonData.PageView]:new Map,[_types.KameleoonData.Conversion]:new Map}),this.filters=b,this.dataManager=c,this.visitorDataTypes=c.getVisitorStoredDataTypes(d)}get data(){return{visitorData:this.visitorData,storageVisitorData:this.storageVisitorData,visitsData:this.visitsData,experimentData:this.experimentData}}processVisit(a){this.processBrowser(a),this.processDevice(a),this.processOperatingSystem(a),this.processGeolocationData(a),this.processCustomData(a),this.processConversion(a),this.processPageView(a),this.processExperiments(a),this.processVisitsData(a)}processMultipleDataTypes(){for(const[a,b]of Object.entries(this.multipleDataTypes))if(b.size)switch(a){case _types.KameleoonData.PageView:{this.visitorData.push(...b.values()),this.storageVisitorData.push(...b.values());break}case _types.KameleoonData.Conversion:{this.storageVisitorData.push(...b.values());break}case _types.KameleoonData.CustomData:{b.forEach(a=>{this.visitorData.push(a),this.dataManager.storedCustomDataIndexes.has(a.data.index)||this.storageVisitorData.push(a)});break}}}processKcs(a){if(this.filters.kcs&&a){const b=new _kameleoonConversionScore.KameleoonConversionScore(a);this.storageVisitorData.push(b)}}processBrowser(a){if(this.filters.browser&&!this.singleDataTypes[_types.KameleoonData.Browser]){const b=_browser.Browser._fromVisit(a);b&&(!this.visitorDataTypes.has(_types.KameleoonData.Browser)&&this.storageVisitorData.push(b),this.visitorData.push(b),this.singleDataTypes[_types.KameleoonData.Browser]=b)}}processDevice(a){if(this.filters.device&&!this.singleDataTypes[_types.KameleoonData.Device]){const b=_device.Device._fromVisit(a);b&&(!this.visitorDataTypes.has(_types.KameleoonData.Device)&&this.storageVisitorData.push(b),this.visitorData.push(b),this.singleDataTypes[_types.KameleoonData.Device]=b)}}processOperatingSystem(a){if(this.filters.operatingSystem&&!this.singleDataTypes[_types.KameleoonData.OperatingSystem]){const b=_operatingSystem.OperatingSystem._fromVisit(a);b&&(!this.visitorDataTypes.has(_types.KameleoonData.OperatingSystem)&&this.storageVisitorData.push(b),this.visitorData.push(b),this.singleDataTypes[_types.KameleoonData.OperatingSystem]=b)}}processGeolocationData(a){if(this.filters.geolocation&&!this.singleDataTypes[_types.KameleoonData.GeolocationData]){const b=_geolocation.GeolocationData._fromVisit(a);b&&(!this.visitorDataTypes.has(_types.KameleoonData.GeolocationData)&&this.storageVisitorData.push(b),this.visitorData.push(b),this.singleDataTypes[_types.KameleoonData.GeolocationData]=b)}}processCustomData(a){this.filters.customData&&_customData.CustomData._updateFromVisit(a,this.multipleDataTypes[_types.KameleoonData.CustomData])}processConversion(a){if(this.filters.conversions){_conversion.Conversion._updateFromVisit(a,this.multipleDataTypes[_types.KameleoonData.Conversion]);const b=_conversion.Conversion._listFromVisit(a);b.length&&this.visitorData.push(...b)}}processPageView(a){this.filters.pageViews&&_pageView.PageView._updateFromVisit(a,this.multipleDataTypes[_types.KameleoonData.PageView])}processExperiments(a){if(this.filters.experiments&&a.experimentEvents)for(const b of a.experimentEvents){const{id:a,variationId:c}=b.data;this.experimentData[a]={variationId:c,isTargetedRule:!1,status:_types2.TrackingStatus.Unsent}}}processVisitsData(a){this.visitsData.timestamp=a.timeStarted}}exports.VisitProcessor=VisitProcessor;
|
|
2
2
|
//# sourceMappingURL=visitProcessor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visitProcessor.js","names":["VisitProcessor","constructor","filters","dataManager","_defineProperty","VisitsData","KameleoonData","Device","Browser","GeolocationData","OperatingSystem","KameleoonConversionScore","CustomData","Map","PageView","Conversion","data","visitorData","storageVisitorData","visitsData","experimentData","processVisit","visit","processBrowser","processDevice","processOperatingSystem","processGeolocationData","processCustomData","processConversion","processPageView","processExperiments","processVisitsData","processMultipleDataTypes","dataType","Object","entries","multipleDataTypes","size","push","values","forEach","customData","storedCustomDataIndexes","has","index","processKcs","kcsData","kcs","browser","singleDataTypes","_fromVisit","storedDataTypes","device","operatingSystem","geolocation","_updateFromVisit","conversions","_listFromVisit","length","pageViews","experiments","experimentEvents","experimentEvent","id","variationId","isTargetedRule","isSent","timestamp","timeStarted","exports"],"sources":["../../src/kameleoonData/visitProcessor.ts"],"sourcesContent":["import { VisitType } from 'src/requester';\nimport { PageView } from './pageView';\nimport { VisitorDataFiltersType } from 'src/utilities/types';\nimport {\n KameleoonData,\n KameleoonDataType,\n SingleDataType,\n MultipleDataType,\n VisitProcessorDataType,\n KCSType,\n} from './types';\nimport { CustomData } from './customData';\nimport { Conversion } from './conversion';\nimport { Browser } from './browser';\nimport { Device } from './device';\nimport { OperatingSystem } from './operatingSystem';\nimport { GeolocationData } from './geolocation';\nimport { FeatureFlagVariationsType } from 'src/storage';\nimport { VisitsData } from './visitsData';\nimport { DataManager } from './dataManager';\nimport { KameleoonConversionScore } from './kameleoonConversionScore';\n\ninterface IVisitProcessor {\n processVisit(visit: VisitType): void;\n processKcs(kcsData?: KCSType): void;\n processMultipleDataTypes(): void;\n}\n\nexport class VisitProcessor implements IVisitProcessor {\n private visitsData = new VisitsData([]);\n private visitorData: KameleoonDataType[] = [];\n private storageVisitorData: KameleoonDataType[] = [];\n private experimentData: FeatureFlagVariationsType = {};\n private filters: VisitorDataFiltersType = {};\n private dataManager: DataManager;\n private singleDataTypes: SingleDataType = {\n [KameleoonData.Device]: null,\n [KameleoonData.Browser]: null,\n [KameleoonData.GeolocationData]: null,\n [KameleoonData.OperatingSystem]: null,\n [KameleoonData.KameleoonConversionScore]: null,\n };\n private multipleDataTypes: MultipleDataType = {\n [KameleoonData.CustomData]: new Map<number, CustomData>(),\n [KameleoonData.PageView]: new Map<string, PageView>(),\n [KameleoonData.Conversion]: new Map<number, Conversion>(),\n };\n\n constructor(filters: VisitorDataFiltersType, dataManager: DataManager) {\n this.filters = filters;\n this.dataManager = dataManager;\n }\n\n get data(): VisitProcessorDataType {\n return {\n visitorData: this.visitorData,\n storageVisitorData: this.storageVisitorData,\n visitsData: this.visitsData,\n experimentData: this.experimentData,\n };\n }\n\n public processVisit(visit: VisitType): void {\n this.processBrowser(visit);\n this.processDevice(visit);\n this.processOperatingSystem(visit);\n this.processGeolocationData(visit);\n this.processCustomData(visit);\n this.processConversion(visit);\n this.processPageView(visit);\n this.processExperiments(visit);\n this.processVisitsData(visit);\n }\n\n public processMultipleDataTypes(): void {\n for (const [dataType, data] of Object.entries(this.multipleDataTypes)) {\n if (!data.size) {\n continue;\n }\n\n switch (dataType) {\n case KameleoonData.PageView: {\n this.visitorData.push(...data.values());\n this.storageVisitorData.push(...data.values());\n\n break;\n }\n case KameleoonData.Conversion: {\n this.storageVisitorData.push(...data.values());\n\n break;\n }\n case KameleoonData.CustomData: {\n const dataItem = data as Map<number, CustomData>;\n\n dataItem.forEach((customData) => {\n this.visitorData.push(customData);\n\n if (\n !this.dataManager.storedCustomDataIndexes.has(\n customData.data.index,\n )\n ) {\n this.storageVisitorData.push(customData);\n }\n });\n\n break;\n }\n }\n }\n }\n\n public processKcs(kcsData?: KCSType): void {\n if (this.filters.kcs && kcsData) {\n const kcs = new KameleoonConversionScore(kcsData);\n\n this.storageVisitorData.push(kcs);\n }\n }\n\n private processBrowser(visit: VisitType): void {\n if (this.filters.browser && !this.singleDataTypes[KameleoonData.Browser]) {\n const browser = Browser._fromVisit(visit);\n\n if (browser) {\n if (!this.dataManager.storedDataTypes.has(KameleoonData.Browser)) {\n this.storageVisitorData.push(browser);\n }\n this.visitorData.push(browser);\n this.singleDataTypes[KameleoonData.Browser] = browser;\n }\n }\n }\n\n private processDevice(visit: VisitType): void {\n if (this.filters.device && !this.singleDataTypes[KameleoonData.Device]) {\n const device = Device._fromVisit(visit);\n\n if (device) {\n if (!this.dataManager.storedDataTypes.has(KameleoonData.Device)) {\n this.storageVisitorData.push(device);\n }\n\n this.visitorData.push(device);\n this.singleDataTypes[KameleoonData.Device] = device;\n }\n }\n }\n\n private processOperatingSystem(visit: VisitType): void {\n if (\n this.filters.operatingSystem &&\n !this.singleDataTypes[KameleoonData.OperatingSystem]\n ) {\n const operatingSystem = OperatingSystem._fromVisit(visit);\n\n if (operatingSystem) {\n if (\n !this.dataManager.storedDataTypes.has(KameleoonData.OperatingSystem)\n ) {\n this.storageVisitorData.push(operatingSystem);\n }\n\n this.visitorData.push(operatingSystem);\n this.singleDataTypes[KameleoonData.OperatingSystem] = operatingSystem;\n }\n }\n }\n\n private processGeolocationData(visit: VisitType): void {\n if (\n this.filters.geolocation &&\n !this.singleDataTypes[KameleoonData.GeolocationData]\n ) {\n const geolocation = GeolocationData._fromVisit(visit);\n\n if (geolocation) {\n if (\n !this.dataManager.storedDataTypes.has(KameleoonData.GeolocationData)\n ) {\n this.storageVisitorData.push(geolocation);\n }\n\n this.visitorData.push(geolocation);\n this.singleDataTypes[KameleoonData.GeolocationData] = geolocation;\n }\n }\n }\n\n private processCustomData(visit: VisitType): void {\n if (this.filters.customData) {\n CustomData._updateFromVisit(\n visit,\n this.multipleDataTypes[KameleoonData.CustomData],\n );\n }\n }\n\n private processConversion(visit: VisitType): void {\n if (this.filters.conversions) {\n // --- Note ---\n // We collect Conversion data with only unique goalId\n Conversion._updateFromVisit(\n visit,\n this.multipleDataTypes[KameleoonData.Conversion],\n );\n\n // --- Note ---\n // We collect all Conversion data with goalId, revenue and negative for all visits\n const conversions = Conversion._listFromVisit(visit);\n\n if (conversions.length) {\n this.visitorData.push(...conversions);\n }\n }\n }\n\n private processPageView(visit: VisitType): void {\n if (this.filters.pageViews) {\n PageView._updateFromVisit(\n visit,\n this.multipleDataTypes[KameleoonData.PageView],\n );\n }\n }\n\n private processExperiments(visit: VisitType): void {\n if (this.filters.experiments && visit.experimentEvents) {\n for (const experimentEvent of visit.experimentEvents) {\n const { id, variationId } = experimentEvent.data;\n\n this.experimentData[id] = {\n variationId,\n isTargetedRule: false,\n isSent: false,\n };\n }\n }\n }\n\n private processVisitsData(visit: VisitType): void {\n this.visitsData.timestamp = visit.timeStarted;\n }\n}\n"],"mappings":"69BA4BO,KAAM,CAAAA,cAA0C,CAoBrDC,WAAWA,CAACC,CAA+B,CAAEC,CAAwB,CAAE,CAAAC,eAAA,mBAnBlD,GAAI,CAAAC,sBAAU,CAAC,EAAE,CAAC,EAAAD,eAAA,oBACI,EAAE,EAAAA,eAAA,2BACK,EAAE,EAAAA,eAAA,uBACA,CAAC,CAAC,EAAAA,eAAA,gBACZ,CAAC,CAAC,EAAAA,eAAA,4BAAAA,eAAA,wBAEF,CACxC,CAACE,oBAAa,CAACC,MAAM,EAAG,IAAI,CAC5B,CAACD,oBAAa,CAACE,OAAO,EAAG,IAAI,CAC7B,CAACF,oBAAa,CAACG,eAAe,EAAG,IAAI,CACrC,CAACH,oBAAa,CAACI,eAAe,EAAG,IAAI,CACrC,CAACJ,oBAAa,CAACK,wBAAwB,EAAG,IAC5C,CAAC,EAAAP,eAAA,0BAC6C,CAC5C,CAACE,oBAAa,CAACM,UAAU,EAAG,GAAI,CAAAC,GAAyB,CACzD,CAACP,oBAAa,CAACQ,QAAQ,EAAG,GAAI,CAAAD,GAAuB,CACrD,CAACP,oBAAa,CAACS,UAAU,EAAG,GAAI,CAAAF,GAClC,CAAC,EAGC,IAAI,CAACX,OAAO,CAAGA,CAAO,CACtB,IAAI,CAACC,WAAW,CAAGA,CACrB,CAEA,GAAI,CAAAa,IAAIA,CAAA,CAA2B,CACjC,MAAO,CACLC,WAAW,CAAE,IAAI,CAACA,WAAW,CAC7BC,kBAAkB,CAAE,IAAI,CAACA,kBAAkB,CAC3CC,UAAU,CAAE,IAAI,CAACA,UAAU,CAC3BC,cAAc,CAAE,IAAI,CAACA,cACvB,CACF,CAEOC,YAAYA,CAACC,CAAgB,CAAQ,CAC1C,IAAI,CAACC,cAAc,CAACD,CAAK,CAAC,CAC1B,IAAI,CAACE,aAAa,CAACF,CAAK,CAAC,CACzB,IAAI,CAACG,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A,cAAA"}
|
|
1
|
+
{"version":3,"file":"visitProcessor.js","names":["VisitProcessor","constructor","a","filters","dataManager","visitorCode","_defineProperty","VisitsData","KameleoonData","Device","Browser","GeolocationData","OperatingSystem","KameleoonConversionScore","CustomData","Map","PageView","Conversion","visitorDataTypes","getVisitorStoredDataTypes","data","visitorData","storageVisitorData","visitsData","experimentData","processVisit","visit","processBrowser","processDevice","processOperatingSystem","processGeolocationData","processCustomData","processConversion","processPageView","processExperiments","processVisitsData","processMultipleDataTypes","dataType","Object","entries","multipleDataTypes","size","push","values","forEach","customData","storedCustomDataIndexes","has","index","processKcs","kcsData","kcs","browser","singleDataTypes","_fromVisit","device","operatingSystem","geolocation","_updateFromVisit","conversions","_listFromVisit","length","pageViews","experiments","experimentEvents","experimentEvent","id","variationId","isTargetedRule","status","TrackingStatus","Unsent","timestamp","timeStarted","exports"],"sources":["../../src/kameleoonData/visitProcessor.ts"],"sourcesContent":["import { VisitType } from 'src/requester';\nimport { PageView } from './pageView';\nimport { VisitorDataFiltersType } from 'src/utilities/types';\nimport {\n KameleoonData,\n KameleoonDataType,\n SingleDataType,\n MultipleDataType,\n VisitProcessorDataType,\n KCSType,\n VisitorProcessorParametersType,\n} from './types';\nimport { CustomData } from './customData';\nimport { Conversion } from './conversion';\nimport { Browser } from './browser';\nimport { Device } from './device';\nimport { OperatingSystem } from './operatingSystem';\nimport { GeolocationData } from './geolocation';\nimport { FeatureFlagVariationsType } from 'src/storage';\nimport { VisitsData } from './visitsData';\nimport { DataManager } from './dataManager';\nimport { KameleoonConversionScore } from './kameleoonConversionScore';\nimport { TrackingStatus } from 'src/types';\n\ninterface IVisitProcessor {\n processVisit(visit: VisitType): void;\n processKcs(kcsData?: KCSType): void;\n processMultipleDataTypes(): void;\n}\n\nexport class VisitProcessor implements IVisitProcessor {\n private visitsData = new VisitsData([]);\n private visitorData: KameleoonDataType[] = [];\n private storageVisitorData: KameleoonDataType[] = [];\n private experimentData: FeatureFlagVariationsType = {};\n private filters: VisitorDataFiltersType;\n private visitorDataTypes: Set<KameleoonData>;\n private dataManager: DataManager;\n private singleDataTypes: SingleDataType = {\n [KameleoonData.Device]: null,\n [KameleoonData.Browser]: null,\n [KameleoonData.GeolocationData]: null,\n [KameleoonData.OperatingSystem]: null,\n [KameleoonData.KameleoonConversionScore]: null,\n };\n private multipleDataTypes: MultipleDataType = {\n [KameleoonData.CustomData]: new Map<number, CustomData>(),\n [KameleoonData.PageView]: new Map<string, PageView>(),\n [KameleoonData.Conversion]: new Map<number, Conversion>(),\n };\n\n constructor({\n filters,\n dataManager,\n visitorCode,\n }: VisitorProcessorParametersType) {\n this.filters = filters;\n this.dataManager = dataManager;\n this.visitorDataTypes = dataManager.getVisitorStoredDataTypes(visitorCode);\n }\n\n get data(): VisitProcessorDataType {\n return {\n visitorData: this.visitorData,\n storageVisitorData: this.storageVisitorData,\n visitsData: this.visitsData,\n experimentData: this.experimentData,\n };\n }\n\n public processVisit(visit: VisitType): void {\n this.processBrowser(visit);\n this.processDevice(visit);\n this.processOperatingSystem(visit);\n this.processGeolocationData(visit);\n this.processCustomData(visit);\n this.processConversion(visit);\n this.processPageView(visit);\n this.processExperiments(visit);\n this.processVisitsData(visit);\n }\n\n public processMultipleDataTypes(): void {\n for (const [dataType, data] of Object.entries(this.multipleDataTypes)) {\n if (!data.size) {\n continue;\n }\n\n switch (dataType) {\n case KameleoonData.PageView: {\n this.visitorData.push(...data.values());\n this.storageVisitorData.push(...data.values());\n\n break;\n }\n case KameleoonData.Conversion: {\n this.storageVisitorData.push(...data.values());\n\n break;\n }\n case KameleoonData.CustomData: {\n const dataItem = data as Map<number, CustomData>;\n\n dataItem.forEach((customData) => {\n this.visitorData.push(customData);\n\n if (\n !this.dataManager.storedCustomDataIndexes.has(\n customData.data.index,\n )\n ) {\n this.storageVisitorData.push(customData);\n }\n });\n\n break;\n }\n }\n }\n }\n\n public processKcs(kcsData?: KCSType): void {\n if (this.filters.kcs && kcsData) {\n const kcs = new KameleoonConversionScore(kcsData);\n\n this.storageVisitorData.push(kcs);\n }\n }\n\n private processBrowser(visit: VisitType): void {\n if (this.filters.browser && !this.singleDataTypes[KameleoonData.Browser]) {\n const browser = Browser._fromVisit(visit);\n\n if (browser) {\n if (!this.visitorDataTypes.has(KameleoonData.Browser)) {\n this.storageVisitorData.push(browser);\n }\n this.visitorData.push(browser);\n this.singleDataTypes[KameleoonData.Browser] = browser;\n }\n }\n }\n\n private processDevice(visit: VisitType): void {\n if (this.filters.device && !this.singleDataTypes[KameleoonData.Device]) {\n const device = Device._fromVisit(visit);\n\n if (device) {\n if (!this.visitorDataTypes.has(KameleoonData.Device)) {\n this.storageVisitorData.push(device);\n }\n\n this.visitorData.push(device);\n this.singleDataTypes[KameleoonData.Device] = device;\n }\n }\n }\n\n private processOperatingSystem(visit: VisitType): void {\n if (\n this.filters.operatingSystem &&\n !this.singleDataTypes[KameleoonData.OperatingSystem]\n ) {\n const operatingSystem = OperatingSystem._fromVisit(visit);\n\n if (operatingSystem) {\n if (!this.visitorDataTypes.has(KameleoonData.OperatingSystem)) {\n this.storageVisitorData.push(operatingSystem);\n }\n\n this.visitorData.push(operatingSystem);\n this.singleDataTypes[KameleoonData.OperatingSystem] = operatingSystem;\n }\n }\n }\n\n private processGeolocationData(visit: VisitType): void {\n if (\n this.filters.geolocation &&\n !this.singleDataTypes[KameleoonData.GeolocationData]\n ) {\n const geolocation = GeolocationData._fromVisit(visit);\n\n if (geolocation) {\n if (!this.visitorDataTypes.has(KameleoonData.GeolocationData)) {\n this.storageVisitorData.push(geolocation);\n }\n\n this.visitorData.push(geolocation);\n this.singleDataTypes[KameleoonData.GeolocationData] = geolocation;\n }\n }\n }\n\n private processCustomData(visit: VisitType): void {\n if (this.filters.customData) {\n CustomData._updateFromVisit(\n visit,\n this.multipleDataTypes[KameleoonData.CustomData],\n );\n }\n }\n\n private processConversion(visit: VisitType): void {\n if (this.filters.conversions) {\n // --- Note ---\n // We collect Conversion data with only unique goalId\n Conversion._updateFromVisit(\n visit,\n this.multipleDataTypes[KameleoonData.Conversion],\n );\n\n // --- Note ---\n // We collect all Conversion data with goalId, revenue and negative for all visits\n const conversions = Conversion._listFromVisit(visit);\n\n if (conversions.length) {\n this.visitorData.push(...conversions);\n }\n }\n }\n\n private processPageView(visit: VisitType): void {\n if (this.filters.pageViews) {\n PageView._updateFromVisit(\n visit,\n this.multipleDataTypes[KameleoonData.PageView],\n );\n }\n }\n\n private processExperiments(visit: VisitType): void {\n if (this.filters.experiments && visit.experimentEvents) {\n for (const experimentEvent of visit.experimentEvents) {\n const { id, variationId } = experimentEvent.data;\n\n this.experimentData[id] = {\n variationId,\n isTargetedRule: false,\n status: TrackingStatus.Unsent,\n };\n }\n }\n }\n\n private processVisitsData(visit: VisitType): void {\n this.visitsData.timestamp = visit.timeStarted;\n }\n}\n"],"mappings":"u/BA8BO,KAAM,CAAAA,cAA0C,CAqBrDC,WAAWA,CAAAC,CAAA,CAIwB,IAJvB,CACVC,OAAO,CAAPA,CAAO,CACPC,WAAW,CAAXA,CAAW,CACXC,WAAW,CAAXA,CAC8B,CAAC,CAAAH,CAAA,CAAAI,eAAA,mBAxBZ,GAAI,CAAAC,sBAAU,CAAC,EAAE,CAAC,EAAAD,eAAA,oBACI,EAAE,EAAAA,eAAA,2BACK,EAAE,EAAAA,eAAA,uBACA,CAAC,CAAC,EAAAA,eAAA,wBAAAA,eAAA,iCAAAA,eAAA,4BAAAA,eAAA,wBAIZ,CACxC,CAACE,oBAAa,CAACC,MAAM,EAAG,IAAI,CAC5B,CAACD,oBAAa,CAACE,OAAO,EAAG,IAAI,CAC7B,CAACF,oBAAa,CAACG,eAAe,EAAG,IAAI,CACrC,CAACH,oBAAa,CAACI,eAAe,EAAG,IAAI,CACrC,CAACJ,oBAAa,CAACK,wBAAwB,EAAG,IAC5C,CAAC,EAAAP,eAAA,0BAC6C,CAC5C,CAACE,oBAAa,CAACM,UAAU,EAAG,GAAI,CAAAC,GAAyB,CACzD,CAACP,oBAAa,CAACQ,QA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EJ,CAEQkB,kBAAkBA,CAACR,CAAgB,CAAQ,CACjD,GAAI,IAAI,CAACvB,OAAO,CAAC4D,WAAW,EAAIrC,CAAK,CAACsC,gBAAgB,CACpD,IAAK,KAAM,CAAAC,CAAe,GAAI,CAAAvC,CAAK,CAACsC,gBAAgB,CAAE,CACpD,KAAM,CAAEE,EAAE,CAAFA,CAAE,CAAEC,WAAW,CAAXA,CAAY,CAAC,CAAGF,CAAe,CAAC7C,IAAI,CAEhD,IAAI,CAACI,cAAc,CAAC0C,CAAE,CAAC,CAAG,CACxBC,WAAW,CAAXA,CAAW,CACXC,cAAc,GAAO,CACrBC,MAAM,CAAEC,sBAAc,CAACC,MACzB,CACF,CAEJ,CAEQpC,iBAAiBA,CAACT,CAAgB,CAAQ,CAChD,IAAI,CAACH,UAAU,CAACiD,SAAS,CAAG9C,CAAK,CAAC+C,WACpC,CACF,CAACC,OAAA,CAAA1E,cAAA,CAAAA,cAAA","ignoreList":[]}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { IKameleoonData, VisitsDataType } from './types';
|
|
2
|
+
import { TrackingStatus } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* @class
|
|
4
5
|
* Visits - a class for creating an instance of a stored visits data
|
|
5
6
|
* */
|
|
6
7
|
export declare class VisitsData implements IKameleoonData {
|
|
7
8
|
private visits;
|
|
9
|
+
status: TrackingStatus;
|
|
8
10
|
/**
|
|
9
11
|
* @param {number[]} visits - a list of visits
|
|
10
12
|
* */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.VisitsData=void 0;var _utilities=require("../utilities"),_types=require("../utilities/types"),_types2=require("./types");function _defineProperty(a,b,c){return
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.VisitsData=void 0;var _utilities=require("../utilities"),_types=require("../utilities/types"),_types2=require("./types"),_types3=require("../types");function _defineProperty(a,b,c){return(b=_toPropertyKey(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){_defineProperty(this,"visits",void 0),_defineProperty(this,"status",_types3.TrackingStatus.Sent),this.visits=a}get url(){return""}get data(){return{visits:this.visits,type:_types2.KameleoonData.VisitsData,status:this.status}}get isSent(){return!0}set timestamp(a){_utilities.Utilities.insertInOrderedListMutably({list:this.visits,element:a,order:_types.Order.Ascending}),this.visits=[...new Set(this.visits)]}}exports.VisitsData=VisitsData;
|
|
2
2
|
//# sourceMappingURL=visitsData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visitsData.js","names":["VisitsData","constructor","visits","_defineProperty","url","data","type","KameleoonData","
|
|
1
|
+
{"version":3,"file":"visitsData.js","names":["VisitsData","constructor","visits","_defineProperty","TrackingStatus","Sent","url","data","type","KameleoonData","status","isSent","timestamp","Utilities","insertInOrderedListMutably","list","element","order","Order","Ascending","Set","exports"],"sources":["../../src/kameleoonData/visitsData.ts"],"sourcesContent":["import { Utilities } from 'src/utilities';\nimport { Order } from 'src/utilities/types';\nimport { IKameleoonData, KameleoonData, VisitsDataType } from './types';\nimport { TrackingStatus } from 'src/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 visits: number[];\n public status: TrackingStatus = TrackingStatus.Sent;\n\n /**\n * @param {number[]} visits - a list of visits\n * */\n constructor(visits: number[]) {\n this.visits = visits;\n }\n\n get url(): string {\n return '';\n }\n\n get data(): VisitsDataType {\n return {\n visits: this.visits,\n type: KameleoonData.VisitsData,\n status: this.status,\n };\n }\n\n get isSent(): boolean {\n return true;\n }\n\n /**\n * Adds a single timestamp while ensuring the list remains sorted and unique\n * @param {number} timestamp - The timestamp to add\n */\n set timestamp(timestamp: number) {\n Utilities.insertInOrderedListMutably({\n list: this.visits,\n element: timestamp,\n order: Order.Ascending,\n });\n\n this.visits = [...new Set(this.visits)];\n }\n}\n"],"mappings":"kuBASO,KAAM,CAAAA,UAAqC,CAShDC,WAAWA,CAACC,CAAgB,CAAE,CAAAC,eAAA,uBAAAA,eAAA,eALEC,sBAAc,CAACC,IAAI,EAMjD,IAAI,CAACH,MAAM,CAAGA,CAChB,CAEA,GAAI,CAAAI,GAAGA,CAAA,CAAW,CAChB,MAAO,EACT,CAEA,GAAI,CAAAC,IAAIA,CAAA,CAAmB,CACzB,MAAO,CACLL,MAAM,CAAE,IAAI,CAACA,MAAM,CACnBM,IAAI,CAAEC,qBAAa,CAACT,UAAU,CAC9BU,MAAM,CAAE,IAAI,CAACA,MACf,CACF,CAEA,GAAI,CAAAC,MAAMA,CAAA,CAAY,CACpB,QACF,CAMA,GAAI,CAAAC,SAASA,CAACA,CAAiB,CAAE,CAC/BC,oBAAS,CAACC,0BAA0B,CAAC,CACnCC,IAAI,CAAE,IAAI,CAACb,MAAM,CACjBc,OAAO,CAAEJ,CAAS,CAClBK,KAAK,CAAEC,YAAK,CAACC,SACf,CAAC,CAAC,CAEF,IAAI,CAACjB,MAAM,CAAG,CAAC,GAAG,GAAI,CAAAkB,GAAG,CAAC,IAAI,CAAClB,MAAM,CAAC,CACxC,CACF,CAACmB,OAAA,CAAArB,UAAA,CAAAA,UAAA","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
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
|
|
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: ${a}`,[_types.KameleoonException.JSONParse]:a=>`Couldn't parse JSON variable: ${a}`,[_types.KameleoonException.NumberParse]:a=>`It's not possible to parse value ${a} to Number`,[_types.KameleoonException.VersionParse]:a=>`It's not possible to parse a version value ${a} to Number, version should be in format x.x`,[_types.KameleoonException.SemanticVersionParse]:a=>`It's not possible to parse a version value ${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 ${a} was found.`,[_types.KameleoonException.FeatureFlagEnvironmentDisabled]:(a,b)=>`Feature flag with key ${a} is disabled in ${b} environment.`,[_types.KameleoonException.FeatureFlagVariableNotFound]:(a,b)=>`No feature flag variable with key ${a} was found for ${b} visitorCode.`,[_types.KameleoonException.FeatureFlagVariationNotFound]:(a,b)=>`No feature flag variation with key ${a} was found for ${b} visitorCode.`,[_types.KameleoonException.NotTargeted]:a=>`Visitor code ${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: ${a}`,[_types.KameleoonException.StorageRead]:a=>`No data found in storage under ${a} key`,[_types.KameleoonException.StorageEmpty]:()=>"No data found in storage",[_types.KameleoonException.StorageParse]:(a,b)=>`Couldn't parse ${b} storage data, the data may be corrupted. Error: ${a}`,[_types.KameleoonException.ClientConfiguration]:a=>`Couldn't retrieve client configuration from Kameleoon Api. Error: ${a}`,[_types.KameleoonException.TargetingCondition]:a=>`${a} targeting condition is not yet supported.`,[_types.KameleoonException.AmongValuesCheck]:(a,b)=>`Couldn't parse value "${b}": ${a}`,[_types.KameleoonException.RangeCheck]:a=>`Couldn't parse value "${a}" as a range, value should be in format [x: number, y: number]`,[_types.KameleoonException.RemoteData]:a=>`Couldn't retrieve data from Kameleoon server. Error: ${a}`,[_types.KameleoonException.MaximumRetriesReached]:a=>`Maximum retries reached, request failed. Reason: ${a}`};
|
|
2
2
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":["_types","require","Object","defineProperty","exports","value","ERROR_MESSAGES","KameleoonException","CookieParse","reason","
|
|
1
|
+
{"version":3,"file":"constants.js","names":["_types","require","Object","defineProperty","exports","value","ERROR_MESSAGES","KameleoonException","CookieParse","reason","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","RangeCheck","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]: (err: unknown) =>\n `Couldn't retrieve client configuration from Kameleoon Api. Error: ${err}`,\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.RangeCheck]: (value?: number[] | null) =>\n `Couldn't parse value \"${value}\" as a range, value should be in format [x: number, y: number]`,\n [KameleoonException.RemoteData]: (err: unknown) =>\n `Couldn't retrieve data from Kameleoon server. Error: ${err}`,\n [KameleoonException.MaximumRetriesReached]: (err: unknown) =>\n `Maximum retries reached, request failed. Reason: ${err}`,\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,CAAAE,cAAA,CAAG,CAC5B,CAACC,yBAAkB,CAACC,WAAW,EAAIC,CAAc,EAC/C,iCAAiCA,CAAM,EAAE,CAC3C,CAACF,yBAAkB,CAACG,SAAS,EAAIC,CAAY,EAC3C,iCAAiCA,CAAG,EAAE,CACxC,CAACJ,yBAAkB,CAACK,WAAW,EAAIP,CAAa,EAC9C,oCAAoCA,CAAK,YAAY,CACvD,CAACE,yBAAkB,CAACM,YAAY,EAAIR,CAAa,EAC/C,8CAA8CA,CAAK,6CAA6C,CAClG,CAACE,yBAAkB,CAACO,oBAAoB,EAAIT,CAAa,EACvD,8CAA8CA,CAAK,+CAA+C,CACpG,CAACE,yBAAkB,CAACQ,cAAc,EAAG,IACnC,0HAA0H,CAC5H,CAACR,yBAAkB,CAACS,WAAW,EAAG,IAChC,wDAAwD,CAC1D,CAACT,yBAAkB,CAACU,qBAAqB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AGA,CAAa,4CAA4C,CAC9D,CAAChC,yBAAkB,CAACiC,gBAAgB,EAAG,CAAC7B,CAAY,CAAEN,CAAa,GACjE,yBAAyBA,CAAK,MAAMM,CAAG,EAAE,CAC3C,CAACJ,yBAAkB,CAACkC,UAAU,EAAIpC,CAAuB,EACvD,yBAAyBA,CAAK,gEAAgE,CAChG,CAACE,yBAAkB,CAACmC,UAAU,EAAI/B,CAAY,EAC5C,wDAAwDA,CAAG,EAAE,CAC/D,CAACJ,yBAAkB,CAACoC,qBAAqB,EAAIhC,CAAY,EACvD,oDAAoDA,CAAG,EAC3D,CAAC","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.exhaustCheck=exhaustCheck;function exhaustCheck(a){throw new Error(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.exhaustCheck=exhaustCheck;function exhaustCheck(a){throw new Error(`Reaching an impossible state because of ${a}`)}
|
|
2
2
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","names":["exhaustCheck","option","Error"
|
|
1
|
+
{"version":3,"file":"helpers.js","names":["exhaustCheck","option","Error"],"sources":["../../src/kameleoonError/helpers.ts"],"sourcesContent":["export function exhaustCheck(option: never): never {\n throw new Error(`Reaching an impossible state because of ${option}`);\n}\n"],"mappings":"sGAAO,QAAS,CAAAA,YAAYA,CAACC,CAAa,CAAS,CACjD,KAAM,IAAI,CAAAC,KAAK,CAAC,2CAA2CD,CAAM,EAAE,CACrE","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/kameleoonError/index.ts"],"sourcesContent":["export { KameleoonError } from './kameleoonError';\nexport { KameleoonException } from './types';\nexport { exhaustCheck } from './helpers';\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/kameleoonError/index.ts"],"sourcesContent":["export { KameleoonError } from './kameleoonError';\nexport { KameleoonException } from './types';\nexport { exhaustCheck } from './helpers';\n"],"mappings":"","ignoreList":[]}
|
|
@@ -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 _defineProperty(a,b,c){return
|
|
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))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: ${a}`),_defineProperty(this,"errorType",void 0),this.name="KameleoonError",this.errorType=a;a===_types.KameleoonException.Initialization||a===_types.KameleoonException.Credentials||a===_types.KameleoonException.VisitorCodeMaxLength||a===_types.KameleoonException.VisitorCodeEmpty||a===_types.KameleoonException.StorageInitialization||a===_types.KameleoonException.VisitAmount||a===_types.KameleoonException.EventSourceInitialization||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.ClientConfiguration||a===_types.KameleoonException.MaximumRetriesReached||a===_types.KameleoonException.RemoteData||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):a===_types.KameleoonException.RangeCheck?this.message=_constants.ERROR_MESSAGES[a](b):(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","Error","constructor","type","secondParam","thirdParam","
|
|
1
|
+
{"version":3,"file":"kameleoonError.js","names":["KameleoonError","Error","constructor","type","secondParam","thirdParam","_defineProperty","name","errorType","KameleoonException","Initialization","Credentials","VisitorCodeMaxLength","VisitorCodeEmpty","StorageInitialization","VisitAmount","EventSourceInitialization","StorageEmpty","message","ERROR_MESSAGES","CookieParse","NotTargeted","FeatureFlagConfigurationNotFound","NumberParse","ClientConfiguration","MaximumRetriesReached","RemoteData","VersionParse","SemanticVersionParse","FeatureFlagVariationNotFound","FeatureFlagEnvironmentDisabled","FeatureFlagVariableNotFound","StorageWrite","JSONParse","StorageRead","StorageParse","TargetingCondition","AmongValuesCheck","RangeCheck","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.VisitorCodeMaxLength\n | KameleoonException.VisitorCodeEmpty\n | KameleoonException.VisitAmount\n | KameleoonException.StorageInitialization\n | KameleoonException.EventSourceInitialization\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:\n | KameleoonException.StorageWrite\n | KameleoonException.JSONParse\n | KameleoonException.RemoteData\n | KameleoonException.MaximumRetriesReached\n | KameleoonException.ClientConfiguration,\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(type: KameleoonException.RangeCheck, value?: number[] | null);\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.VisitorCodeMaxLength:\n case KameleoonException.VisitorCodeEmpty:\n case KameleoonException.StorageInitialization:\n case KameleoonException.VisitAmount:\n case KameleoonException.EventSourceInitialization:\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.ClientConfiguration:\n case KameleoonException.MaximumRetriesReached:\n case KameleoonException.RemoteData:\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 case KameleoonException.RangeCheck:\n this.message = ERROR_MESSAGES[type](\n secondParam as number[] | null | undefined,\n );\n break;\n default:\n exhaustCheck(type);\n }\n }\n\n get type(): KameleoonException {\n return this.errorType;\n }\n}\n"],"mappings":"isBAUO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A8B,EAvBhD3B,CAAI,GAwBLM,yBAAkB,CAACsB,2BAA2B,CACjD,IAAI,CAACb,OAAO,CAAGC,yBAAc,CAAChB,CAAI,CAAC,CACjCC,CAAW,CACXC,CACF,CAAC,CA5BGF,CAAI,GA8BLM,yBAAkB,CAACuB,YAAY,EA9B9B7B,CAAI,GA+BLM,yBAAkB,CAACwB,SAAS,CAC/B,IAAI,CAACf,OAAO,CAAGC,yBAAc,CAAChB,CAAI,CAAC,CAACC,CAAW,CAAC,CAhC5CD,CAAI,GAkCLM,yBAAkB,CAACyB,WAAW,CACjC,IAAI,CAAChB,OAAO,CAAGC,yBAAc,CAAChB,CAAI,CAAC,CAACC,CAAkC,CAAC,CAnCnED,CAAI,GAqCLM,yBAAkB,CAAC0B,YAAY,CAClC,IAAI,CAACjB,OAAO,CAAGC,yBAAc,CAAChB,CAAI,CAAC,CACjCC,CAAW,CACXC,CACF,CAAC,CAzCGF,CAAI,GA2CLM,yBAAkB,CAAC2B,kBAAkB,CACxC,IAAI,CAAClB,OAAO,CAAGC,yBAAc,CAAChB,CAAI,CAAC,CAACC,CAA4B,CAAC,CA5C7DD,CAAI,GA8CLM,yBAAkB,CAAC4B,gBAAgB,CACtC,IAAI,CAACnB,OAAO,CAAGC,yBAAc,CAAChB,CAAI,CAAC,CAACC,CAAW,CAAEC,CAAoB,CAAC,CA/ClEF,CAAI,GAiDLM,yBAAkB,CAAC6B,UAAU,CAChC,IAAI,CAACpB,OAAO,CAAGC,yBAAc,CAAChB,CAAI,CAAC,CACjCC,CACF,CAAC,CAGD,GAAAmC,qBAAY,EAACpC,CAAI,CAEvB,CAEA,GAAI,CAAAA,IAAIA,CAAA,CAAuB,CAC7B,MAAO,KAAI,CAACK,SACd,CACF,CAACgC,OAAA,CAAAxC,cAAA,CAAAA,cAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
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","RangeCheck","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 RangeCheck = 'RangeCheck',\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,UAAA,cAAlBpB,CAAkB,CAAAqB,cAAA,kBAAlBrB,CAAkB,CAAAsB,SAAA,aAAlBtB,CAAkB,CAAAuB,WAAA,eAAlBvB,CAAkB,CAAAwB,YAAA,gBAAlBxB,CAAkB,CAAAyB,WAAA,eAAlBzB,CAAkB,CAAA0B,oBAAA,wBAAlB1B,CAAkB,CAAA2B,UAAA,cAAlB3B,CAAkB,CAAA4B,qBAAA,yBAAlB5B,CAAkB"}
|
|
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","RangeCheck","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 RangeCheck = 'RangeCheck',\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,UAAA,cAAlBpB,CAAkB,CAAAqB,cAAA,kBAAlBrB,CAAkB,CAAAsB,SAAA,aAAlBtB,CAAkB,CAAAuB,WAAA,eAAlBvB,CAAkB,CAAAwB,YAAA,gBAAlBxB,CAAkB,CAAAyB,WAAA,eAAlBzB,CAAkB,CAAA0B,oBAAA,wBAAlB1B,CAAkB,CAAA2B,UAAA,cAAlB3B,CAAkB,CAAA4B,qBAAA,yBAAlB5B,CAAkB","ignoreList":[]}
|
package/dist/kameleoonUtils.d.ts
CHANGED
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
import { KameleoonResponseType, RequestType } from './requester';
|
|
2
|
-
import {
|
|
2
|
+
import { SimulateRequestDataType } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* KameleoonUtils - a class containing static Kameleoon helper methods
|
|
5
5
|
* */
|
|
6
6
|
export declare class KameleoonUtils {
|
|
7
|
-
/**
|
|
8
|
-
* @method getClientConfigurationUrl - a method to get client configuration url
|
|
9
|
-
* @deprecated this method will soon be removed in favor of custom `IExternalRequester` implementation
|
|
10
|
-
*
|
|
11
|
-
* @param {string} siteCode - site code
|
|
12
|
-
* @param {Environment} environment - environment, default is `production`
|
|
13
|
-
* @param {string} networkDomain - network domain to be used instead of default `kameleoon.com`, useful for proxying, must be in format `example.com`
|
|
14
|
-
* @returns {string} client configuration url
|
|
15
|
-
* */
|
|
16
|
-
static getClientConfigurationUrl(siteCode: string, environment?: Environment, networkDomain?: string): string;
|
|
17
7
|
/**
|
|
18
8
|
* @method simulateSuccessRequest - a method to simulate a successful request based on request type, primarily used for `IExternalRequester` implementations
|
|
19
9
|
*
|
package/dist/kameleoonUtils.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.KameleoonUtils=void 0;var _kameleoonError=require("./kameleoonError"),_requester=require("./requester");class KameleoonUtils{static
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.KameleoonUtils=void 0;var _kameleoonError=require("./kameleoonError"),_requester=require("./requester");class KameleoonUtils{static simulateSuccessRequest(a,b){switch(a){case _requester.RequestType.Tracking:return new Promise(a=>{a({status:204,json:()=>new Promise(a=>a(null)),text:()=>new Promise(a=>a("")),ok:!0})});case _requester.RequestType.Configuration:case _requester.RequestType.RemoteData:return new Promise(a=>{a({status:200,json:()=>new Promise(a=>a(b)),text:()=>new Promise(a=>a("")),ok:!0})});default:(0,_kameleoonError.exhaustCheck)(a)}}static getCookieValue(a,b){const c=a.split("; "),d=c.find(a=>{const[c,d]=a.split("=");return c===b&&""!==d});return d?d.split("=")[1]:null}}exports.KameleoonUtils=KameleoonUtils;
|
|
2
2
|
//# sourceMappingURL=kameleoonUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kameleoonUtils.js","names":["KameleoonUtils","
|
|
1
|
+
{"version":3,"file":"kameleoonUtils.js","names":["KameleoonUtils","simulateSuccessRequest","requestType","data","RequestType","Tracking","Promise","resolve","status","json","r","text","ok","Configuration","RemoteData","exhaustCheck","getCookieValue","cookie","key","pairs","split","pair","find","pairKey","pairValue","exports"],"sources":["../src/kameleoonUtils.ts"],"sourcesContent":["import { exhaustCheck } from './kameleoonError';\nimport { KameleoonResponseType, RequestType } from './requester';\nimport { SimulateRequestDataType } from './types';\n\n/**\n * KameleoonUtils - a class containing static Kameleoon helper methods\n * */\nexport class KameleoonUtils {\n /**\n * @method simulateSuccessRequest - a method to simulate a successful request based on request type, primarily used for `IExternalRequester` implementations\n *\n * @param {RequestType} requestType - request type\n * @param {SimulateRequestDataType[RequestType]} data - simulate data type for request\n * */\n public static simulateSuccessRequest<T extends RequestType>(\n requestType: T,\n data: SimulateRequestDataType[T],\n ): Promise<KameleoonResponseType> {\n switch (requestType) {\n case RequestType.Tracking:\n return new Promise((resolve) => {\n const response: KameleoonResponseType = {\n status: 204,\n json: () => new Promise((r) => r(null)),\n text: () => new Promise((r) => r('')),\n ok: true,\n };\n\n resolve(response);\n });\n case RequestType.Configuration:\n case RequestType.RemoteData:\n return new Promise((resolve) => {\n const response: KameleoonResponseType = {\n status: 200,\n json: () => new Promise((r) => r(data)),\n text: () => new Promise((r) => r('')),\n ok: true,\n };\n\n resolve(response);\n });\n default:\n exhaustCheck(requestType);\n }\n }\n\n /**\n * @method getCookieValue - a method to get a cookie value by key from a cookie string, primarily used for `IExternalVisitorCodeManager` implementations\n *\n * @param {string} cookie - cookie string\n * @param {string} key - cookie key\n * @returns {string | null} cookie value or null if not found\n * */\n public static getCookieValue(cookie: string, key: string): string | null {\n const pairs = cookie.split('; ');\n const pair = pairs.find((pair) => {\n const [pairKey, pairValue] = pair.split('=');\n\n return pairKey === key && pairValue !== '';\n });\n\n if (pair) {\n return pair.split('=')[1];\n }\n\n return null;\n }\n}\n"],"mappings":"oLAOO,KAAM,CAAAA,cAAe,CAO1B,MAAc,CAAAC,sBAAsBA,CAClCC,CAAc,CACdC,CAAgC,CACA,CAChC,OAAQD,CAAW,EACjB,IAAK,CAAAE,sBAAW,CAACC,QAAQ,CACvB,MAAO,IAAI,CAAAC,OAAO,CAAEC,CAAO,EAAK,CAQ9BA,CAAO,CAPiC,CACtCC,MAAM,CAAE,GAAG,CACXC,IAAI,CAAEA,CAAA,GAAM,GAAI,CAAAH,OAAO,CAAEI,CAAC,EAAKA,CAAC,CAAC,IAAI,CAAC,CAAC,CACvCC,IAAI,CAAEA,CAAA,GAAM,GAAI,CAAAL,OAAO,CAAEI,CAAC,EAAKA,CAAC,CAAC,EAAE,CAAC,CAAC,CACrCE,EAAE,GACJ,CAEgB,CAClB,CAAC,CAAC,CACJ,IAAK,CAAAR,sBAAW,CAACS,aAAa,CAC9B,IAAK,CAAAT,sBAAW,CAACU,UAAU,CACzB,MAAO,IAAI,CAAAR,OAAO,CAAEC,CAAO,EAAK,CAQ9BA,CAAO,CAPiC,CACtCC,MAAM,CAAE,GAAG,CACXC,IAAI,CAAEA,CAAA,GAAM,GAAI,CAAAH,OAAO,CAAEI,CAAC,EAAKA,CAAC,CAACP,CAAI,CAAC,CAAC,CACvCQ,IAAI,CAAEA,CAAA,GAAM,GAAI,CAAAL,OAAO,CAAEI,CAAC,EAAKA,CAAC,CAAC,EAAE,CAAC,CAAC,CACrCE,EAAE,GACJ,CAEgB,CAClB,CAAC,CAAC,CACJ,QACE,GAAAG,4BAAY,EAACb,CAAW,CAC5B,CACF,CASA,MAAc,CAAAc,cAAcA,CAACC,CAAc,CAAEC,CAAW,CAAiB,MACjE,CAAAC,CAAK,CAAGF,CAAM,CAACG,KAAK,CAAC,IAAI,CAAC,CAC1BC,CAAI,CAAGF,CAAK,CAACG,IAAI,CAAED,CAAI,EAAK,CAChC,KAAM,CAACE,CAAO,CAAEC,CAAS,CAAC,CAAGH,CAAI,CAACD,KAAK,CAAC,GAAG,CAAC,CAE5C,MAAO,CAAAG,CAAO,GAAKL,CAAG,EAAkB,EAAE,GAAhBM,CAC5B,CAAC,CAAC,OAEE,CAAAH,CAAI,CACCA,CAAI,CAACD,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAGpB,IACT,CACF,CAACK,OAAA,CAAAzB,cAAA,CAAAA,cAAA","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var _types=require("./types");Object.defineProperty(exports,"__esModule",{value:!0}),exports.UrlTracking=exports.UrlQuery=exports.UrlParameter=exports.UrlFirstParameter=exports.UrlEventType=exports.NUMBER_OF_RETRIES=exports.Header=exports.DEFAULT_DOMAINS=void 0;const NUMBER_OF_RETRIES=exports.NUMBER_OF_RETRIES=2;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=",Kcs:"&kcs="},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=",Kcs:"?kcs="},UrlQuery=exports.UrlQuery={Sse:"sse?siteCode=",Map:"map?siteCode=",Events:"events?siteCode=",Visitor:"visitor?siteCode="},UrlTracking=exports.UrlTracking={Visit:"visit/",Map:"map/"},DEFAULT_DOMAINS=exports.DEFAULT_DOMAINS={[_types.UrlType.DataApi]:{subdomain:"data",topLevelDomain:"io",secondLevelDomain:"kameleoon"},[_types.UrlType.Events]:{subdomain:"events",topLevelDomain:"com",secondLevelDomain:"kameleoon"},[_types.UrlType.ClientConfiguration]:{subdomain:"sdk-config",topLevelDomain:"eu",secondLevelDomain:"kameleoon"}};
|
|
1
|
+
"use strict";var _types=require("./types");Object.defineProperty(exports,"__esModule",{value:!0}),exports.UrlTracking=exports.UrlQuery=exports.UrlParameter=exports.UrlFirstParameter=exports.UrlEventType=exports.NUMBER_OF_RETRIES=exports.Header=exports.DEFAULT_DOMAINS=void 0;const NUMBER_OF_RETRIES=exports.NUMBER_OF_RETRIES=2;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=",Kcs:"&kcs=",UserAgent:"&userAgent=",BodyUa:"&bodyUa="},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=",Kcs:"?kcs=",UserAgent:"?userAgent=",BodyUa:"?bodyUa="},UrlQuery=exports.UrlQuery={Sse:"sse?siteCode=",Map:"map?siteCode=",Events:"events?siteCode=",Visitor:"visitor?siteCode="},UrlTracking=exports.UrlTracking={Visit:"visit/",Map:"map/"},DEFAULT_DOMAINS=exports.DEFAULT_DOMAINS={[_types.UrlType.DataApi]:{subdomain:"data",topLevelDomain:"io",secondLevelDomain:"kameleoon"},[_types.UrlType.Events]:{subdomain:"events",topLevelDomain:"com",secondLevelDomain:"kameleoon"},[_types.UrlType.ClientConfiguration]:{subdomain:"sdk-config",topLevelDomain:"eu",secondLevelDomain:"kameleoon"}};
|
|
2
2
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":["_types","require","Object","defineProperty","exports","value","UrlTracking","UrlQuery","UrlParameter","UrlFirstParameter","UrlEventType","NUMBER_OF_RETRIES","Header","DEFAULT_DOMAINS","UserAgent","ContentType","SdkVersion","SdkType","Authorization","AcceptEncoding","CustomData","StaticData","Page","Conversion","Activity","Experiment","Geolocation","Title","ReferrersIndices","Negative","Revenue","Overwrite","Index","BrowserIndex","BrowserVersion","Href","DeviceType","SiteCode","GoalId","VisitorCode","VariationId","Ts","Key","SdkName","ValuesCountMap","Nonce","Id","CurrentVisit","MaxNumberPreviousVisits","Os","OsIndex","Country","City","Region","Latitude","Longitude","PostalCode","Browser","Environment","MappingIdentifier","MappingValue","Kcs","Sse","Map","Events","Visitor","Visit","UrlType","DataApi","subdomain","topLevelDomain","secondLevelDomain","ClientConfiguration"],"sources":["../../src/requester/constants.ts"],"sourcesContent":["import {\n DomainsType,\n EventType,\n ParameterType,\n QueryType,\n UrlType,\n StrictEventTypeRecord,\n StrictFirstParameterRecord,\n StrictParameterRecord,\n StrictQueryRecord,\n StrictTrackingRecord,\n TrackingType,\n} from './types';\n\nexport const NUMBER_OF_RETRIES = 2;\n\nexport enum Header {\n UserAgent = 'User-Agent',\n ContentType = 'Content-Type',\n SdkVersion = 'X-Kameleoon-SDK-Version',\n SdkType = 'X-Kameleoon-SDK-Type',\n Authorization = 'Authorization',\n AcceptEncoding = 'Accept-Encoding',\n}\n\nexport const UrlEventType: StrictEventTypeRecord<EventType> = {\n CustomData: 'eventType=customData',\n StaticData: 'eventType=staticData',\n Page: 'eventType=page',\n Conversion: 'eventType=conversion',\n Activity: 'eventType=activity',\n Experiment: 'eventType=experiment',\n Geolocation: 'eventType=geolocation',\n};\nexport const UrlParameter: StrictParameterRecord<ParameterType> = {\n Title: '&title=',\n ReferrersIndices: '&referrersIndices=',\n Negative: '&negative=',\n Revenue: '&revenue=',\n Overwrite: '&overwrite=',\n Index: '&index=',\n BrowserIndex: '&browserIndex=',\n BrowserVersion: '&browserVersion=',\n Href: '&href=',\n DeviceType: '&deviceType=',\n SiteCode: '&siteCode=',\n GoalId: '&goalId=',\n VisitorCode: '&visitorCode=',\n VariationId: '&variationId=',\n Ts: '&ts=',\n Key: '&key=',\n SdkName: '&sdkName=',\n SdkVersion: '&sdkVersion=',\n ValuesCountMap: '&valuesCountMap=',\n Nonce: '&nonce=',\n Id: '&id=',\n CustomData: '&customData=',\n CurrentVisit: '¤tVisit=',\n MaxNumberPreviousVisits: '&maxNumberPreviousVisits=',\n Os: '&os=',\n OsIndex: '&osIndex=',\n Country: '&country=',\n City: '&city=',\n Region: '®ion=',\n Latitude: '&latitude=',\n Longitude: '&longitude=',\n PostalCode: '&postalCode=',\n Conversion: '&conversion=',\n StaticData: '&staticData=',\n Geolocation: '&geolocation=',\n Page: '&page=',\n Experiment: '&experiment=',\n Browser: '&browser=',\n Environment: '&environment=',\n MappingIdentifier: '&mappingIdentifier=',\n MappingValue: '&mappingValue=',\n Kcs: '&kcs=',\n};\nexport const UrlFirstParameter: StrictFirstParameterRecord<ParameterType> = {\n CustomData: '?customData=',\n StaticData: '?staticData=',\n Page: '?page=',\n Conversion: '?conversion=',\n Geolocation: '?geolocation=',\n Experiment: '?experiment=',\n ValuesCountMap: '?valuesCountMap=',\n Id: '?id=',\n Nonce: '?nonce=',\n Country: '?country=',\n Environment: '?environment=',\n City: '?city=',\n Region: '?region=',\n Latitude: '?latitude=',\n Longitude: '?longitude=',\n PostalCode: '?postalCode=',\n SdkName: '?sdkName=',\n SdkVersion: '?sdkVersion=',\n BrowserIndex: '?browserIndex=',\n BrowserVersion: '?browserVersion=',\n SiteCode: '?siteCode=',\n VisitorCode: '?visitorCode=',\n CurrentVisit: '?currentVisit=',\n MaxNumberPreviousVisits: '?maxNumberPreviousVisits=',\n Negative: '?negative=',\n Revenue: '?revenue=',\n Title: '?title=',\n Os: '?os=',\n OsIndex: '?osIndex=',\n Browser: '?browser=',\n ReferrersIndices: '?referrersIndices=',\n Overwrite: '?overwrite=',\n Index: '?index=',\n Href: '?href=',\n VariationId: '?variationId=',\n DeviceType: '?deviceType=',\n GoalId: '?goalId=',\n Ts: '?ts=',\n Key: '?key=',\n MappingIdentifier: '?mappingIdentifier=',\n MappingValue: '?mappingValue=',\n Kcs: '?kcs=',\n};\nexport const UrlQuery: StrictQueryRecord<QueryType> = {\n Sse: 'sse?siteCode=',\n Map: 'map?siteCode=',\n Events: 'events?siteCode=',\n Visitor: 'visitor?siteCode=',\n};\nexport const UrlTracking: StrictTrackingRecord<TrackingType> = {\n Visit: 'visit/',\n Map: 'map/',\n};\n\nexport const DEFAULT_DOMAINS: DomainsType = {\n [UrlType.DataApi]: {\n subdomain: 'data',\n topLevelDomain: 'io',\n secondLevelDomain: 'kameleoon',\n },\n [UrlType.Events]: {\n subdomain: 'events',\n topLevelDomain: 'com',\n secondLevelDomain: 'kameleoon',\n },\n [UrlType.ClientConfiguration]: {\n subdomain: 'sdk-config',\n topLevelDomain: 'eu',\n secondLevelDomain: 'kameleoon',\n },\n};\n"],"mappings":"aAAA,IAAAA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AW,CAAE,eAAe,CAC5BC,WAAW,CAAE,eAAe,CAC5BC,EAAE,CAAE,MAAM,CACVC,GAAG,CAAE,OAAO,CACZC,OAAO,CAAE,WAAW,CACpB3B,UAAU,CAAE,cAAc,CAC1B4B,cAAc,CAAE,kBAAkB,CAClCC,KAAK,CAAE,SAAS,CAChBC,EAAE,CAAE,MAAM,CACV1B,UAAU,CAAE,cAAc,CAC1B2B,YAAY,CAAE,gBAAgB,CAC9BC,uBAAuB,CAAE,2BAA2B,CACpDC,EAAE,CAAE,MAAM,CACVC,OAAO,CAAE,WAAW,CACpBC,OAAO,CAAE,WAAW,CACpBC,IAAI,CAAE,QAAQ,CACdC,MAAM,CAAE,UAAU,CAClBC,QAAQ,CAAE,YAAY,CACtBC,SAAS,CAAE,aAAa,CACxBC,UAAU,CAAE,cAAc,CAC1BjC,UAAU,CAAE,cAAc,CAC1BF,UAAU,CAAE,cAAc,CAC1BK,WAAW,CAAE,eAAe,CAC5BJ,IAAI,CAAE,QAAQ,CACdG,UAAU,CAAE,cAAc,CAC1BgC,OAAO,CAAE,WAAW,CACpBC,WAAW,CAAE,eAAe,CAC5BC,iBAAiB,CAAE,qBAAqB,CACxCC,YAAY,CAAE,gBAAgB,CAC9BC,GAAG,CAAE,
|
|
1
|
+
{"version":3,"file":"constants.js","names":["_types","require","Object","defineProperty","exports","value","UrlTracking","UrlQuery","UrlParameter","UrlFirstParameter","UrlEventType","NUMBER_OF_RETRIES","Header","DEFAULT_DOMAINS","UserAgent","ContentType","SdkVersion","SdkType","Authorization","AcceptEncoding","CustomData","StaticData","Page","Conversion","Activity","Experiment","Geolocation","Title","ReferrersIndices","Negative","Revenue","Overwrite","Index","BrowserIndex","BrowserVersion","Href","DeviceType","SiteCode","GoalId","VisitorCode","VariationId","Ts","Key","SdkName","ValuesCountMap","Nonce","Id","CurrentVisit","MaxNumberPreviousVisits","Os","OsIndex","Country","City","Region","Latitude","Longitude","PostalCode","Browser","Environment","MappingIdentifier","MappingValue","Kcs","BodyUa","Sse","Map","Events","Visitor","Visit","UrlType","DataApi","subdomain","topLevelDomain","secondLevelDomain","ClientConfiguration"],"sources":["../../src/requester/constants.ts"],"sourcesContent":["import {\n DomainsType,\n EventType,\n ParameterType,\n QueryType,\n UrlType,\n StrictEventTypeRecord,\n StrictFirstParameterRecord,\n StrictParameterRecord,\n StrictQueryRecord,\n StrictTrackingRecord,\n TrackingType,\n} from './types';\n\nexport const NUMBER_OF_RETRIES = 2;\n\nexport enum Header {\n UserAgent = 'User-Agent',\n ContentType = 'Content-Type',\n SdkVersion = 'X-Kameleoon-SDK-Version',\n SdkType = 'X-Kameleoon-SDK-Type',\n Authorization = 'Authorization',\n AcceptEncoding = 'Accept-Encoding',\n}\n\nexport const UrlEventType: StrictEventTypeRecord<EventType> = {\n CustomData: 'eventType=customData',\n StaticData: 'eventType=staticData',\n Page: 'eventType=page',\n Conversion: 'eventType=conversion',\n Activity: 'eventType=activity',\n Experiment: 'eventType=experiment',\n Geolocation: 'eventType=geolocation',\n};\nexport const UrlParameter: StrictParameterRecord<ParameterType> = {\n Title: '&title=',\n ReferrersIndices: '&referrersIndices=',\n Negative: '&negative=',\n Revenue: '&revenue=',\n Overwrite: '&overwrite=',\n Index: '&index=',\n BrowserIndex: '&browserIndex=',\n BrowserVersion: '&browserVersion=',\n Href: '&href=',\n DeviceType: '&deviceType=',\n SiteCode: '&siteCode=',\n GoalId: '&goalId=',\n VisitorCode: '&visitorCode=',\n VariationId: '&variationId=',\n Ts: '&ts=',\n Key: '&key=',\n SdkName: '&sdkName=',\n SdkVersion: '&sdkVersion=',\n ValuesCountMap: '&valuesCountMap=',\n Nonce: '&nonce=',\n Id: '&id=',\n CustomData: '&customData=',\n CurrentVisit: '¤tVisit=',\n MaxNumberPreviousVisits: '&maxNumberPreviousVisits=',\n Os: '&os=',\n OsIndex: '&osIndex=',\n Country: '&country=',\n City: '&city=',\n Region: '®ion=',\n Latitude: '&latitude=',\n Longitude: '&longitude=',\n PostalCode: '&postalCode=',\n Conversion: '&conversion=',\n StaticData: '&staticData=',\n Geolocation: '&geolocation=',\n Page: '&page=',\n Experiment: '&experiment=',\n Browser: '&browser=',\n Environment: '&environment=',\n MappingIdentifier: '&mappingIdentifier=',\n MappingValue: '&mappingValue=',\n Kcs: '&kcs=',\n UserAgent: '&userAgent=',\n BodyUa: '&bodyUa=',\n};\nexport const UrlFirstParameter: StrictFirstParameterRecord<ParameterType> = {\n CustomData: '?customData=',\n StaticData: '?staticData=',\n Page: '?page=',\n Conversion: '?conversion=',\n Geolocation: '?geolocation=',\n Experiment: '?experiment=',\n ValuesCountMap: '?valuesCountMap=',\n Id: '?id=',\n Nonce: '?nonce=',\n Country: '?country=',\n Environment: '?environment=',\n City: '?city=',\n Region: '?region=',\n Latitude: '?latitude=',\n Longitude: '?longitude=',\n PostalCode: '?postalCode=',\n SdkName: '?sdkName=',\n SdkVersion: '?sdkVersion=',\n BrowserIndex: '?browserIndex=',\n BrowserVersion: '?browserVersion=',\n SiteCode: '?siteCode=',\n VisitorCode: '?visitorCode=',\n CurrentVisit: '?currentVisit=',\n MaxNumberPreviousVisits: '?maxNumberPreviousVisits=',\n Negative: '?negative=',\n Revenue: '?revenue=',\n Title: '?title=',\n Os: '?os=',\n OsIndex: '?osIndex=',\n Browser: '?browser=',\n ReferrersIndices: '?referrersIndices=',\n Overwrite: '?overwrite=',\n Index: '?index=',\n Href: '?href=',\n VariationId: '?variationId=',\n DeviceType: '?deviceType=',\n GoalId: '?goalId=',\n Ts: '?ts=',\n Key: '?key=',\n MappingIdentifier: '?mappingIdentifier=',\n MappingValue: '?mappingValue=',\n Kcs: '?kcs=',\n UserAgent: '?userAgent=',\n BodyUa: '?bodyUa=',\n};\nexport const UrlQuery: StrictQueryRecord<QueryType> = {\n Sse: 'sse?siteCode=',\n Map: 'map?siteCode=',\n Events: 'events?siteCode=',\n Visitor: 'visitor?siteCode=',\n};\nexport const UrlTracking: StrictTrackingRecord<TrackingType> = {\n Visit: 'visit/',\n Map: 'map/',\n};\n\nexport const DEFAULT_DOMAINS: DomainsType = {\n [UrlType.DataApi]: {\n subdomain: 'data',\n topLevelDomain: 'io',\n secondLevelDomain: 'kameleoon',\n },\n [UrlType.Events]: {\n subdomain: 'events',\n topLevelDomain: 'com',\n secondLevelDomain: 'kameleoon',\n },\n [UrlType.ClientConfiguration]: {\n subdomain: 'sdk-config',\n topLevelDomain: 'eu',\n secondLevelDomain: 'kameleoon',\n },\n};\n"],"mappings":"aAAA,IAAAA,MAAA,CAAAC,OAAA,YAYiBC,MAAA,CAAAC,cAAA,CAAAC,OAAA,eAAAC,KAAA,MAAAD,OAAA,CAAAE,WAAA,CAAAF,OAAA,CAAAG,QAAA,CAAAH,OAAA,CAAAI,YAAA,CAAAJ,OAAA,CAAAK,iBAAA,CAAAL,OAAA,CAAAM,YAAA,CAAAN,OAAA,CAAAO,iBAAA,CAAAP,OAAA,CAAAQ,MAAA,CAAAR,OAAA,CAAAS,eAAA,QAEV,KAAM,CAAAF,iBAAiB,CAAAP,OAAA,CAAAO,iBAAA,CAAG,CAAC,CAAC,GAEvB,CAAAC,MAAM,CAAAR,OAAA,CAAAQ,MAAA,UAANA,CAAM,QAAN,CAAAA,CAAM,CAAAE,SAAA,cAANF,CAAM,CAAAG,WAAA,gBAANH,CAAM,CAAAI,UAAA,2BAANJ,CAAM,CAAAK,OAAA,wBAANL,CAAM,CAAAM,aAAA,iBAANN,CAAM,CAAAO,cAAA,mBAANP,CAAM,WASL,CAAAF,YAA8C,CAAAN,OAAA,CAAAM,YAAA,CAAG,CAC5DU,UAAU,CAAE,sBAAsB,CAClCC,UAAU,CAAE,sBAAsB,CAClCC,IAAI,CAAE,gBAAgB,CACtBC,UAAU,CAAE,sBAAsB,CAClCC,QAAQ,CAAE,oBAAoB,CAC9BC,UAAU,CAAE,sBAAsB,CAClCC,WAAW,CAAE,uBACf,CAAC,CACYlB,YAAkD,CAAAJ,OAAA,CAAAI,YAAA,CAAG,CAChEmB,KAAK,CAAE,SAAS,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e,CACpBC,MAAM,CAAE,kBAAkB,CAC1BC,OAAO,CAAE,mBACX,CAAC,CACY5D,WAA+C,CAAAF,OAAA,CAAAE,WAAA,CAAG,CAC7D6D,KAAK,CAAE,QAAQ,CACfH,GAAG,CAAE,MACP,CAAC,CAEYnD,eAA4B,CAAAT,OAAA,CAAAS,eAAA,CAAG,CAC1C,CAACuD,cAAO,CAACC,OAAO,EAAG,CACjBC,SAAS,CAAE,MAAM,CACjBC,cAAc,CAAE,IAAI,CACpBC,iBAAiB,CAAE,WACrB,CAAC,CACD,CAACJ,cAAO,CAACH,MAAM,EAAG,CAChBK,SAAS,CAAE,QAAQ,CACnBC,cAAc,CAAE,KAAK,CACrBC,iBAAiB,CAAE,WACrB,CAAC,CACD,CAACJ,cAAO,CAACK,mBAAmB,EAAG,CAC7BH,SAAS,CAAE,YAAY,CACvBC,cAAc,CAAE,IAAI,CACpBC,iBAAiB,CAAE,WACrB,CACF,CAAC","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { Requester } from './requester';
|
|
2
2
|
export { IUrlProvider, UrlProvider } from './urlProvider';
|
|
3
3
|
export { NUMBER_OF_RETRIES, UrlQuery, UrlEventType, UrlParameter, UrlFirstParameter, DEFAULT_DOMAINS, Header, } from './constants';
|
|
4
|
-
export { HttpMethod, HeadersType, VisitType, UrlType, DomainType, RetryCountType,
|
|
4
|
+
export { HttpMethod, HeadersType, VisitType, UrlType, DomainType, RetryCountType, StaticDataEventType, GetVisitorDataResultType, IExternalRequester, KameleoonResponseType, RequestType, SendRequestParametersType, RequestParametersType, } from './types';
|
package/dist/requester/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"DEFAULT_DOMAINS",{enumerable:!0,get:function(){return _constants.DEFAULT_DOMAINS}}),Object.defineProperty(exports,"DomainType",{enumerable:!0,get:function(){return _types.DomainType}}),Object.defineProperty(exports,"GetVisitorDataResultType",{enumerable:!0,get:function(){return _types.GetVisitorDataResultType}}),Object.defineProperty(exports,"Header",{enumerable:!0,get:function(){return _constants.Header}}),Object.defineProperty(exports,"HeadersType",{enumerable:!0,get:function(){return _types.HeadersType}}),Object.defineProperty(exports,"HttpMethod",{enumerable:!0,get:function(){return _types.HttpMethod}}),Object.defineProperty(exports,"IExternalRequester",{enumerable:!0,get:function(){return _types.IExternalRequester}}),Object.defineProperty(exports,"IUrlProvider",{enumerable:!0,get:function(){return _urlProvider.IUrlProvider}}),Object.defineProperty(exports,"KameleoonResponseType",{enumerable:!0,get:function(){return _types.KameleoonResponseType}}),Object.defineProperty(exports,"NUMBER_OF_RETRIES",{enumerable:!0,get:function(){return _constants.NUMBER_OF_RETRIES}}),Object.defineProperty(exports,"RequestParametersType",{enumerable:!0,get:function(){return _types.RequestParametersType}}),Object.defineProperty(exports,"RequestType",{enumerable:!0,get:function(){return _types.RequestType}}),Object.defineProperty(exports,"Requester",{enumerable:!0,get:function(){return _requester.Requester}}),Object.defineProperty(exports,"RetryCountType",{enumerable:!0,get:function(){return _types.RetryCountType}}),Object.defineProperty(exports,"SendRequestParametersType",{enumerable:!0,get:function(){return _types.SendRequestParametersType}}),Object.defineProperty(exports,"StaticDataEventType",{enumerable:!0,get:function(){return _types.StaticDataEventType}}),Object.defineProperty(exports,"
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"DEFAULT_DOMAINS",{enumerable:!0,get:function(){return _constants.DEFAULT_DOMAINS}}),Object.defineProperty(exports,"DomainType",{enumerable:!0,get:function(){return _types.DomainType}}),Object.defineProperty(exports,"GetVisitorDataResultType",{enumerable:!0,get:function(){return _types.GetVisitorDataResultType}}),Object.defineProperty(exports,"Header",{enumerable:!0,get:function(){return _constants.Header}}),Object.defineProperty(exports,"HeadersType",{enumerable:!0,get:function(){return _types.HeadersType}}),Object.defineProperty(exports,"HttpMethod",{enumerable:!0,get:function(){return _types.HttpMethod}}),Object.defineProperty(exports,"IExternalRequester",{enumerable:!0,get:function(){return _types.IExternalRequester}}),Object.defineProperty(exports,"IUrlProvider",{enumerable:!0,get:function(){return _urlProvider.IUrlProvider}}),Object.defineProperty(exports,"KameleoonResponseType",{enumerable:!0,get:function(){return _types.KameleoonResponseType}}),Object.defineProperty(exports,"NUMBER_OF_RETRIES",{enumerable:!0,get:function(){return _constants.NUMBER_OF_RETRIES}}),Object.defineProperty(exports,"RequestParametersType",{enumerable:!0,get:function(){return _types.RequestParametersType}}),Object.defineProperty(exports,"RequestType",{enumerable:!0,get:function(){return _types.RequestType}}),Object.defineProperty(exports,"Requester",{enumerable:!0,get:function(){return _requester.Requester}}),Object.defineProperty(exports,"RetryCountType",{enumerable:!0,get:function(){return _types.RetryCountType}}),Object.defineProperty(exports,"SendRequestParametersType",{enumerable:!0,get:function(){return _types.SendRequestParametersType}}),Object.defineProperty(exports,"StaticDataEventType",{enumerable:!0,get:function(){return _types.StaticDataEventType}}),Object.defineProperty(exports,"UrlEventType",{enumerable:!0,get:function(){return _constants.UrlEventType}}),Object.defineProperty(exports,"UrlFirstParameter",{enumerable:!0,get:function(){return _constants.UrlFirstParameter}}),Object.defineProperty(exports,"UrlParameter",{enumerable:!0,get:function(){return _constants.UrlParameter}}),Object.defineProperty(exports,"UrlProvider",{enumerable:!0,get:function(){return _urlProvider.UrlProvider}}),Object.defineProperty(exports,"UrlQuery",{enumerable:!0,get:function(){return _constants.UrlQuery}}),Object.defineProperty(exports,"UrlType",{enumerable:!0,get:function(){return _types.UrlType}}),Object.defineProperty(exports,"VisitType",{enumerable:!0,get:function(){return _types.VisitType}});var _requester=require("./requester"),_urlProvider=require("./urlProvider"),_constants=require("./constants"),_types=require("./types");
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/requester/index.ts"],"sourcesContent":["export { Requester } from './requester';\nexport { IUrlProvider, UrlProvider } from './urlProvider';\nexport {\n NUMBER_OF_RETRIES,\n UrlQuery,\n UrlEventType,\n UrlParameter,\n UrlFirstParameter,\n DEFAULT_DOMAINS,\n Header,\n} from './constants';\nexport {\n HttpMethod,\n HeadersType,\n VisitType,\n UrlType,\n DomainType,\n RetryCountType,\n
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/requester/index.ts"],"sourcesContent":["export { Requester } from './requester';\nexport { IUrlProvider, UrlProvider } from './urlProvider';\nexport {\n NUMBER_OF_RETRIES,\n UrlQuery,\n UrlEventType,\n UrlParameter,\n UrlFirstParameter,\n DEFAULT_DOMAINS,\n Header,\n} from './constants';\nexport {\n HttpMethod,\n HeadersType,\n VisitType,\n UrlType,\n DomainType,\n RetryCountType,\n StaticDataEventType,\n GetVisitorDataResultType,\n IExternalRequester,\n KameleoonResponseType,\n RequestType,\n SendRequestParametersType,\n RequestParametersType,\n} from './types';\n"],"mappings":"","ignoreList":[]}
|