@kameleoon/javascript-sdk-core 4.0.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/clientConfiguration/clientConfiguration.js +1 -1
  3. package/dist/clientConfiguration/clientConfiguration.js.map +1 -1
  4. package/dist/clientConfiguration/constants.js +1 -1
  5. package/dist/clientConfiguration/constants.js.map +1 -1
  6. package/dist/clientConfiguration/types.d.ts +1 -1
  7. package/dist/clientConfiguration/types.js.map +1 -1
  8. package/dist/constants.js +1 -1
  9. package/dist/constants.js.map +1 -1
  10. package/dist/kameleoonClient.d.ts +2 -1
  11. package/dist/kameleoonClient.js +1 -1
  12. package/dist/kameleoonClient.js.map +1 -1
  13. package/dist/kameleoonClientInterface.d.ts +2 -2
  14. package/dist/kameleoonClientInterface.js.map +1 -1
  15. package/dist/kameleoonData/applicationVersion.d.ts +0 -9
  16. package/dist/kameleoonData/applicationVersion.js.map +1 -1
  17. package/dist/kameleoonData/browser.d.ts +3 -12
  18. package/dist/kameleoonData/browser.js +1 -1
  19. package/dist/kameleoonData/browser.js.map +1 -1
  20. package/dist/kameleoonData/conversion.d.ts +11 -13
  21. package/dist/kameleoonData/conversion.js +1 -1
  22. package/dist/kameleoonData/conversion.js.map +1 -1
  23. package/dist/kameleoonData/cookie.d.ts +0 -9
  24. package/dist/kameleoonData/cookie.js.map +1 -1
  25. package/dist/kameleoonData/customData.d.ts +3 -13
  26. package/dist/kameleoonData/customData.js +1 -1
  27. package/dist/kameleoonData/customData.js.map +1 -1
  28. package/dist/kameleoonData/dataManager.d.ts +11 -5
  29. package/dist/kameleoonData/dataManager.js +1 -1
  30. package/dist/kameleoonData/dataManager.js.map +1 -1
  31. package/dist/kameleoonData/dataProcessor.d.ts +13 -6
  32. package/dist/kameleoonData/dataProcessor.js +1 -1
  33. package/dist/kameleoonData/dataProcessor.js.map +1 -1
  34. package/dist/kameleoonData/device.d.ts +3 -12
  35. package/dist/kameleoonData/device.js +1 -1
  36. package/dist/kameleoonData/device.js.map +1 -1
  37. package/dist/kameleoonData/geolocation.d.ts +3 -12
  38. package/dist/kameleoonData/geolocation.js +1 -1
  39. package/dist/kameleoonData/geolocation.js.map +1 -1
  40. package/dist/kameleoonData/index.d.ts +1 -0
  41. package/dist/kameleoonData/index.js +1 -1
  42. package/dist/kameleoonData/index.js.map +1 -1
  43. package/dist/kameleoonData/kameleoonConversionScore.d.ts +15 -0
  44. package/dist/kameleoonData/kameleoonConversionScore.js +2 -0
  45. package/dist/kameleoonData/kameleoonConversionScore.js.map +1 -0
  46. package/dist/kameleoonData/operatingSystem.d.ts +3 -12
  47. package/dist/kameleoonData/operatingSystem.js +1 -1
  48. package/dist/kameleoonData/operatingSystem.js.map +1 -1
  49. package/dist/kameleoonData/pageView.d.ts +4 -13
  50. package/dist/kameleoonData/pageView.js +1 -1
  51. package/dist/kameleoonData/pageView.js.map +1 -1
  52. package/dist/kameleoonData/types.d.ts +54 -11
  53. package/dist/kameleoonData/types.js +1 -1
  54. package/dist/kameleoonData/types.js.map +1 -1
  55. package/dist/kameleoonData/userAgent.d.ts +0 -9
  56. package/dist/kameleoonData/userAgent.js.map +1 -1
  57. package/dist/kameleoonData/visitProcessor.d.ts +34 -0
  58. package/dist/kameleoonData/visitProcessor.js +2 -0
  59. package/dist/kameleoonData/visitProcessor.js.map +1 -0
  60. package/dist/kameleoonData/visitsData.d.ts +7 -21
  61. package/dist/kameleoonData/visitsData.js +1 -1
  62. package/dist/kameleoonData/visitsData.js.map +1 -1
  63. package/dist/requester/constants.d.ts +1 -3
  64. package/dist/requester/constants.js +1 -1
  65. package/dist/requester/constants.js.map +1 -1
  66. package/dist/requester/index.d.ts +1 -1
  67. package/dist/requester/index.js +1 -1
  68. package/dist/requester/index.js.map +1 -1
  69. package/dist/requester/requester.d.ts +2 -6
  70. package/dist/requester/requester.js +1 -1
  71. package/dist/requester/requester.js.map +1 -1
  72. package/dist/requester/types.d.ts +24 -2
  73. package/dist/requester/types.js +1 -1
  74. package/dist/requester/types.js.map +1 -1
  75. package/dist/requester/urlProvider.d.ts +17 -0
  76. package/dist/requester/urlProvider.js +2 -0
  77. package/dist/requester/urlProvider.js.map +1 -0
  78. package/dist/storage/storage.js +1 -1
  79. package/dist/targeting/conditions/browser.js +1 -1
  80. package/dist/targeting/conditions/browser.js.map +1 -1
  81. package/dist/targeting/conditions/conditionFactory.js +1 -1
  82. package/dist/targeting/conditions/conditionFactory.js.map +1 -1
  83. package/dist/targeting/conditions/conversionLikelihood.d.ts +12 -0
  84. package/dist/targeting/conditions/conversionLikelihood.js +2 -0
  85. package/dist/targeting/conditions/conversionLikelihood.js.map +1 -0
  86. package/dist/targeting/conditions/firstVisit.js +1 -1
  87. package/dist/targeting/conditions/firstVisit.js.map +1 -1
  88. package/dist/targeting/conditions/geolocation.js +1 -1
  89. package/dist/targeting/conditions/geolocation.js.map +1 -1
  90. package/dist/targeting/conditions/index.d.ts +1 -0
  91. package/dist/targeting/conditions/index.js +1 -1
  92. package/dist/targeting/conditions/index.js.map +1 -1
  93. package/dist/targeting/conditions/lastVisit.js +1 -1
  94. package/dist/targeting/conditions/lastVisit.js.map +1 -1
  95. package/dist/targeting/conditions/newVisitor.js +1 -1
  96. package/dist/targeting/conditions/newVisitor.js.map +1 -1
  97. package/dist/targeting/conditions/sameDayVisits.js +1 -1
  98. package/dist/targeting/conditions/sameDayVisits.js.map +1 -1
  99. package/dist/targeting/conditions/targetFeatureFlag.js +1 -1
  100. package/dist/targeting/conditions/types.d.ts +3 -0
  101. package/dist/targeting/conditions/types.js.map +1 -1
  102. package/dist/targeting/conditions/visits.js +1 -1
  103. package/dist/targeting/conditions/visits.js.map +1 -1
  104. package/dist/targeting/index.d.ts +2 -2
  105. package/dist/targeting/index.js +1 -1
  106. package/dist/targeting/index.js.map +1 -1
  107. package/dist/targeting/types.d.ts +4 -0
  108. package/dist/targeting/types.js.map +1 -1
  109. package/dist/types.d.ts +2 -0
  110. package/dist/types.js.map +1 -1
  111. package/dist/utilities/types.d.ts +6 -1
  112. package/dist/utilities/types.js.map +1 -1
  113. package/dist/utilities/utilities.d.ts +1 -1
  114. package/dist/utilities/utilities.js +1 -1
  115. package/dist/utilities/utilities.js.map +1 -1
  116. package/dist/variationConfiguration/types.d.ts +1 -1
  117. package/dist/variationConfiguration/types.js.map +1 -1
  118. package/package.json +6 -2
@@ -1 +1 @@
1
- {"version":3,"file":"pageView.js","names":["PageView","constructor","a","urlAddress","title","referrers","_defineProperty","sent","url","titleParameter","UrlParameter","Title","encodeURIComponent","referrersParameter","length","ReferrersIndices","JSON","stringify","UrlEventType","Page","Href","data","type","KameleoonData","timestamps","timestampList","isSent","value","uniqueValues","Set","forEach","timestamp","Utilities","insertInOrderedListMutably","list","element","order","Order","Ascending","_listFromVisits","visits","resultData","pageViewMap","Map","i","visit","pageEvents","pageEvent","time","href","referrersIndices","pageView","has","existingTimestamps","get","set","push","exports"],"sources":["../../src/kameleoonData/pageView.ts"],"sourcesContent":["import { UrlEventType, UrlParameter, VisitType } from 'src/requester';\nimport { Utilities } from 'src/utilities';\nimport { Order } from 'src/utilities/types';\nimport {\n IKameleoonData,\n KameleoonData,\n PageViewDataType,\n PageViewParametersType,\n} from './types';\n\n/**\n * @class\n * PageView - a class for creating an instance of a page view data\n * */\nexport class PageView implements IKameleoonData {\n private urlAddress: string;\n private title: string;\n private referrers?: number[];\n private sent: boolean;\n // --- Note ---\n // Ascending order\n private timestampList: number[] = [];\n\n /**\n * @param {PageViewParametersType} pageViewParameters - an object with page view parameters\n * */\n constructor({ urlAddress, title, referrers }: PageViewParametersType) {\n this.urlAddress = urlAddress;\n this.title = title;\n this.referrers = referrers;\n this.sent = false;\n }\n\n /**\n * @property url - url for the current data type used for events tracking\n * */\n get url(): string {\n // --- Note ---\n // If SDK is used in vanilla JS codebase, then you're also able to create an instance\n // with no required data, we don't want send anything to tracking in that case\n if (!this.urlAddress) {\n return '';\n }\n\n const titleParameter = this.title\n ? UrlParameter.Title + encodeURIComponent(this.title)\n : '';\n\n const referrersParameter = this.referrers?.length\n ? UrlParameter.ReferrersIndices + JSON.stringify(this.referrers)\n : '';\n\n return (\n UrlEventType.Page +\n UrlParameter.Href +\n encodeURIComponent(this.urlAddress) +\n titleParameter +\n referrersParameter\n );\n }\n\n /**\n * @property data - data of the current class instance\n * */\n get data(): PageViewDataType {\n return {\n urlAddress: this.urlAddress,\n title: this.title,\n referrers: this.referrers,\n type: KameleoonData.PageView,\n sent: this.sent,\n timestamps: this.timestampList,\n };\n }\n\n /**\n * @property isSent - signifying if the data was sent already tracked\n * */\n get isSent(): boolean {\n return this.sent;\n }\n\n set isSent(value: boolean) {\n this.sent = value;\n }\n\n /**\n * @property timestamps - a list of timestamps for the current data type\n * */\n get timestamps(): number[] {\n return this.timestampList;\n }\n\n set timestamps(value: number[]) {\n const uniqueValues = new Set<number>(value);\n\n if (this.timestampList.length) {\n // --- Note ---\n // We want to keep the list in ascending order\n uniqueValues.forEach((timestamp) => {\n Utilities.insertInOrderedListMutably({\n list: this.timestampList,\n element: timestamp,\n order: Order.Ascending,\n });\n });\n } else {\n this.timestampList = [...uniqueValues];\n }\n }\n\n /**\n * @private\n * @method _listFromVisits - an internal method for creating a list of page view data from a list of visits\n * @param {VisitType[]} visits - a list of visits\n * @returns {PageView[]} a list of PageView instances\n * */\n public static _listFromVisits(visits: VisitType[]): PageView[] {\n const resultData: PageView[] = [];\n const pageViewMap = new Map<string, PageView>();\n\n // --- Note ---\n // Going backwards to get the latest visit data\n for (let i = visits.length - 1; i >= 0; i--) {\n const visit = visits[i];\n\n if (!visit.pageEvents) {\n continue;\n }\n\n const pageEvents = visit.pageEvents;\n\n for (const pageEvent of pageEvents) {\n let referrers: number[] = [];\n\n const { time } = pageEvent;\n const { href, title, referrersIndices } = pageEvent.data;\n\n if (typeof referrersIndices[0] === 'number') {\n referrers = referrersIndices as number[];\n }\n\n let pageView: PageView;\n\n if (pageViewMap.has(href)) {\n const existingTimestamps = pageViewMap.get(href)!.timestamps;\n\n pageView = new PageView({\n urlAddress: href,\n title,\n referrers,\n });\n\n pageView.timestamps = [...existingTimestamps, time];\n } else {\n pageView = new PageView({\n urlAddress: href,\n title,\n referrers,\n });\n\n pageView.timestamps = [time];\n }\n\n pageViewMap.set(href, pageView);\n }\n }\n\n pageViewMap.forEach((value) => {\n // --- Note ---\n // We don't want to track collected pages again\n value.isSent = true;\n resultData.push(value);\n });\n\n return resultData;\n }\n}\n"],"mappings":"yuBAcO,KAAM,CAAAA,QAAmC,CAY9CC,WAAWA,CAAAC,CAAA,CAA2D,IAA1D,CAAEC,UAAU,CAAVA,CAAU,CAAEC,KAAK,CAALA,CAAK,CAAEC,SAAS,CAATA,CAAkC,CAAC,CAAAH,CAAA,CAAAI,eAAA,2BAAAA,eAAA,sBAAAA,eAAA,0BAAAA,eAAA,qBAAAA,eAAA,sBALlC,EAAE,EAMlC,IAAI,CAACH,UAAU,CAAGA,CAAU,CAC5B,IAAI,CAACC,KAAK,CAAGA,CAAK,CAClB,IAAI,CAACC,SAAS,CAAGA,CAAS,CAC1B,IAAI,CAACE,IAAI,GACX,CAKA,GAAI,CAAAC,GAAGA,CAAA,CAAW,KAAAN,CAAA,CAIhB,GAAI,CAAC,IAAI,CAACC,UAAU,CAClB,MAAO,EAAE,CACV,KAEK,CAAAM,CAAc,CAAG,IAAI,CAACL,KAAK,CAC7BM,uBAAY,CAACC,KAAK,CAAGC,kBAAkB,CAAC,IAAI,CAACR,KAAK,CAAC,CACnD,EAAE,CAEAS,CAAkB,CAAG,QAAAX,CAAA,KAAI,CAACG,SAAS,YAAAH,CAAA,EAAdA,CAAA,CAAgBY,MAAM,CAC7CJ,uBAAY,CAACK,gBAAgB,CAAGC,IAAI,CAACC,SAAS,CAAC,IAAI,CAACZ,SAAS,CAAC,CAC9D,EAAE,CAEN,MACE,CAAAa,uBAAY,CAACC,IAAI,CACjBT,uBAAY,CAACU,IAAI,CACjBR,kBA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,CAG7BA,CAAK,CAACD,MAAM,GAAO,CACnBe,CAAU,CAACe,IAAI,CAAC7B,CAAK,CACvB,CAAC,CAAC,CAEKc,CACT,CACF,CAACgB,OAAA,CAAAzD,QAAA,CAAAA,QAAA"}
1
+ {"version":3,"file":"pageView.js","names":["PageView","constructor","a","urlAddress","title","referrers","_defineProperty","sent","url","titleParameter","UrlParameter","Title","encodeURIComponent","referrersParameter","length","ReferrersIndices","JSON","stringify","UrlEventType","Page","Href","data","type","KameleoonData","timestamps","timestampList","isSent","value","uniqueValues","Set","forEach","timestamp","Utilities","insertInOrderedListMutably","list","element","order","Order","Ascending","_updateFromVisit","visit","dataMap","pageEvents","pageEvent","time","href","referrersIndices","pageView","has","existingTimestamps","get","set","exports"],"sources":["../../src/kameleoonData/pageView.ts"],"sourcesContent":["import { UrlEventType, UrlParameter, VisitType } from 'src/requester';\nimport { Utilities } from 'src/utilities';\nimport { Order } from 'src/utilities/types';\nimport {\n IKameleoonData,\n KameleoonData,\n PageViewDataType,\n PageViewParametersType,\n} from './types';\n\n/**\n * @class\n * PageView - a class for creating an instance of a page view data\n * */\nexport class PageView implements IKameleoonData {\n private urlAddress: string;\n private title: string;\n private referrers?: number[];\n private sent: boolean;\n // --- Note ---\n // Ascending order\n private timestampList: number[] = [];\n\n /**\n * @param {PageViewParametersType} pageViewParameters - an object with page view parameters\n * */\n constructor({ urlAddress, title, referrers }: PageViewParametersType) {\n this.urlAddress = urlAddress;\n this.title = title;\n this.referrers = referrers;\n this.sent = false;\n }\n\n get url(): string {\n // --- Note ---\n // If SDK is used in vanilla JS codebase, then you're also able to create an instance\n // with no required data, we don't want send anything to tracking in that case\n if (!this.urlAddress) {\n return '';\n }\n\n const titleParameter = this.title\n ? UrlParameter.Title + encodeURIComponent(this.title)\n : '';\n\n const referrersParameter = this.referrers?.length\n ? UrlParameter.ReferrersIndices + JSON.stringify(this.referrers)\n : '';\n\n return (\n UrlEventType.Page +\n UrlParameter.Href +\n encodeURIComponent(this.urlAddress) +\n titleParameter +\n referrersParameter\n );\n }\n\n get data(): PageViewDataType {\n return {\n urlAddress: this.urlAddress,\n title: this.title,\n referrers: this.referrers,\n type: KameleoonData.PageView,\n sent: this.sent,\n timestamps: this.timestampList,\n };\n }\n\n get isSent(): boolean {\n return this.sent;\n }\n\n set isSent(value: boolean) {\n this.sent = value;\n }\n\n /**\n * @property timestamps - a list of timestamps for the current data type\n * */\n get timestamps(): number[] {\n return this.timestampList;\n }\n\n set timestamps(value: number[]) {\n const uniqueValues = new Set<number>(value);\n\n if (this.timestampList.length) {\n // --- Note ---\n // We want to keep the list in ascending order\n uniqueValues.forEach((timestamp) => {\n Utilities.insertInOrderedListMutably({\n list: this.timestampList,\n element: timestamp,\n order: Order.Ascending,\n });\n });\n } else {\n this.timestampList = [...uniqueValues];\n }\n }\n\n /**\n * @private\n * @method _updateFromVisit - an internal method for updating a list of page view data from a visit\n * @param {VisitType} visit - a visit\n * @param {Map<string, PageView>} dataMap - a map of page view data where we collect data\n * */\n public static _updateFromVisit(\n visit: VisitType,\n dataMap: Map<string, PageView>,\n ): void {\n const pageEvents = visit.pageEvents;\n\n if (pageEvents) {\n for (const pageEvent of pageEvents) {\n let referrers: number[] = [];\n\n const { time } = pageEvent;\n const { href, title, referrersIndices } = pageEvent.data;\n\n if (typeof referrersIndices[0] === 'number') {\n referrers = referrersIndices as number[];\n }\n\n let pageView: PageView;\n\n if (dataMap.has(href)) {\n const existingTimestamps = dataMap.get(href)!.timestamps;\n\n pageView = new PageView({\n urlAddress: href,\n title,\n referrers,\n });\n\n pageView.timestamps = [...existingTimestamps, time];\n } else {\n pageView = new PageView({\n urlAddress: href,\n title,\n referrers,\n });\n\n pageView.timestamps = [time];\n }\n\n // --- Note ---\n // We don't want to track collected pages again\n pageView.isSent = true;\n dataMap.set(href, pageView);\n }\n }\n }\n}\n"],"mappings":"yuBAcO,KAAM,CAAAA,QAAmC,CAY9CC,WAAWA,CAAAC,CAAA,CAA2D,IAA1D,CAAEC,UAA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CAAC,CAAErB,UAAU,CAExDuB,CAAQ,CAAG,GAAI,CAAA/C,QAAQ,CAAC,CACtBG,UAAU,CAAE0C,CAAI,CAChBzC,KAAK,CAALA,CAAK,CACLC,SAAS,CAATA,CACF,CAAC,CAAC,CAEF0C,CAAQ,CAACvB,UAAU,CAAG,CAAC,GAAGyB,CAAkB,CAAEL,CAAI,CACpD,CAAC,IACC,CAAAG,CAAQ,CAAG,GAAI,CAAA/C,QAAQ,CAAC,CACtBG,UAAU,CAAE0C,CAAI,CAChBzC,KAAK,CAALA,CAAK,CACLC,SAAS,CAATA,CACF,CAAC,CAAC,CAEF0C,CAAQ,CAACvB,UAAU,CAAG,CAACoB,CAAI,CAAC,CAK9BG,CAAQ,CAACrB,MAAM,GAAO,CACtBe,CAAO,CAACU,GAAG,CAACN,CAAI,CAAEE,CAAQ,CAC5B,CAEJ,CACF,CAACK,OAAA,CAAApD,QAAA,CAAAA,QAAA"}
@@ -1,6 +1,6 @@
1
- import { TargetingDataType } from '../targeting';
2
- import { IStorage } from '../storage';
3
- import { Browser, Conversion, Cookie, CustomData, Device, GeolocationData, OperatingSystem, PageView, UserAgent, ApplicationVersion, VisitsData } from '../kameleoonData';
1
+ import { DereferencedTargetingDataType, TargetingDataType } from '../targeting';
2
+ import { FeatureFlagVariationsType, IStorage } from '../storage';
3
+ import { Browser, Conversion, Cookie, CustomData, Device, GeolocationData, OperatingSystem, PageView, UserAgent, ApplicationVersion, VisitsData, KameleoonConversionScore } from '../kameleoonData';
4
4
  export type UnsentVisitorTargetingDataType = Map<KameleoonData | number, KameleoonDataType | KameleoonDataType[]>;
5
5
  export type UnsentTargetingDataType = {
6
6
  [visitorCode: string]: UnsentVisitorTargetingDataType | undefined;
@@ -9,41 +9,54 @@ export type FieldParametersType = {
9
9
  visitorCode: string;
10
10
  key: KameleoonData;
11
11
  value: BrowserDataType | CookieDataType | DeviceDataType | GeolocationDataType | OperatingSystemDataType | UserAgentDataType | VisitsDataType;
12
- data: TargetingDataType;
12
+ data: DereferencedTargetingDataType;
13
13
  };
14
14
  export type ArrayFieldParametersType = {
15
15
  visitorCode: string;
16
16
  key: KameleoonData;
17
17
  value: ConversionDataType;
18
- data: TargetingDataType;
18
+ data: DereferencedTargetingDataType;
19
19
  };
20
20
  export type NestedFieldParametersType = {
21
21
  visitorCode: string;
22
22
  key: KameleoonData.CustomData | KameleoonData.PageView;
23
23
  nestedKey: string;
24
24
  value: CustomDataType | PageViewDataType;
25
- data: TargetingDataType;
25
+ data: DereferencedTargetingDataType;
26
+ };
27
+ export type DereferenceTargetingDataResultType = {
28
+ data: KameleoonVisitorDataType;
29
+ visitorReference: string;
26
30
  };
27
31
  export type DataManagerParametersType = {
28
32
  targetingCleanupInterval?: number;
29
33
  storage: IStorage<TargetingDataType>;
30
34
  };
31
- export type KameleoonDataItemType = BrowserDataType | ConversionDataType | CustomDataType | DeviceDataType | PageViewDataType | UserAgentDataType | CookieDataType | GeolocationDataType | OperatingSystemDataType | ApplicationVersionDataType | VisitsDataType;
35
+ export type KameleoonDataItemType = BrowserDataType | ConversionDataType | CustomDataType | DeviceDataType | PageViewDataType | UserAgentDataType | CookieDataType | GeolocationDataType | OperatingSystemDataType | ApplicationVersionDataType | KCSDataType | VisitsDataType;
32
36
  /**
33
37
  * @interface an interface of KameleoonData
34
38
  * each class instance will have url getter method
35
39
  * for handling url of different data types
36
40
  * */
37
41
  export interface IKameleoonData {
42
+ /**
43
+ * @property url - url for the current data type used for events tracking
44
+ * */
38
45
  readonly url: string;
46
+ /**
47
+ * @property data - data of the current class instance
48
+ * */
39
49
  readonly data: KameleoonDataItemType;
50
+ /**
51
+ * @property isSent - signifying if the data was sent already tracked
52
+ * */
40
53
  isSent: boolean;
41
54
  }
42
55
  /**
43
56
  * @type a tuple of each possible type of data for `addData` method
44
57
  * of KameleoonClient
45
58
  * */
46
- export type KameleoonDataType = Browser | Conversion | CustomData | Device | PageView | UserAgent | VisitsData | GeolocationData | OperatingSystem | Cookie | ApplicationVersion;
59
+ export type KameleoonDataType = Browser | Conversion | CustomData | Device | PageView | UserAgent | VisitsData | GeolocationData | OperatingSystem | Cookie | ApplicationVersion | KameleoonConversionScore;
47
60
  export type ActivityTimePropertyType = {
48
61
  lastActivityTime: number;
49
62
  };
@@ -67,6 +80,7 @@ export type KameleoonVisitorDataType<T = ActivityTimePropertyType> = {
67
80
  [KameleoonData.Browser]?: BrowserDataType & T;
68
81
  [KameleoonData.Device]?: DeviceDataType & T;
69
82
  [KameleoonData.Cookie]?: CookieDataType & T;
83
+ [KameleoonData.KameleoonConversionScore]?: KCSDataType & T;
70
84
  [KameleoonData.OperatingSystem]?: OperatingSystemDataType & T;
71
85
  [KameleoonData.ApplicationVersion]?: ApplicationVersionDataType & T;
72
86
  [KameleoonData.VisitsData]?: VisitsDataType & T;
@@ -82,7 +96,8 @@ export declare enum KameleoonData {
82
96
  OperatingSystem = "operatingSystem",
83
97
  UserAgent = "userAgent",
84
98
  ApplicationVersion = "applicationVersion",
85
- VisitsData = "visitsData"
99
+ VisitsData = "visitsData",
100
+ KameleoonConversionScore = "kameleoonConversionScore"
86
101
  }
87
102
  type SharedDataPropertiesType = {
88
103
  type: KameleoonData;
@@ -105,9 +120,11 @@ export type CustomDataType = {
105
120
  export type DeviceDataType = {
106
121
  device: DeviceType;
107
122
  } & SharedDataPropertiesType;
123
+ export type KCSDataType = {
124
+ kcs: KCSType;
125
+ } & SharedDataPropertiesType;
108
126
  export type VisitsDataType = {
109
- previousVisits: number[];
110
- currentVisit: number | null;
127
+ visits: number[];
111
128
  } & SharedDataPropertiesType;
112
129
  export type OperatingSystemDataType = {
113
130
  operatingSystem: OperatingSystemType;
@@ -191,6 +208,14 @@ export type CookieType = {
191
208
  key: string;
192
209
  value: string;
193
210
  };
211
+ /**
212
+ * @type Nested object of key moments and goals with their respective scores
213
+ * */
214
+ export type KCSType = {
215
+ [keyMoment: string]: {
216
+ [goalId: string]: number;
217
+ };
218
+ };
194
219
  export type OptionalCookieType = Omit<CookieType, 'key'> & {
195
220
  key?: string;
196
221
  };
@@ -224,4 +249,22 @@ export declare const BrowserIndexMap: {
224
249
  readonly OTHER: 5;
225
250
  };
226
251
  export declare const BrowserTypeMap: Record<number, BrowserType>;
252
+ export type SingleDataType = {
253
+ [KameleoonData.Device]: Device | null;
254
+ [KameleoonData.Browser]: Browser | null;
255
+ [KameleoonData.GeolocationData]: GeolocationData | null;
256
+ [KameleoonData.OperatingSystem]: OperatingSystem | null;
257
+ [KameleoonData.KameleoonConversionScore]: KameleoonConversionScore | null;
258
+ };
259
+ export type MultipleDataType = {
260
+ [KameleoonData.CustomData]: Map<number, CustomData>;
261
+ [KameleoonData.PageView]: Map<string, PageView>;
262
+ [KameleoonData.Conversion]: Map<number, Conversion>;
263
+ };
264
+ export type VisitProcessorDataType = {
265
+ visitorData: KameleoonDataType[];
266
+ storageVisitorData: KameleoonDataType[];
267
+ visitsData: VisitsData;
268
+ experimentData: FeatureFlagVariationsType;
269
+ };
227
270
  export {};
@@ -1,2 +1,2 @@
1
- "use strict";var _helpers=require("./helpers");Object.defineProperty(exports,"__esModule",{value:!0}),exports.OperatingSystemTypeMap=exports.OperatingSystemType=exports.OperatingSystemIndexMap=exports.KameleoonData=exports.DeviceType=exports.BrowserTypeMap=exports.BrowserType=exports.BrowserIndexMap=void 0;let KameleoonData=exports.KameleoonData=function(a){return a.CustomData="customData",a.PageView="pageView",a.GeolocationData="geolocation",a.Browser="browser",a.Conversion="conversion",a.Cookie="cookie",a.Device="device",a.OperatingSystem="operatingSystem",a.UserAgent="userAgent",a.ApplicationVersion="applicationVersion",a.VisitsData="visitsData",a}({}),DeviceType=exports.DeviceType=function(a){return a.Phone="PHONE",a.Tablet="TABLET",a.Desktop="DESKTOP",a}({}),OperatingSystemType=exports.OperatingSystemType=function(a){return a.WindowsPhone="WINDOWS_PHONE",a.Windows="WINDOWS",a.Android="ANDROID",a.Linux="LINUX",a.Mac="MAC",a.IOS="IOS",a}({}),BrowserType=exports.BrowserType=function(a){return a.Chrome="CHROME",a.InternetExplorer="IE",a.Firefox="FIREFOX",a.Safari="SAFARI",a.Opera="OPERA",a.Other="OTHER",a}({});const OperatingSystemIndexMap=exports.OperatingSystemIndexMap={[OperatingSystemType.Windows]:0,[OperatingSystemType.Mac]:1,[OperatingSystemType.IOS]:2,[OperatingSystemType.Linux]:3,[OperatingSystemType.Android]:4,[OperatingSystemType.WindowsPhone]:5},OperatingSystemTypeMap=exports.OperatingSystemTypeMap=(0,_helpers.constructTypeMap)(OperatingSystemIndexMap),BrowserIndexMap=exports.BrowserIndexMap={[BrowserType.Chrome]:0,[BrowserType.InternetExplorer]:1,[BrowserType.Firefox]:2,[BrowserType.Safari]:3,[BrowserType.Opera]:4,[BrowserType.Other]:5},BrowserTypeMap=exports.BrowserTypeMap=(0,_helpers.constructTypeMap)(BrowserIndexMap);
1
+ "use strict";var _helpers=require("./helpers");Object.defineProperty(exports,"__esModule",{value:!0}),exports.OperatingSystemTypeMap=exports.OperatingSystemType=exports.OperatingSystemIndexMap=exports.KameleoonData=exports.DeviceType=exports.BrowserTypeMap=exports.BrowserType=exports.BrowserIndexMap=void 0;let KameleoonData=exports.KameleoonData=function(a){return a.CustomData="customData",a.PageView="pageView",a.GeolocationData="geolocation",a.Browser="browser",a.Conversion="conversion",a.Cookie="cookie",a.Device="device",a.OperatingSystem="operatingSystem",a.UserAgent="userAgent",a.ApplicationVersion="applicationVersion",a.VisitsData="visitsData",a.KameleoonConversionScore="kameleoonConversionScore",a}({}),DeviceType=exports.DeviceType=function(a){return a.Phone="PHONE",a.Tablet="TABLET",a.Desktop="DESKTOP",a}({}),OperatingSystemType=exports.OperatingSystemType=function(a){return a.WindowsPhone="WINDOWS_PHONE",a.Windows="WINDOWS",a.Android="ANDROID",a.Linux="LINUX",a.Mac="MAC",a.IOS="IOS",a}({}),BrowserType=exports.BrowserType=function(a){return a.Chrome="CHROME",a.InternetExplorer="IE",a.Firefox="FIREFOX",a.Safari="SAFARI",a.Opera="OPERA",a.Other="OTHER",a}({});const OperatingSystemIndexMap=exports.OperatingSystemIndexMap={[OperatingSystemType.Windows]:0,[OperatingSystemType.Mac]:1,[OperatingSystemType.IOS]:2,[OperatingSystemType.Linux]:3,[OperatingSystemType.Android]:4,[OperatingSystemType.WindowsPhone]:5},OperatingSystemTypeMap=exports.OperatingSystemTypeMap=(0,_helpers.constructTypeMap)(OperatingSystemIndexMap),BrowserIndexMap=exports.BrowserIndexMap={[BrowserType.Chrome]:0,[BrowserType.InternetExplorer]:1,[BrowserType.Firefox]:2,[BrowserType.Safari]:3,[BrowserType.Opera]:4,[BrowserType.Other]:5},BrowserTypeMap=exports.BrowserTypeMap=(0,_helpers.constructTypeMap)(BrowserIndexMap);
2
2
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["_helpers","require","Object","defineProperty","exports","value","OperatingSystemTypeMap","OperatingSystemType","OperatingSystemIndexMap","KameleoonData","DeviceType","BrowserTypeMap","BrowserType","BrowserIndexMap","CustomData","PageView","GeolocationData","Browser","Conversion","Cookie","Device","OperatingSystem","UserAgent","ApplicationVersion","VisitsData","Phone","Tablet","Desktop","WindowsPhone","Windows","Android","Linux","Mac","IOS","Chrome","InternetExplorer","Firefox","Safari","Opera","Other","constructTypeMap"],"sources":["../../src/kameleoonData/types.ts"],"sourcesContent":["import { TargetingDataType } from 'src/targeting';\nimport { IStorage } from 'src/storage';\nimport {\n Browser,\n Conversion,\n Cookie,\n CustomData,\n Device,\n GeolocationData,\n OperatingSystem,\n PageView,\n UserAgent,\n ApplicationVersion,\n VisitsData,\n} from 'src/kameleoonData';\nimport { constructTypeMap } from './helpers';\n\n// --- Note ---\n// -- `Conversion`s are stored by `KameleoonData.Conversion` key in a form of an `KameleoonDataType[]` array\n// -- `PageView`s are store by `timestamp` (number) key in a form of `KameleoonDataType`\n// -- All the other unsent data types are stored in a form of `KameleoonData` key and `KameleoonDataType` value\nexport type UnsentVisitorTargetingDataType = Map<\n KameleoonData | number,\n KameleoonDataType | KameleoonDataType[]\n>;\n\nexport type UnsentTargetingDataType = {\n [visitorCode: string]: UnsentVisitorTargetingDataType | undefined;\n};\n\nexport type FieldParametersType = {\n visitorCode: string;\n key: KameleoonData;\n value:\n | BrowserDataType\n | CookieDataType\n | DeviceDataType\n | GeolocationDataType\n | OperatingSystemDataType\n | UserAgentDataType\n | VisitsDataType;\n data: TargetingDataType;\n};\n\nexport type ArrayFieldParametersType = {\n visitorCode: string;\n key: KameleoonData;\n value: ConversionDataType;\n data: TargetingDataType;\n};\nexport type NestedFieldParametersType = {\n visitorCode: string;\n key: KameleoonData.CustomData | KameleoonData.PageView;\n nestedKey: string;\n value: CustomDataType | PageViewDataType;\n data: TargetingDataType;\n};\n\nexport type DataManagerParametersType = {\n targetingCleanupInterval?: number;\n storage: IStorage<TargetingDataType>;\n};\n\nexport type KameleoonDataItemType =\n | BrowserDataType\n | ConversionDataType\n | CustomDataType\n | DeviceDataType\n | PageViewDataType\n | UserAgentDataType\n | CookieDataType\n | GeolocationDataType\n | OperatingSystemDataType\n | ApplicationVersionDataType\n | VisitsDataType;\n\n/**\n * @interface an interface of KameleoonData\n * each class instance will have url getter method\n * for handling url of different data types\n * */\nexport interface IKameleoonData {\n readonly url: string;\n readonly data: KameleoonDataItemType;\n isSent: boolean;\n}\n\n/**\n * @type a tuple of each possible type of data for `addData` method\n * of KameleoonClient\n * */\nexport type KameleoonDataType =\n | Browser\n | Conversion\n | CustomData\n | Device\n | PageView\n | UserAgent\n | VisitsData\n | GeolocationData\n | OperatingSystem\n | Cookie\n | ApplicationVersion;\n\nexport type ActivityTimePropertyType = {\n lastActivityTime: number;\n};\n\nexport type ExistingCustomDataType = NonNullable<\n KameleoonVisitorDataType[KameleoonData.CustomData]\n>;\n\nexport type ExistingPageViewDataType = NonNullable<\n KameleoonVisitorDataType[KameleoonData.PageView]\n>;\n\nexport type ExistingNestedDataType =\n | ExistingCustomDataType\n | ExistingPageViewDataType;\n\nexport type ExistingArrayDataType = ExistingConversionDataType;\n\nexport type ExistingConversionDataType = NonNullable<\n KameleoonVisitorDataType[KameleoonData.Conversion]\n>;\n\nexport type ExistingVisitsDataType = NonNullable<\n KameleoonVisitorDataType[KameleoonData.VisitsData]\n>;\n\nexport type ExistingDataType<T extends KameleoonData> = NonNullable<\n KameleoonVisitorDataType[T]\n>;\n\nexport type KameleoonVisitorDataType<T = ActivityTimePropertyType> = {\n [KameleoonData.CustomData]?: {\n [index: string]: (CustomDataType & T) | undefined;\n };\n [KameleoonData.Conversion]?: (ConversionDataType & T)[];\n [KameleoonData.GeolocationData]?: GeolocationDataType & T;\n [KameleoonData.UserAgent]?: UserAgentDataType & T;\n [KameleoonData.PageView]?: { [url: string]: PageViewDataType & T };\n [KameleoonData.Browser]?: BrowserDataType & T;\n [KameleoonData.Device]?: DeviceDataType & T;\n [KameleoonData.Cookie]?: CookieDataType & T;\n [KameleoonData.OperatingSystem]?: OperatingSystemDataType & T;\n [KameleoonData.ApplicationVersion]?: ApplicationVersionDataType & T;\n [KameleoonData.VisitsData]?: VisitsDataType & T;\n};\n\nexport enum KameleoonData {\n CustomData = 'customData',\n PageView = 'pageView',\n GeolocationData = 'geolocation',\n Browser = 'browser',\n Conversion = 'conversion',\n Cookie = 'cookie',\n Device = 'device',\n OperatingSystem = 'operatingSystem',\n UserAgent = 'userAgent',\n ApplicationVersion = 'applicationVersion',\n VisitsData = 'visitsData',\n}\n\ntype SharedDataPropertiesType = {\n type: KameleoonData;\n sent: boolean;\n};\n\nexport type BrowserDataType = {\n browser: BrowserType;\n version?: number;\n} & SharedDataPropertiesType;\n\nexport type ConversionDataType = {\n goalId: number;\n revenue: number;\n negative: boolean;\n} & SharedDataPropertiesType;\n\nexport type CustomDataType = {\n index: number;\n value: string[];\n isIdentifier: boolean;\n} & SharedDataPropertiesType;\n\nexport type DeviceDataType = {\n device: DeviceType;\n} & SharedDataPropertiesType;\n\nexport type VisitsDataType = {\n previousVisits: number[];\n currentVisit: number | null;\n} & SharedDataPropertiesType;\n\nexport type OperatingSystemDataType = {\n operatingSystem: OperatingSystemType;\n} & SharedDataPropertiesType;\n\nexport type CookieDataType = {\n cookie: CookieType[];\n} & SharedDataPropertiesType;\n\nexport type GeolocationDataType = GeolocationInfoType &\n SharedDataPropertiesType;\n\nexport type PageViewDataType = {\n urlAddress: string;\n title: string;\n referrers?: number[];\n timestamps: number[];\n} & SharedDataPropertiesType;\n\nexport type UserAgentDataType = {\n value: string;\n} & SharedDataPropertiesType;\n\nexport type ApplicationVersionDataType = {\n version: string;\n} & SharedDataPropertiesType;\n\n/**\n * @param {number} goalId - an id of a goal to track\n * @param {number | undefined} revenue - an optional parameter for revenue, default value is `0`\n * @param {boolean | undefined} negative - an optional parameter identifying whether the conversion should be removed, default value is `false`\n * */\nexport type ConversionParametersType = {\n goalId: number;\n revenue?: number;\n negative?: boolean;\n};\n\n/**\n * @param {string} urlAddress - url address of the page to track\n * @param {string} title - title of the web page\n * @param {number[] | undefined} referrers - an optional parameter containing a list of referrersIndices, has no default value\n * */\nexport type PageViewParametersType = {\n urlAddress: string;\n title: string;\n referrers?: number[];\n};\n\n/**\n * @readonly\n * @enum {string} an Enum containing all possible variants for device type\n * */\nexport enum DeviceType {\n Phone = 'PHONE',\n Tablet = 'TABLET',\n Desktop = 'DESKTOP',\n}\n\n/**\n * @readonly\n * @enum {string} an Enum containing all possible variants for operating system type\n * */\nexport enum OperatingSystemType {\n WindowsPhone = 'WINDOWS_PHONE',\n Windows = 'WINDOWS',\n Android = 'ANDROID',\n Linux = 'LINUX',\n Mac = 'MAC',\n IOS = 'IOS',\n}\n\n/**\n * @param {string} country - a country of a visitor\n * @param {string | undefined} region - an optional parameter containing a region of a visitor, has no default value\n * @param {string | undefined} city - an optional parameter containing a city of a visitor, has no default value\n * @param {string | undefined} postalCode - an optional parameter containing a postal code of a visitor, has no default value\n * @param {[number, number] | undefined} coordinates - an optional parameter containing a pair of coordinates (longitude and latitude) of a visitor, has no default value. Coordinate `number` represents decimal degrees (double that can be negative)\n * */\nexport type GeolocationInfoType = {\n country: string;\n region?: string;\n city?: string;\n postalCode?: string;\n coordinates?: [number, number];\n};\n\n/**\n * @param {string} key - a key of a cookie\n * @param {string} value - a value of a cookie\n * */\nexport type CookieType = {\n key: string;\n value: string;\n};\n\nexport type OptionalCookieType = Omit<CookieType, 'key'> & {\n key?: string;\n};\n\n/**\n * @readonly\n * @enum {string} an Enum containing all possible variants for browser type\n * */\nexport enum BrowserType {\n Chrome = 'CHROME',\n InternetExplorer = 'IE',\n Firefox = 'FIREFOX',\n Safari = 'SAFARI',\n Opera = 'OPERA',\n Other = 'OTHER',\n}\n\nexport const OperatingSystemIndexMap = {\n [OperatingSystemType.Windows]: 0,\n [OperatingSystemType.Mac]: 1,\n [OperatingSystemType.IOS]: 2,\n [OperatingSystemType.Linux]: 3,\n [OperatingSystemType.Android]: 4,\n [OperatingSystemType.WindowsPhone]: 5,\n} as const;\n\nexport const OperatingSystemTypeMap = constructTypeMap<OperatingSystemType>(\n OperatingSystemIndexMap,\n);\n\nexport const BrowserIndexMap = {\n [BrowserType.Chrome]: 0,\n [BrowserType.InternetExplorer]: 1,\n [BrowserType.Firefox]: 2,\n [BrowserType.Safari]: 3,\n [BrowserType.Opera]: 4,\n [BrowserType.Other]: 5,\n} as const;\n\nexport const BrowserTypeMap = constructTypeMap<BrowserType>(BrowserIndexMap);\n"],"mappings":"aAeA,IAAAA,QAAA,CAAAC,OAAA,cAA6CC,MAAA,CAAAC,cAAA,CAAAC,OAAA,eAAAC,KAAA,MAAAD,OAAA,CAAAE,sBAAA,CAAAF,OAAA,CAAAG,mBAAA,CAAAH,OAAA,CAAAI,uBAAA,CAAAJ,OAAA,CAAAK,aAAA,CAAAL,OAAA,CAAAM,UAAA,CAAAN,OAAA,CAAAO,cAAA,CAAAP,OAAA,CAAAQ,WAAA,CAAAR,OAAA,CAAAS,eAAA,WAuIjC,CAAAJ,aAAa,CAAAL,OAAA,CAAAK,aAAA,UAAbA,CAAa,QAAb,CAAAA,CAAa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AACxB,mBAAmB,CAACuB,OAAO,EAAG,CAAC,CAChC,CAACvB,mBAAmB,CAACqB,YAAY,EAAG,CACtC,CAAU,CAEGtB,sBAAsB,CAAAF,OAAA,CAAAE,sBAAA,CAAG,GAAAkC,yBAAgB,EACpDhC,uBACF,CAAC,CAEYK,eAAe,CAAAT,OAAA,CAAAS,eAAA,CAAG,CAC7B,CAACD,WAAW,CAACsB,MAAM,EAAG,CAAC,CACvB,CAACtB,WAAW,CAACuB,gBAAgB,EAAG,CAAC,CACjC,CAACvB,WAAW,CAACwB,OAAO,EAAG,CAAC,CACxB,CAACxB,WAAW,CAACyB,MAAM,EAAG,CAAC,CACvB,CAACzB,WAAW,CAAC0B,KAAK,EAAG,CAAC,CACtB,CAAC1B,WAAW,CAAC2B,KAAK,EAAG,CACvB,CAAU,CAEG5B,cAAc,CAAAP,OAAA,CAAAO,cAAA,CAAG,GAAA6B,yBAAgB,EAAc3B,eAAe,CAAC"}
1
+ {"version":3,"file":"types.js","names":["_helpers","require","Object","defineProperty","exports","value","OperatingSystemTypeMap","OperatingSystemType","OperatingSystemIndexMap","KameleoonData","DeviceType","BrowserTypeMap","BrowserType","BrowserIndexMap","CustomData","PageView","GeolocationData","Browser","Conversion","Cookie","Device","OperatingSystem","UserAgent","ApplicationVersion","VisitsData","KameleoonConversionScore","Phone","Tablet","Desktop","WindowsPhone","Windows","Android","Linux","Mac","IOS","Chrome","InternetExplorer","Firefox","Safari","Opera","Other","constructTypeMap"],"sources":["../../src/kameleoonData/types.ts"],"sourcesContent":["import {\n DereferencedTargetingDataType,\n TargetingDataType,\n} from 'src/targeting';\nimport { FeatureFlagVariationsType, IStorage } from 'src/storage';\nimport {\n Browser,\n Conversion,\n Cookie,\n CustomData,\n Device,\n GeolocationData,\n OperatingSystem,\n PageView,\n UserAgent,\n ApplicationVersion,\n VisitsData,\n KameleoonConversionScore,\n} from 'src/kameleoonData';\nimport { constructTypeMap } from './helpers';\n\n// --- Note ---\n// -- `Conversion`s are stored by `KameleoonData.Conversion` key in a form of an `KameleoonDataType[]` array\n// -- `PageView`s are store by `timestamp` (number) key in a form of `KameleoonDataType`\n// -- All the other unsent data types are stored in a form of `KameleoonData` key and `KameleoonDataType` value\nexport type UnsentVisitorTargetingDataType = Map<\n KameleoonData | number,\n KameleoonDataType | KameleoonDataType[]\n>;\n\nexport type UnsentTargetingDataType = {\n [visitorCode: string]: UnsentVisitorTargetingDataType | undefined;\n};\n\nexport type FieldParametersType = {\n visitorCode: string;\n key: KameleoonData;\n value:\n | BrowserDataType\n | CookieDataType\n | DeviceDataType\n | GeolocationDataType\n | OperatingSystemDataType\n | UserAgentDataType\n | VisitsDataType;\n data: DereferencedTargetingDataType;\n};\n\nexport type ArrayFieldParametersType = {\n visitorCode: string;\n key: KameleoonData;\n value: ConversionDataType;\n data: DereferencedTargetingDataType;\n};\n\nexport type NestedFieldParametersType = {\n visitorCode: string;\n key: KameleoonData.CustomData | KameleoonData.PageView;\n nestedKey: string;\n value: CustomDataType | PageViewDataType;\n data: DereferencedTargetingDataType;\n};\n\nexport type DereferenceTargetingDataResultType = {\n data: KameleoonVisitorDataType;\n visitorReference: string;\n};\n\nexport type DataManagerParametersType = {\n targetingCleanupInterval?: number;\n storage: IStorage<TargetingDataType>;\n};\n\nexport type KameleoonDataItemType =\n | BrowserDataType\n | ConversionDataType\n | CustomDataType\n | DeviceDataType\n | PageViewDataType\n | UserAgentDataType\n | CookieDataType\n | GeolocationDataType\n | OperatingSystemDataType\n | ApplicationVersionDataType\n | KCSDataType\n | VisitsDataType;\n\n/**\n * @interface an interface of KameleoonData\n * each class instance will have url getter method\n * for handling url of different data types\n * */\nexport interface IKameleoonData {\n /**\n * @property url - url for the current data type used for events tracking\n * */\n readonly url: string;\n /**\n * @property data - data of the current class instance\n * */\n readonly data: KameleoonDataItemType;\n /**\n * @property isSent - signifying if the data was sent already tracked\n * */\n isSent: boolean;\n}\n\n/**\n * @type a tuple of each possible type of data for `addData` method\n * of KameleoonClient\n * */\nexport type KameleoonDataType =\n | Browser\n | Conversion\n | CustomData\n | Device\n | PageView\n | UserAgent\n | VisitsData\n | GeolocationData\n | OperatingSystem\n | Cookie\n | ApplicationVersion\n | KameleoonConversionScore;\n\nexport type ActivityTimePropertyType = {\n lastActivityTime: number;\n};\n\nexport type ExistingCustomDataType = NonNullable<\n KameleoonVisitorDataType[KameleoonData.CustomData]\n>;\n\nexport type ExistingPageViewDataType = NonNullable<\n KameleoonVisitorDataType[KameleoonData.PageView]\n>;\n\nexport type ExistingNestedDataType =\n | ExistingCustomDataType\n | ExistingPageViewDataType;\n\nexport type ExistingArrayDataType = ExistingConversionDataType;\n\nexport type ExistingConversionDataType = NonNullable<\n KameleoonVisitorDataType[KameleoonData.Conversion]\n>;\n\nexport type ExistingVisitsDataType = NonNullable<\n KameleoonVisitorDataType[KameleoonData.VisitsData]\n>;\n\nexport type ExistingDataType<T extends KameleoonData> = NonNullable<\n KameleoonVisitorDataType[T]\n>;\n\nexport type KameleoonVisitorDataType<T = ActivityTimePropertyType> = {\n [KameleoonData.CustomData]?: {\n [index: string]: (CustomDataType & T) | undefined;\n };\n [KameleoonData.Conversion]?: (ConversionDataType & T)[];\n [KameleoonData.GeolocationData]?: GeolocationDataType & T;\n [KameleoonData.UserAgent]?: UserAgentDataType & T;\n [KameleoonData.PageView]?: { [url: string]: PageViewDataType & T };\n [KameleoonData.Browser]?: BrowserDataType & T;\n [KameleoonData.Device]?: DeviceDataType & T;\n [KameleoonData.Cookie]?: CookieDataType & T;\n [KameleoonData.KameleoonConversionScore]?: KCSDataType & T;\n [KameleoonData.OperatingSystem]?: OperatingSystemDataType & T;\n [KameleoonData.ApplicationVersion]?: ApplicationVersionDataType & T;\n [KameleoonData.VisitsData]?: VisitsDataType & T;\n};\n\nexport enum KameleoonData {\n CustomData = 'customData',\n PageView = 'pageView',\n GeolocationData = 'geolocation',\n Browser = 'browser',\n Conversion = 'conversion',\n Cookie = 'cookie',\n Device = 'device',\n OperatingSystem = 'operatingSystem',\n UserAgent = 'userAgent',\n ApplicationVersion = 'applicationVersion',\n VisitsData = 'visitsData',\n KameleoonConversionScore = 'kameleoonConversionScore',\n}\n\ntype SharedDataPropertiesType = {\n type: KameleoonData;\n sent: boolean;\n};\n\nexport type BrowserDataType = {\n browser: BrowserType;\n version?: number;\n} & SharedDataPropertiesType;\n\nexport type ConversionDataType = {\n goalId: number;\n revenue: number;\n negative: boolean;\n} & SharedDataPropertiesType;\n\nexport type CustomDataType = {\n index: number;\n value: string[];\n isIdentifier: boolean;\n} & SharedDataPropertiesType;\n\nexport type DeviceDataType = {\n device: DeviceType;\n} & SharedDataPropertiesType;\n\nexport type KCSDataType = {\n kcs: KCSType;\n} & SharedDataPropertiesType;\n\nexport type VisitsDataType = {\n visits: number[];\n} & SharedDataPropertiesType;\n\nexport type OperatingSystemDataType = {\n operatingSystem: OperatingSystemType;\n} & SharedDataPropertiesType;\n\nexport type CookieDataType = {\n cookie: CookieType[];\n} & SharedDataPropertiesType;\n\nexport type GeolocationDataType = GeolocationInfoType &\n SharedDataPropertiesType;\n\nexport type PageViewDataType = {\n urlAddress: string;\n title: string;\n referrers?: number[];\n timestamps: number[];\n} & SharedDataPropertiesType;\n\nexport type UserAgentDataType = {\n value: string;\n} & SharedDataPropertiesType;\n\nexport type ApplicationVersionDataType = {\n version: string;\n} & SharedDataPropertiesType;\n\n/**\n * @param {number} goalId - an id of a goal to track\n * @param {number | undefined} revenue - an optional parameter for revenue, default value is `0`\n * @param {boolean | undefined} negative - an optional parameter identifying whether the conversion should be removed, default value is `false`\n * */\nexport type ConversionParametersType = {\n goalId: number;\n revenue?: number;\n negative?: boolean;\n};\n\n/**\n * @param {string} urlAddress - url address of the page to track\n * @param {string} title - title of the web page\n * @param {number[] | undefined} referrers - an optional parameter containing a list of referrersIndices, has no default value\n * */\nexport type PageViewParametersType = {\n urlAddress: string;\n title: string;\n referrers?: number[];\n};\n\n/**\n * @readonly\n * @enum {string} an Enum containing all possible variants for device type\n * */\nexport enum DeviceType {\n Phone = 'PHONE',\n Tablet = 'TABLET',\n Desktop = 'DESKTOP',\n}\n\n/**\n * @readonly\n * @enum {string} an Enum containing all possible variants for operating system type\n * */\nexport enum OperatingSystemType {\n WindowsPhone = 'WINDOWS_PHONE',\n Windows = 'WINDOWS',\n Android = 'ANDROID',\n Linux = 'LINUX',\n Mac = 'MAC',\n IOS = 'IOS',\n}\n\n/**\n * @param {string} country - a country of a visitor\n * @param {string | undefined} region - an optional parameter containing a region of a visitor, has no default value\n * @param {string | undefined} city - an optional parameter containing a city of a visitor, has no default value\n * @param {string | undefined} postalCode - an optional parameter containing a postal code of a visitor, has no default value\n * @param {[number, number] | undefined} coordinates - an optional parameter containing a pair of coordinates (longitude and latitude) of a visitor, has no default value. Coordinate `number` represents decimal degrees (double that can be negative)\n * */\nexport type GeolocationInfoType = {\n country: string;\n region?: string;\n city?: string;\n postalCode?: string;\n coordinates?: [number, number];\n};\n\n/**\n * @param {string} key - a key of a cookie\n * @param {string} value - a value of a cookie\n * */\nexport type CookieType = {\n key: string;\n value: string;\n};\n\n/**\n * @type Nested object of key moments and goals with their respective scores\n * */\nexport type KCSType = {\n [keyMoment: string]: {\n [goalId: string]: number;\n };\n};\n\nexport type OptionalCookieType = Omit<CookieType, 'key'> & {\n key?: string;\n};\n\n/**\n * @readonly\n * @enum {string} an Enum containing all possible variants for browser type\n * */\nexport enum BrowserType {\n Chrome = 'CHROME',\n InternetExplorer = 'IE',\n Firefox = 'FIREFOX',\n Safari = 'SAFARI',\n Opera = 'OPERA',\n Other = 'OTHER',\n}\n\nexport const OperatingSystemIndexMap = {\n [OperatingSystemType.Windows]: 0,\n [OperatingSystemType.Mac]: 1,\n [OperatingSystemType.IOS]: 2,\n [OperatingSystemType.Linux]: 3,\n [OperatingSystemType.Android]: 4,\n [OperatingSystemType.WindowsPhone]: 5,\n} as const;\n\nexport const OperatingSystemTypeMap = constructTypeMap<OperatingSystemType>(\n OperatingSystemIndexMap,\n);\n\nexport const BrowserIndexMap = {\n [BrowserType.Chrome]: 0,\n [BrowserType.InternetExplorer]: 1,\n [BrowserType.Firefox]: 2,\n [BrowserType.Safari]: 3,\n [BrowserType.Opera]: 4,\n [BrowserType.Other]: 5,\n} as const;\n\nexport const BrowserTypeMap = constructTypeMap<BrowserType>(BrowserIndexMap);\n\nexport type SingleDataType = {\n [KameleoonData.Device]: Device | null;\n [KameleoonData.Browser]: Browser | null;\n [KameleoonData.GeolocationData]: GeolocationData | null;\n [KameleoonData.OperatingSystem]: OperatingSystem | null;\n [KameleoonData.KameleoonConversionScore]: KameleoonConversionScore | null;\n};\n\nexport type MultipleDataType = {\n [KameleoonData.CustomData]: Map<number, CustomData>;\n [KameleoonData.PageView]: Map<string, PageView>;\n [KameleoonData.Conversion]: Map<number, Conversion>;\n};\n\nexport type VisitProcessorDataType = {\n visitorData: KameleoonDataType[];\n storageVisitorData: KameleoonDataType[];\n visitsData: VisitsData;\n experimentData: FeatureFlagVariationsType;\n};\n"],"mappings":"aAmBA,IAAAA,QAAA,CAAAC,OAAA,cAA6CC,MAAA,CAAAC,cAAA,CAAAC,OAAA,eAAAC,KAAA,MAAAD,OAAA,CAAAE,sBAAA,CAAAF,OAAA,CAAAG,mBAAA,CAAAH,OAAA,CAAAI,uBAAA,CAAAJ,OAAA,CAAAK,aAAA,CAAAL,OAAA,CAAAM,UAAA,CAAAN,OAAA,CAAAO,cAAA,CAAAP,OAAA,CAAAQ,WAAA,CAAAR,OAAA,CAAAS,eAAA,WAyJjC,CAAAJ,aAAa,CAAAL,OAAA,CAAAK,aAAA,UAAbA,CAAa,QAAb,CAAAA,CAAa,CAAAK,UAAA,cAAbL,CAAa,CAAAM,QAAA,YAAbN,CAAa,CAAAO,eAAA,eAAbP,CAAa,CAAAQ,OAAA,WAAbR,CAAa,CAAAS,UAAA,cAAbT,CAAa,CAAAU,MAAA,UAAbV,CAAa,CAAAW,MAAA,UAAbX,CAAa,CAAAY,eAAA,mBAAbZ,CAAa,CAAAa,SAAA,aAAbb,CA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AA,CAAAS,eAAA,CAAG,CAC7B,CAACD,WAAW,CAACuB,MAAM,EAAG,CAAC,CACvB,CAACvB,WAAW,CAACwB,gBAAgB,EAAG,CAAC,CACjC,CAACxB,WAAW,CAACyB,OAAO,EAAG,CAAC,CACxB,CAACzB,WAAW,CAAC0B,MAAM,EAAG,CAAC,CACvB,CAAC1B,WAAW,CAAC2B,KAAK,EAAG,CAAC,CACtB,CAAC3B,WAAW,CAAC4B,KAAK,EAAG,CACvB,CAAU,CAEG7B,cAAc,CAAAP,OAAA,CAAAO,cAAA,CAAG,GAAA8B,yBAAgB,EAAc5B,eAAe,CAAC"}
@@ -7,17 +7,8 @@ export declare class UserAgent implements IKameleoonData {
7
7
  private value;
8
8
  private sent;
9
9
  constructor(value: string);
10
- /**
11
- * @property url - url for the current data type used for events tracking
12
- * */
13
10
  get url(): string;
14
- /**
15
- * @property data - data of the current class instance
16
- * */
17
11
  get data(): UserAgentDataType;
18
- /**
19
- * @property isSent - signifying if the data was sent already tracked
20
- * */
21
12
  get isSent(): boolean;
22
13
  set isSent(value: boolean);
23
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"userAgent.js","names":["_types","require","Object","defineProperty","exports","value","UserAgent","_defineProperty","a","b","c","_toPropertyKey","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","d","call","TypeError","String","Number","constructor","sent","url","data","type","KameleoonData","isSent"],"sources":["../../src/kameleoonData/userAgent.ts"],"sourcesContent":["import { UserAgentDataType, IKameleoonData, KameleoonData } from './types';\n\n/**\n * @class\n * UserAgent - a class for creating an instance for user agent\n * */\nexport class UserAgent implements IKameleoonData {\n private value: string;\n private sent: boolean;\n\n constructor(value: string) {\n this.value = value;\n this.sent = false;\n }\n\n /**\n * @property url - url for the current data type used for events tracking\n * */\n get url(): string {\n return '';\n }\n\n /**\n * @property data - data of the current class instance\n * */\n get data(): UserAgentDataType {\n return {\n value: this.value,\n type: KameleoonData.UserAgent,\n sent: this.sent,\n };\n }\n\n /**\n * @property isSent - signifying if the data was sent already tracked\n * */\n get isSent(): boolean {\n return this.sent;\n }\n\n set isSent(value: boolean) {\n this.sent = value;\n }\n}\n"],"mappings":"aAAA,IAAAA,MAAA,CAAAC,OAAA,YAA2EC,MAAA,CAAAC,cAAA,CAAAC,OAAA,eAAAC,KAAA,MAAAD,OAAA,CAAAE,SAAA,iBAAAC,gBAAAC,CAAA,CAAAC,CAAA,CAAAC,CAAA,SAAAD,CAAA,CAAAE,cAAA,CAAAF,CAAA,EAAAA,CAAA,IAAAD,CAAA,CAAAN,MAAA,CAAAC,cAAA,CAAAK,CAAA,CAAAC,CAAA,EAAAJ,KAAA,CAAAK,CAAA,CAAAE,UAAA,IAAAC,YAAA,IAAAC,QAAA,MAAAN,CAAA,CAAAC,CAAA,EAAAC,CAAA,CAAAF,CAAA,UAAAG,eAAAH,CAAA,MAAAC,CAAA,CAAAM,YAAA,CAAAP,CAAA,kCAAAC,CAAA,CAAAA,CAAA,CAAAA,CAAA,aAAAM,aAAAP,CAAA,CAAAC,CAAA,sBAAAD,CAAA,GAAAA,CAAA,QAAAA,CAAA,KAAAE,CAAA,CAAAF,CAAA,CAAAQ,MAAA,CAAAC,WAAA,cAAAP,CAAA,MAAAQ,CAAA,CAAAR,CAAA,CAAAS,IAAA,CAAAX,CAAA,CAAAC,CAAA,iCAAAS,CAAA,QAAAA,CAAA,WAAAE,SAAA,mEAAAX,CAAA,CAAAY,MAAA,CAAAC,MAAA,EAAAd,CAAA,EAMpE,KAAM,CAAAF,SAAoC,CAI/CiB,WAAWA,CAAClB,CAAa,CAAE,CAAAE,eAAA,sBAAAA,eAAA,qBACzB,IAAI,CAACF,KAAK,CAAGA,CAAK,CAClB,IAAI,CAACmB,IAAI,GACX,CAKA,GAAI,CAAAC,GAAGA,CAAA,CAAW,CAChB,MAAO,EACT,CAKA,GAAI,CAAAC,IAAIA,CAAA,CAAsB,CAC5B,MAAO,CACLrB,KAAK,CAAE,IAAI,CAACA,KAAK,CACjBsB,IAAI,CAAEC,oBAAa,CAACtB,SAAS,CAC7BkB,IAAI,CAAE,IAAI,CAACA,IACb,CACF,CAKA,GAAI,CAAAK,MAAMA,CAAA,CAAY,CACpB,MAAO,KAAI,CAACL,IACd,CAEA,GAAI,CAAAK,MAAMA,CAACxB,CAAc,CAAE,CACzB,IAAI,CAACmB,IAAI,CAAGnB,CACd,CACF,CAACD,OAAA,CAAAE,SAAA,CAAAA,SAAA"}
1
+ {"version":3,"file":"userAgent.js","names":["_types","require","Object","defineProperty","exports","value","UserAgent","_defineProperty","a","b","c","_toPropertyKey","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","d","call","TypeError","String","Number","constructor","sent","url","data","type","KameleoonData","isSent"],"sources":["../../src/kameleoonData/userAgent.ts"],"sourcesContent":["import { UserAgentDataType, IKameleoonData, KameleoonData } from './types';\n\n/**\n * @class\n * UserAgent - a class for creating an instance for user agent\n * */\nexport class UserAgent implements IKameleoonData {\n private value: string;\n private sent: boolean;\n\n constructor(value: string) {\n this.value = value;\n this.sent = false;\n }\n\n get url(): string {\n return '';\n }\n\n get data(): UserAgentDataType {\n return {\n value: this.value,\n type: KameleoonData.UserAgent,\n sent: this.sent,\n };\n }\n\n get isSent(): boolean {\n return this.sent;\n }\n\n set isSent(value: boolean) {\n this.sent = value;\n }\n}\n"],"mappings":"aAAA,IAAAA,MAAA,CAAAC,OAAA,YAA2EC,MAAA,CAAAC,cAAA,CAAAC,OAAA,eAAAC,KAAA,MAAAD,OAAA,CAAAE,SAAA,iBAAAC,gBAAAC,CAAA,CAAAC,CAAA,CAAAC,CAAA,SAAAD,CAAA,CAAAE,cAAA,CAAAF,CAAA,EAAAA,CAAA,IAAAD,CAAA,CAAAN,MAAA,CAAAC,cAAA,CAAAK,CAAA,CAAAC,CAAA,EAAAJ,KAAA,CAAAK,CAAA,CAAAE,UAAA,IAAAC,YAAA,IAAAC,QAAA,MAAAN,CAAA,CAAAC,CAAA,EAAAC,CAAA,CAAAF,CAAA,UAAAG,eAAAH,CAAA,MAAAC,CAAA,CAAAM,YAAA,CAAAP,CAAA,kCAAAC,CAAA,CAAAA,CAAA,CAAAA,CAAA,aAAAM,aAAAP,CAAA,CAAAC,CAAA,sBAAAD,CAAA,GAAAA,CAAA,QAAAA,CAAA,KAAAE,CAAA,CAAAF,CAAA,CAAAQ,MAAA,CAAAC,WAAA,cAAAP,CAAA,MAAAQ,CAAA,CAAAR,CAAA,CAAAS,IAAA,CAAAX,CAAA,CAAAC,CAAA,iCAAAS,CAAA,QAAAA,CAAA,WAAAE,SAAA,mEAAAX,CAAA,CAAAY,MAAA,CAAAC,MAAA,EAAAd,CAAA,EAMpE,KAAM,CAAAF,SAAoC,CAI/CiB,WAAWA,CAAClB,CAAa,CAAE,CAAAE,eAAA,sBAAAA,eAAA,qBACzB,IAAI,CAACF,KAAK,CAAGA,CAAK,CAClB,IAAI,CAACmB,IAAI,GACX,CAEA,GAAI,CAAAC,GAAGA,CAAA,CAAW,CAChB,MAAO,EACT,CAEA,GAAI,CAAAC,IAAIA,CAAA,CAAsB,CAC5B,MAAO,CACLrB,KAAK,CAAE,IAAI,CAACA,KAAK,CACjBsB,IAAI,CAAEC,oBAAa,CAACtB,SAAS,CAC7BkB,IAAI,CAAE,IAAI,CAACA,IACb,CACF,CAEA,GAAI,CAAAK,MAAMA,CAAA,CAAY,CACpB,MAAO,KAAI,CAACL,IACd,CAEA,GAAI,CAAAK,MAAMA,CAACxB,CAAc,CAAE,CACzB,IAAI,CAACmB,IAAI,CAAGnB,CACd,CACF,CAACD,OAAA,CAAAE,SAAA,CAAAA,SAAA"}
@@ -0,0 +1,34 @@
1
+ import { VisitType } from '../requester';
2
+ import { VisitorDataFiltersType } from '../utilities/types';
3
+ import { VisitProcessorDataType, KCSType } from './types';
4
+ import { DataManager } from './dataManager';
5
+ interface IVisitProcessor {
6
+ processVisit(visit: VisitType): void;
7
+ processKcs(kcsData?: KCSType): void;
8
+ processMultipleDataTypes(): void;
9
+ }
10
+ export declare class VisitProcessor implements IVisitProcessor {
11
+ private visitsData;
12
+ private visitorData;
13
+ private storageVisitorData;
14
+ private experimentData;
15
+ private filters;
16
+ private dataManager;
17
+ private singleDataTypes;
18
+ private multipleDataTypes;
19
+ constructor(filters: VisitorDataFiltersType, dataManager: DataManager);
20
+ get data(): VisitProcessorDataType;
21
+ processVisit(visit: VisitType): void;
22
+ processMultipleDataTypes(): void;
23
+ processKcs(kcsData?: KCSType): void;
24
+ private processBrowser;
25
+ private processDevice;
26
+ private processOperatingSystem;
27
+ private processGeolocationData;
28
+ private processCustomData;
29
+ private processConversion;
30
+ private processPageView;
31
+ private processExperiments;
32
+ private processVisitsData;
33
+ }
34
+ export {};
@@ -0,0 +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 b=_toPropertyKey(b),b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==typeof b?b:b+""}function _toPrimitive(a,b){if("object"!=typeof a||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=typeof d)return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}class VisitProcessor{constructor(a,b){_defineProperty(this,"visitsData",new _visitsData.VisitsData([])),_defineProperty(this,"visitorData",[]),_defineProperty(this,"storageVisitorData",[]),_defineProperty(this,"experimentData",{}),_defineProperty(this,"filters",{}),_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=a,this.dataManager=b}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.dataManager.storedDataTypes.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.dataManager.storedDataTypes.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.dataManager.storedDataTypes.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.dataManager.storedDataTypes.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,isSent:!1}}}processVisitsData(a){this.visitsData.timestamp=a.timeStarted}}exports.VisitProcessor=VisitProcessor;
2
+ //# sourceMappingURL=visitProcessor.js.map
@@ -0,0 +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,G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AACsD,WAAW,CAAE,CAG5BzC,sBAAU,CAACwC,gBAAgB,CACzBjC,CAAK,CACL,IAAI,CAACc,iBAAiB,CAAC9B,oBAAa,CAACS,UAAU,CACjD,CAAC,CAID,KAAM,CAAAyC,CAAW,CAAGzC,sBAAU,CAAC0C,cAAc,CAACnC,CAAK,CAAC,CAEhDkC,CAAW,CAACE,MAAM,EACpB,IAAI,CAACzC,WAAW,CAACqB,IAAI,CAAC,GAAGkB,CAAW,CAExC,CACF,CAEQ3B,eAAeA,CAACP,CAAgB,CAAQ,CAC1C,IAAI,CAACpB,OAAO,CAACyD,SAAS,EACxB7C,kBAAQ,CAACyC,gBAAgB,CACvBjC,CAAK,CACL,IAAI,CAACc,iBAAiB,CAAC9B,oBAAa,CAACQ,QAAQ,CAC/C,CAEJ,CAEQgB,kBAAkBA,CAACR,CAAgB,CAAQ,CACjD,GAAI,IAAI,CAACpB,OAAO,CAAC0D,WAAW,EAAItC,CAAK,CAACuC,gBAAgB,CACpD,IAAK,KAAM,CAAAC,CAAe,GAAI,CAAAxC,CAAK,CAACuC,gBAAgB,CAAE,CACpD,KAAM,CAAEE,EAAE,CAAFA,CAAE,CAAEC,WAAW,CAAXA,CAAY,CAAC,CAAGF,CAAe,CAAC9C,IAAI,CAEhD,IAAI,CAACI,cAAc,CAAC2C,CAAE,CAAC,CAAG,CACxBC,WAAW,CAAXA,CAAW,CACXC,cAAc,GAAO,CACrBC,MAAM,GACR,CACF,CAEJ,CAEQnC,iBAAiBA,CAACT,CAAgB,CAAQ,CAChD,IAAI,CAACH,UAAU,CAACgD,SAAS,CAAG7C,CAAK,CAAC8C,WACpC,CACF,CAACC,OAAA,CAAArE,cAAA,CAAAA,cAAA"}
@@ -1,34 +1,20 @@
1
- import { VisitType } from '../requester';
2
1
  import { IKameleoonData, VisitsDataType } from './types';
3
2
  /**
4
3
  * @class
5
4
  * Visits - a class for creating an instance of a stored visits data
6
5
  * */
7
6
  export declare class VisitsData implements IKameleoonData {
8
- private previousVisits;
9
- private currentVisit;
7
+ private visits;
10
8
  /**
11
- * @param {number} currentVisit - a current visit
12
- * @param {number[]} previousVisits - a list of previous visits
13
- * */
14
- constructor(currentVisit: number | null, previousVisits: number[]);
15
- /**
16
- * @property url - url for the current data type used for events tracking
9
+ * @param {number[]} visits - a list of visits
17
10
  * */
11
+ constructor(visits: number[]);
18
12
  get url(): string;
19
- /**
20
- * @property data - data of the current class instance
21
- * */
22
13
  get data(): VisitsDataType;
23
- /**
24
- * @property isSent - signifying if the data was sent already tracked
25
- * */
26
14
  get isSent(): boolean;
27
15
  /**
28
- * @private
29
- * @method _fromRemoteVisits - an internal method for creating an instance of Visits class from a list of visits
30
- * @param {VisitType[]} visits - a list of visits
31
- * @returns {VisitsData | undefined} an instance of Visits class or undefined if there were not any visits
32
- * */
33
- static _fromRemoteVisits(visits: VisitType[], hasCurrent: boolean): VisitsData | undefined;
16
+ * Adds a single timestamp while ensuring the list remains sorted and unique
17
+ * @param {number} timestamp - The timestamp to add
18
+ */
19
+ set timestamp(timestamp: number);
34
20
  }
@@ -1,2 +1,2 @@
1
- "use strict";var _types=require("./types");Object.defineProperty(exports,"__esModule",{value:!0}),exports.VisitsData=void 0;function _defineProperty(a,b,c){return b=_toPropertyKey(b),b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==typeof b?b:b+""}function _toPrimitive(a,b){if("object"!=typeof a||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=typeof d)return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}class VisitsData{constructor(a,b){_defineProperty(this,"previousVisits",void 0),_defineProperty(this,"currentVisit",void 0),this.previousVisits=b,this.currentVisit=a}get url(){return""}get data(){return{currentVisit:this.currentVisit,previousVisits:this.previousVisits,type:_types.KameleoonData.VisitsData,sent:!0}}get isSent(){return!0}static _fromRemoteVisits(a,b){const c=[],d=b?1:0,e=b?a[0].timeStarted:null;for(let e=a.length-1;e>=d;e--){const b=a[e];c.push(b.timeStarted)}if(c.length||e)return new VisitsData(e,c)}}exports.VisitsData=VisitsData;
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 b=_toPropertyKey(b),b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==typeof b?b:b+""}function _toPrimitive(a,b){if("object"!=typeof a||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=typeof d)return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}class VisitsData{constructor(a){_defineProperty(this,"visits",void 0),this.visits=a}get url(){return""}get data(){return{visits:this.visits,type:_types2.KameleoonData.VisitsData,sent:!0}}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":["_types","require","Object","defineProperty","exports","value","VisitsData","_defineProperty","a","b","c","_toPropertyKey","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","d","call","TypeError","String","Number","constructor","currentVisit","previousVisits","url","data","type","KameleoonData","sent","isSent","_fromRemoteVisits","visits","hasCurrent","visitsList","limit","timeStarted","i","length","visit","push"],"sources":["../../src/kameleoonData/visitsData.ts"],"sourcesContent":["import { VisitType } from 'src/requester';\nimport { IKameleoonData, KameleoonData, VisitsDataType } from './types';\n\n/**\n * @class\n * Visits - a class for creating an instance of a stored visits data\n * */\nexport class VisitsData implements IKameleoonData {\n // --- Note ---\n // Ascending order\n private previousVisits: number[];\n private currentVisit: number | null;\n\n /**\n * @param {number} currentVisit - a current visit\n * @param {number[]} previousVisits - a list of previous visits\n * */\n constructor(currentVisit: number | null, previousVisits: number[]) {\n this.previousVisits = previousVisits;\n this.currentVisit = currentVisit;\n }\n\n /**\n * @property url - url for the current data type used for events tracking\n * */\n get url(): string {\n return '';\n }\n\n /**\n * @property data - data of the current class instance\n * */\n get data(): VisitsDataType {\n return {\n currentVisit: this.currentVisit,\n previousVisits: this.previousVisits,\n type: KameleoonData.VisitsData,\n sent: true,\n };\n }\n\n /**\n * @property isSent - signifying if the data was sent already tracked\n * */\n get isSent(): boolean {\n return true;\n }\n\n /**\n * @private\n * @method _fromRemoteVisits - an internal method for creating an instance of Visits class from a list of visits\n * @param {VisitType[]} visits - a list of visits\n * @returns {VisitsData | undefined} an instance of Visits class or undefined if there were not any visits\n * */\n public static _fromRemoteVisits(\n visits: VisitType[],\n hasCurrent: boolean,\n ): VisitsData | undefined {\n const visitsList: number[] = [];\n const limit = hasCurrent ? 1 : 0;\n const currentVisit = hasCurrent ? visits[0].timeStarted : null;\n\n // --- Note ---\n // Going backwards to get the latest visit data\n for (let i = visits.length - 1; i >= limit; i--) {\n const visit = visits[i];\n\n visitsList.push(visit.timeStarted);\n }\n\n if (visitsList.length || currentVisit) {\n return new VisitsData(currentVisit, visitsList);\n }\n }\n}\n"],"mappings":"aACA,IAAAA,MAAA,CAAAC,OAAA,YAAwEC,MAAA,CAAAC,cAAA,CAAAC,OAAA,eAAAC,KAAA,MAAAD,OAAA,CAAAE,UAAA,iBAAAC,gBAAAC,CAAA,CAAAC,CAAA,CAAAC,CAAA,SAAAD,CAAA,CAAAE,cAAA,CAAAF,CAAA,EAAAA,CAAA,IAAAD,CAAA,CAAAN,MAAA,CAAAC,cAAA,CAAAK,CAAA,CAAAC,CAAA,EAAAJ,KAAA,CAAAK,CAAA,CAAAE,UAAA,IAAAC,YAAA,IAAAC,QAAA,MAAAN,CAAA,CAAAC,CAAA,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CAAK,CAAEE,CAAC,EAAE,CAAE,CAC/C,KAAM,CAAAE,CAAK,CAAGP,CAAM,CAACK,CAAC,CAAC,CAEvBH,CAAU,CAACM,IAAI,CAACD,CAAK,CAACH,WAAW,CACnC,CAEA,GAAIF,CAAU,CAACI,MAAM,EAAIf,CAAY,CACnC,MAAO,IAAI,CAAAlB,UAAU,CAACkB,CAAY,CAAEW,CAAU,CAElD,CACF,CAAC/B,OAAA,CAAAE,UAAA,CAAAA,UAAA"}
1
+ {"version":3,"file":"visitsData.js","names":["VisitsData","constructor","visits","_defineProperty","url","data","type","KameleoonData","sent","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';\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\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 sent: true,\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":"wsBAQO,KAAM,CAAAA,UAAqC,CAQhDC,WAAWA,CAACC,CAAgB,CAAE,CAAAC,eAAA,uBAC5B,IAAI,CAACD,MAAM,CAAGA,CAChB,CAEA,GAAI,CAAAE,GAAGA,CAAA,CAAW,CAChB,MAAO,EACT,CAEA,GAAI,CAAAC,IAAIA,CAAA,CAAmB,CACzB,MAAO,CACLH,MAAM,CAAE,IAAI,CAACA,MAAM,CACnBI,IAAI,CAAEC,qBAAa,CAACP,UAAU,CAC9BQ,IAAI,GACN,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,CAACX,MAAM,CACjBY,OAAO,CAAEJ,CAAS,CAClBK,KAAK,CAAEC,YAAK,CAACC,SACf,CAAC,CAAC,CAEF,IAAI,CAACf,MAAM,CAAG,CAAC,GAAG,GAAI,CAAAgB,GAAG,CAAC,IAAI,CAAChB,MAAM,CAAC,CACxC,CACF,CAACiB,OAAA,CAAAnB,UAAA,CAAAA,UAAA"}
@@ -15,10 +15,8 @@ export declare const UrlParameter: StrictParameterRecord<ParameterType>;
15
15
  export declare const UrlFirstParameter: StrictFirstParameterRecord<ParameterType>;
16
16
  export declare const UrlQuery: StrictQueryRecord<QueryType>;
17
17
  export declare const UrlTracking: StrictTrackingRecord<TrackingType>;
18
+ export declare const DATA_API_DOMAIN = "data.kameleoon";
18
19
  export declare const URL: {
19
20
  SERVER_SENT_EVENTS: string;
20
21
  CLIENT_CONFIGURATION: string;
21
- VISIT_EVENT: string;
22
- VISIT_DATA: string;
23
- DATA_MAP: string;
24
22
  };
@@ -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.URL=exports.RETRIES_DELAY=exports.NUMBER_OF_RETRIES=exports.Header=exports.DEFAULT_REQUEST_TIMEOUT=void 0;const DEFAULT_REQUEST_TIMEOUT=exports.DEFAULT_REQUEST_TIMEOUT=10*_types.Milliseconds.Second,RETRIES_DELAY=exports.RETRIES_DELAY=5*_types.Milliseconds.Second,NUMBER_OF_RETRIES=exports.NUMBER_OF_RETRIES=3;let Header=exports.Header=function(a){return a.UserAgent="User-Agent",a.ContentType="Content-Type",a.SdkVersion="X-Kameleoon-SDK-Version",a.SdkType="X-Kameleoon-SDK-Type",a.Authorization="Authorization",a.AcceptEncoding="Accept-Encoding",a}({});const UrlEventType=exports.UrlEventType={CustomData:"eventType=customData",StaticData:"eventType=staticData",Page:"eventType=page",Conversion:"eventType=conversion",Activity:"eventType=activity",Experiment:"eventType=experiment",Geolocation:"eventType=geolocation"},UrlParameter=exports.UrlParameter={Title:"&title=",ReferrersIndices:"&referrersIndices=",Negative:"&negative=",Revenue:"&revenue=",Overwrite:"&overwrite=",Index:"&index=",BrowserIndex:"&browserIndex=",BrowserVersion:"&browserVersion=",Href:"&href=",DeviceType:"&deviceType=",SiteCode:"&siteCode=",GoalId:"&goalId=",VisitorCode:"&visitorCode=",VariationId:"&variationId=",Ts:"&ts=",Key:"&key=",SdkName:"&sdkName=",SdkVersion:"&sdkVersion=",ValuesCountMap:"&valuesCountMap=",Nonce:"&nonce=",Id:"&id=",CustomData:"&customData=",CurrentVisit:"&currentVisit=",MaxNumberPreviousVisits:"&maxNumberPreviousVisits=",Os:"&os=",OsIndex:"&osIndex=",Country:"&country=",City:"&city=",Region:"&region=",Latitude:"&latitude=",Longitude:"&longitude=",PostalCode:"&postalCode=",Conversion:"&conversion=",StaticData:"&staticData=",Geolocation:"&geolocation=",Page:"&page=",Experiment:"&experiment=",Browser:"&browser=",Environment:"&environment=",MappingIdentifier:"&mappingIdentifier=",MappingValue:"&mappingValue="},UrlFirstParameter=exports.UrlFirstParameter={CustomData:"?customData=",StaticData:"?staticData=",Page:"?page=",Conversion:"?conversion=",Geolocation:"?geolocation=",Experiment:"?experiment=",ValuesCountMap:"?valuesCountMap=",Id:"?id=",Nonce:"?nonce=",Country:"?country=",Environment:"?environment=",City:"?city=",Region:"?region=",Latitude:"?latitude=",Longitude:"?longitude=",PostalCode:"?postalCode=",SdkName:"?sdkName=",SdkVersion:"?sdkVersion=",BrowserIndex:"?browserIndex=",BrowserVersion:"?browserVersion=",SiteCode:"?siteCode=",VisitorCode:"?visitorCode=",CurrentVisit:"?currentVisit=",MaxNumberPreviousVisits:"?maxNumberPreviousVisits=",Negative:"?negative=",Revenue:"?revenue=",Title:"?title=",Os:"?os=",OsIndex:"?osIndex=",Browser:"?browser=",ReferrersIndices:"?referrersIndices=",Overwrite:"?overwrite=",Index:"?index=",Href:"?href=",VariationId:"?variationId=",DeviceType:"?deviceType=",GoalId:"?goalId=",Ts:"?ts=",Key:"?key=",MappingIdentifier:"?mappingIdentifier=",MappingValue:"?mappingValue="},UrlQuery=exports.UrlQuery={Sse:"sse?siteCode=",Map:"map?siteCode=",Events:"events?siteCode=",Visitor:"visitor?siteCode="},UrlTracking=exports.UrlTracking={Visit:"visit/",Map:"map/"},topLevelDomain="io",URL_DATA_API="https://data.kameleoon.".concat(topLevelDomain),URL=exports.URL={SERVER_SENT_EVENTS:"https://events.kameleoon.com:8110/",CLIENT_CONFIGURATION:"https://sdk-config.kameleoon.eu/",VISIT_EVENT:"".concat(URL_DATA_API,"/").concat(UrlTracking.Visit+UrlQuery.Events),VISIT_DATA:"".concat(URL_DATA_API,"/").concat(UrlTracking.Visit+UrlQuery.Visitor),DATA_MAP:"".concat(URL_DATA_API,"/").concat(UrlTracking.Map+UrlQuery.Map)};
1
+ "use strict";var _types=require("../types");Object.defineProperty(exports,"__esModule",{value:!0}),exports.UrlTracking=exports.UrlQuery=exports.UrlParameter=exports.UrlFirstParameter=exports.UrlEventType=exports.URL=exports.RETRIES_DELAY=exports.NUMBER_OF_RETRIES=exports.Header=exports.DEFAULT_REQUEST_TIMEOUT=exports.DATA_API_DOMAIN=void 0;const DEFAULT_REQUEST_TIMEOUT=exports.DEFAULT_REQUEST_TIMEOUT=10*_types.Milliseconds.Second,RETRIES_DELAY=exports.RETRIES_DELAY=5*_types.Milliseconds.Second,NUMBER_OF_RETRIES=exports.NUMBER_OF_RETRIES=3;let Header=exports.Header=function(a){return a.UserAgent="User-Agent",a.ContentType="Content-Type",a.SdkVersion="X-Kameleoon-SDK-Version",a.SdkType="X-Kameleoon-SDK-Type",a.Authorization="Authorization",a.AcceptEncoding="Accept-Encoding",a}({});const UrlEventType=exports.UrlEventType={CustomData:"eventType=customData",StaticData:"eventType=staticData",Page:"eventType=page",Conversion:"eventType=conversion",Activity:"eventType=activity",Experiment:"eventType=experiment",Geolocation:"eventType=geolocation"},UrlParameter=exports.UrlParameter={Title:"&title=",ReferrersIndices:"&referrersIndices=",Negative:"&negative=",Revenue:"&revenue=",Overwrite:"&overwrite=",Index:"&index=",BrowserIndex:"&browserIndex=",BrowserVersion:"&browserVersion=",Href:"&href=",DeviceType:"&deviceType=",SiteCode:"&siteCode=",GoalId:"&goalId=",VisitorCode:"&visitorCode=",VariationId:"&variationId=",Ts:"&ts=",Key:"&key=",SdkName:"&sdkName=",SdkVersion:"&sdkVersion=",ValuesCountMap:"&valuesCountMap=",Nonce:"&nonce=",Id:"&id=",CustomData:"&customData=",CurrentVisit:"&currentVisit=",MaxNumberPreviousVisits:"&maxNumberPreviousVisits=",Os:"&os=",OsIndex:"&osIndex=",Country:"&country=",City:"&city=",Region:"&region=",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/"},DATA_API_DOMAIN=exports.DATA_API_DOMAIN="data.kameleoon",URL=exports.URL={SERVER_SENT_EVENTS:"https://events.kameleoon.com:8110/",CLIENT_CONFIGURATION:"https://sdk-config.kameleoon.eu/"};
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","URL","RETRIES_DELAY","NUMBER_OF_RETRIES","Header","DEFAULT_REQUEST_TIMEOUT","Milliseconds","Second","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","Sse","Map","Events","Visitor","Visit","topLevelDomain","URL_DATA_API","concat","SERVER_SENT_EVENTS","CLIENT_CONFIGURATION","VISIT_EVENT","VISIT_DATA","DATA_MAP"],"sources":["../../src/requester/constants.ts"],"sourcesContent":["import { Milliseconds } from 'src/types';\nimport {\n EventType,\n ParameterType,\n QueryType,\n StrictEventTypeRecord,\n StrictFirstParameterRecord,\n StrictParameterRecord,\n StrictQueryRecord,\n StrictTrackingRecord,\n TrackingType,\n} from './types';\n\nexport const DEFAULT_REQUEST_TIMEOUT = 10 * Milliseconds.Second;\nexport const RETRIES_DELAY = 5 * Milliseconds.Second;\nexport const NUMBER_OF_RETRIES = 3;\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: '&currentVisit=',\n MaxNumberPreviousVisits: '&maxNumberPreviousVisits=',\n Os: '&os=',\n OsIndex: '&osIndex=',\n Country: '&country=',\n City: '&city=',\n Region: '&region=',\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};\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};\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\nconst topLevelDomain = process.env.NODE_ENV === 'test' ? 'net' : 'io';\n\nconst URL_DATA_API = `https://data.kameleoon.${topLevelDomain}`;\n\nexport const URL = {\n SERVER_SENT_EVENTS: 'https://events.kameleoon.com:8110/',\n CLIENT_CONFIGURATION: 'https://sdk-config.kameleoon.eu/',\n VISIT_EVENT: `${URL_DATA_API}/${UrlTracking.Visit + UrlQuery.Events}`,\n VISIT_DATA: `${URL_DATA_API}/${UrlTracking.Visit + UrlQuery.Visitor}`,\n DATA_MAP: `${URL_DATA_API}/${UrlTracking.Map + UrlQuery.Map}`,\n};\n"],"mappings":"aAAA,IAAAA,MAAA,CAAAC,OAAA,aAAyCC,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,GAAA,CAAAP,OAAA,CAAAQ,aAAA,CAAAR,OAAA,CAAAS,iBAAA,CAAAT,OAAA,CAAAU,MAAA,CAAAV,OAAA,CAAAW,uBAAA,aAa5B,CAAAA,uBAAuB,CAAAX,OAAA,CAAAW,uBAAA,CAAG,EAAE,CAAGC,mBAAY,CAACC,MAAM,CAClDL,aAAa,CAAAR,OAAA,CAAAQ,aAAA,CAAG,CAAC,CAAGI,mBAAY,CAACC,MAAM,CACvCJ,iBAAiB,CAAAT,OAAA,CAAAS,iBAAA,CAAG,CAAC,IAEtB,CAAAC,MAAM,CAAAV,OAAA,CAAAU,MAAA,UAANA,CAAM,QAAN,CAAAA,CAAM,CAAAI,SAAA,cAANJ,CAAM,CAAAK,WAAA,gBAANL,CAAM,CAAAM,UAAA,2BAANN,CAAM,CAAAO,OAAA,wBAANP,CAAM,CAAAQ,aAAA,iBAANR,CAAM,CAAAS,cAAA,mBAANT,CAAM,WASL,CAAAJ,YAA8C,CAAAN,OAAA,CAAAM,YAAA,CAAG,CAC5Dc,UAAU,CAAE,sBA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YzD,QAAsC,CAAAH,OAAA,CAAAG,QAAA,CAAG,CACpD0D,GAAG,CAAE,eAAe,CACpBC,GAAG,CAAE,eAAe,CACpBC,MAAM,CAAE,kBAAkB,CAC1BC,OAAO,CAAE,mBACX,CAAC,CACY9D,WAA+C,CAAAF,OAAA,CAAAE,WAAA,CAAG,CAC7D+D,KAAK,CAAE,QAAQ,CACfH,GAAG,CAAE,MACP,CAAC,CAEKI,cAAc,CAA6C,IAAI,CAE/DC,YAAY,2BAAAC,MAAA,CAA6BF,cAAc,CAAE,CAElD3D,GAAG,CAAAP,OAAA,CAAAO,GAAA,CAAG,CACjB8D,kBAAkB,CAAE,oCAAoC,CACxDC,oBAAoB,CAAE,kCAAkC,CACxDC,WAAW,IAAAH,MAAA,CAAKD,YAAY,MAAAC,MAAA,CAAIlE,WAAW,CAAC+D,KAAK,CAAG9D,QAAQ,CAAC4D,MAAM,CAAE,CACrES,UAAU,IAAAJ,MAAA,CAAKD,YAAY,MAAAC,MAAA,CAAIlE,WAAW,CAAC+D,KAAK,CAAG9D,QAAQ,CAAC6D,OAAO,CAAE,CACrES,QAAQ,IAAAL,MAAA,CAAKD,YAAY,MAAAC,MAAA,CAAIlE,WAAW,CAAC4D,GAAG,CAAG3D,QAAQ,CAAC2D,GAAG,CAC7D,CAAC"}
1
+ {"version":3,"file":"constants.js","names":["_types","require","Object","defineProperty","exports","value","UrlTracking","UrlQuery","UrlParameter","UrlFirstParameter","UrlEventType","URL","RETRIES_DELAY","NUMBER_OF_RETRIES","Header","DEFAULT_REQUEST_TIMEOUT","DATA_API_DOMAIN","Milliseconds","Second","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","SERVER_SENT_EVENTS","CLIENT_CONFIGURATION"],"sources":["../../src/requester/constants.ts"],"sourcesContent":["import { Milliseconds } from 'src/types';\nimport {\n EventType,\n ParameterType,\n QueryType,\n StrictEventTypeRecord,\n StrictFirstParameterRecord,\n StrictParameterRecord,\n StrictQueryRecord,\n StrictTrackingRecord,\n TrackingType,\n} from './types';\n\nexport const DEFAULT_REQUEST_TIMEOUT = 10 * Milliseconds.Second;\nexport const RETRIES_DELAY = 5 * Milliseconds.Second;\nexport const NUMBER_OF_RETRIES = 3;\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: '&currentVisit=',\n MaxNumberPreviousVisits: '&maxNumberPreviousVisits=',\n Os: '&os=',\n OsIndex: '&osIndex=',\n Country: '&country=',\n City: '&city=',\n Region: '&region=',\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};\nexport const DATA_API_DOMAIN = 'data.kameleoon';\n\nexport const URL = {\n SERVER_SENT_EVENTS: 'https://events.kameleoon.com:8110/',\n CLIENT_CONFIGURATION: 'https://sdk-config.kameleoon.eu/',\n};\n"],"mappings":"aAAA,IAAAA,MAAA,CAAAC,OAAA,aAAyCC,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,GAAA,CAAAP,OAAA,CAAAQ,aAAA,CAAAR,OAAA,CAAAS,iBAAA,CAAAT,OAAA,CAAAU,MAAA,CAAAV,OAAA,CAAAW,uBAAA,CAAAX,OAAA,CAAAY,eAAA,aAa5B,CAAAD,uBAAuB,CAAAX,OAAA,CAAAW,uBAAA,CAAG,EAAE,CAAGE,mBAAY,CAACC,MAAM,CAClDN,aAAa,CAAAR,OAAA,CAAAQ,aAAA,CAAG,CAAC,CAAGK,mBAAY,CAACC,MAAM,CACvCL,iBAAiB,CAAAT,OAAA,CAAAS,iBAAA,CAAG,CAAC,IAEtB,CAAAC,MAAM,CAAAV,OAAA,CAAAU,MAAA,UAANA,CAAM,QAAN,CAAAA,CAAM,CAAAK,SAAA,cAANL,CAAM,CAAAM,WAAA,gBAANN,CAAM,CAAAO,UAAA,2BAANP,CAAM,CAAAQ,OAAA,wBAANR,CAAM,CAAAS,aAAA,iBAANT,CAAM,CAAAU,cAAA,mBAANV,CAAM,WASL,CAAAJ,YAA8C,CAAAN,OAAA,CAAAM,YAAA,CAAG,CAC5De,UAAU,CAAE,sBAAsB,CAClCC,UAAU,CAAE,sBAAsB,CAClCC,IAAI,CAAE,gBAAgB,CACtBC,UAAU,CAAE,sBAAsB,CACl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CAAG,CACpD4D,GAAG,CAAE,eAAe,CACpBC,GAAG,CAAE,eAAe,CACpBC,MAAM,CAAE,kBAAkB,CAC1BC,OAAO,CAAE,mBACX,CAAC,CACYhE,WAA+C,CAAAF,OAAA,CAAAE,WAAA,CAAG,CAC7DiE,KAAK,CAAE,QAAQ,CACfH,GAAG,CAAE,MACP,CAAC,CACYpD,eAAe,CAAAZ,OAAA,CAAAY,eAAA,CAAG,gBAAgB,CAElCL,GAAG,CAAAP,OAAA,CAAAO,GAAA,CAAG,CACjB6D,kBAAkB,CAAE,oCAAoC,CACxDC,oBAAoB,CAAE,kCACxB,CAAC"}
@@ -1,3 +1,3 @@
1
1
  export { Requester } from './requester';
2
- export { URL, DEFAULT_REQUEST_TIMEOUT, NUMBER_OF_RETRIES, RETRIES_DELAY, UrlQuery, UrlEventType, UrlParameter, UrlFirstParameter, Header, } from './constants';
2
+ export { URL, DEFAULT_REQUEST_TIMEOUT, NUMBER_OF_RETRIES, DATA_API_DOMAIN, RETRIES_DELAY, UrlQuery, UrlEventType, UrlParameter, UrlFirstParameter, Header, } from './constants';
3
3
  export { HttpMethod, HeadersType, VisitType, TrackParametersType, StaticDataEventType, TrackExperimentParamsType, TrackDataParamsType, IExternalRequestDispatcher, GetVisitorDataResultType, } from './types';
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"DEFAULT_REQUEST_TIMEOUT",{enumerable:!0,get:function(){return _constants.DEFAULT_REQUEST_TIMEOUT}}),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,"IExternalRequestDispatcher",{enumerable:!0,get:function(){return _types.IExternalRequestDispatcher}}),Object.defineProperty(exports,"NUMBER_OF_RETRIES",{enumerable:!0,get:function(){return _constants.NUMBER_OF_RETRIES}}),Object.defineProperty(exports,"RETRIES_DELAY",{enumerable:!0,get:function(){return _constants.RETRIES_DELAY}}),Object.defineProperty(exports,"Requester",{enumerable:!0,get:function(){return _requester.Requester}}),Object.defineProperty(exports,"StaticDataEventType",{enumerable:!0,get:function(){return _types.StaticDataEventType}}),Object.defineProperty(exports,"TrackDataParamsType",{enumerable:!0,get:function(){return _types.TrackDataParamsType}}),Object.defineProperty(exports,"TrackExperimentParamsType",{enumerable:!0,get:function(){return _types.TrackExperimentParamsType}}),Object.defineProperty(exports,"TrackParametersType",{enumerable:!0,get:function(){return _types.TrackParametersType}}),Object.defineProperty(exports,"URL",{enumerable:!0,get:function(){return _constants.URL}}),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,"UrlQuery",{enumerable:!0,get:function(){return _constants.UrlQuery}}),Object.defineProperty(exports,"VisitType",{enumerable:!0,get:function(){return _types.VisitType}});var _requester=require("./requester"),_constants=require("./constants"),_types=require("./types");
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"DATA_API_DOMAIN",{enumerable:!0,get:function(){return _constants.DATA_API_DOMAIN}}),Object.defineProperty(exports,"DEFAULT_REQUEST_TIMEOUT",{enumerable:!0,get:function(){return _constants.DEFAULT_REQUEST_TIMEOUT}}),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,"IExternalRequestDispatcher",{enumerable:!0,get:function(){return _types.IExternalRequestDispatcher}}),Object.defineProperty(exports,"NUMBER_OF_RETRIES",{enumerable:!0,get:function(){return _constants.NUMBER_OF_RETRIES}}),Object.defineProperty(exports,"RETRIES_DELAY",{enumerable:!0,get:function(){return _constants.RETRIES_DELAY}}),Object.defineProperty(exports,"Requester",{enumerable:!0,get:function(){return _requester.Requester}}),Object.defineProperty(exports,"StaticDataEventType",{enumerable:!0,get:function(){return _types.StaticDataEventType}}),Object.defineProperty(exports,"TrackDataParamsType",{enumerable:!0,get:function(){return _types.TrackDataParamsType}}),Object.defineProperty(exports,"TrackExperimentParamsType",{enumerable:!0,get:function(){return _types.TrackExperimentParamsType}}),Object.defineProperty(exports,"TrackParametersType",{enumerable:!0,get:function(){return _types.TrackParametersType}}),Object.defineProperty(exports,"URL",{enumerable:!0,get:function(){return _constants.URL}}),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,"UrlQuery",{enumerable:!0,get:function(){return _constants.UrlQuery}}),Object.defineProperty(exports,"VisitType",{enumerable:!0,get:function(){return _types.VisitType}});var _requester=require("./requester"),_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 {\n URL,\n DEFAULT_REQUEST_TIMEOUT,\n NUMBER_OF_RETRIES,\n RETRIES_DELAY,\n UrlQuery,\n UrlEventType,\n UrlParameter,\n UrlFirstParameter,\n Header,\n} from './constants';\nexport {\n HttpMethod,\n HeadersType,\n VisitType,\n TrackParametersType,\n StaticDataEventType,\n TrackExperimentParamsType,\n TrackDataParamsType,\n IExternalRequestDispatcher,\n GetVisitorDataResultType,\n} from './types';\n"],"mappings":""}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/requester/index.ts"],"sourcesContent":["export { Requester } from './requester';\nexport {\n URL,\n DEFAULT_REQUEST_TIMEOUT,\n NUMBER_OF_RETRIES,\n DATA_API_DOMAIN,\n RETRIES_DELAY,\n UrlQuery,\n UrlEventType,\n UrlParameter,\n UrlFirstParameter,\n Header,\n} from './constants';\nexport {\n HttpMethod,\n HeadersType,\n VisitType,\n TrackParametersType,\n StaticDataEventType,\n TrackExperimentParamsType,\n TrackDataParamsType,\n IExternalRequestDispatcher,\n GetVisitorDataResultType,\n} from './types';\n"],"mappings":""}