@convertcom/js-sdk-rules 1.0.2 → 2.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 (269) hide show
  1. package/README.md +2 -2
  2. package/lib/enums/index.d.ts +26 -0
  3. package/lib/enums/src/bucketing-error.d.ts +9 -0
  4. package/lib/enums/src/conversion-setting-key.d.ts +9 -0
  5. package/lib/enums/src/data-enitites.d.ts +16 -0
  6. package/lib/enums/src/dictionary.d.ts +65 -0
  7. package/lib/enums/src/do-not-track.d.ts +12 -0
  8. package/lib/enums/src/entity-type.d.ts +15 -0
  9. package/lib/enums/src/feature-status.d.ts +10 -0
  10. package/lib/enums/src/goal-data-key.d.ts +11 -0
  11. package/lib/enums/src/log-level.d.ts +14 -0
  12. package/lib/enums/src/log-method.d.ts +14 -0
  13. package/lib/enums/src/project-type.d.ts +10 -0
  14. package/lib/enums/src/rule-error.d.ts +10 -0
  15. package/lib/enums/src/segments/browser-type.d.ts +17 -0
  16. package/lib/enums/src/segments/device-type.d.ts +16 -0
  17. package/lib/enums/src/segments/segments-keys.d.ts +15 -0
  18. package/lib/enums/src/segments/source-type.d.ts +12 -0
  19. package/lib/enums/src/segments/visitor-type.d.ts +10 -0
  20. package/lib/enums/src/system-events.d.ts +22 -0
  21. package/lib/enums/src/variable-types.d.ts +7 -0
  22. package/lib/enums/src/variation-change-type.d.ts +14 -0
  23. package/lib/index.d.ts +10 -10
  24. package/lib/index.js +731 -33
  25. package/lib/index.js.map +1 -1
  26. package/lib/index.min.js +1 -1
  27. package/lib/index.min.js.map +1 -1
  28. package/lib/index.min.mjs +1 -1
  29. package/lib/index.min.mjs.map +1 -1
  30. package/lib/index.mjs +707 -9
  31. package/lib/index.mjs.map +1 -1
  32. package/lib/legacy/index.js +759 -140
  33. package/lib/legacy/index.js.map +1 -1
  34. package/lib/legacy/index.min.js +1 -1
  35. package/lib/legacy/index.min.js.map +1 -1
  36. package/lib/logger/index.d.ts +8 -0
  37. package/lib/logger/src/interfaces/log-client.d.ts +13 -0
  38. package/lib/logger/src/interfaces/log-manager.d.ts +18 -0
  39. package/lib/logger/src/interfaces/log-method-map.d.ts +15 -0
  40. package/lib/logger/src/log-manager.d.ts +64 -0
  41. package/lib/package.json +6 -6
  42. package/lib/rules/index.d.ts +8 -0
  43. package/lib/rules/src/interfaces/rule-manager.d.ts +14 -0
  44. package/lib/rules/src/rule-manager.d.ts +82 -0
  45. package/lib/types/index.d.ts +27 -0
  46. package/lib/types/src/BucketedFeature.d.ts +29 -0
  47. package/lib/types/src/BucketedVariation.d.ts +13 -0
  48. package/lib/types/src/BucketingAllocation.d.ts +10 -0
  49. package/lib/types/src/BucketingAttributes.d.ts +17 -0
  50. package/lib/types/src/BucketingHash.d.ts +11 -0
  51. package/lib/types/src/Config.d.ts +60 -0
  52. package/lib/types/src/ConversionAttributes.d.ts +13 -0
  53. package/lib/types/src/Entity.d.ts +8 -0
  54. package/lib/types/src/GoalData.d.ts +11 -0
  55. package/lib/types/src/IndentityField.d.ts +7 -0
  56. package/lib/types/src/Integration.d.ts +8 -0
  57. package/lib/types/src/LocationAttributes.d.ts +12 -0
  58. package/lib/types/src/Path.d.ts +10 -0
  59. package/lib/types/src/RequireAtLeastOne.d.ts +3 -0
  60. package/lib/types/src/Rule.d.ts +13 -0
  61. package/lib/types/src/SegmentsAttributes.d.ts +9 -0
  62. package/lib/types/src/StoreData.d.ts +13 -0
  63. package/lib/types/src/TrackingEvent.d.ts +14 -0
  64. package/lib/types/src/VariableType.d.ts +8 -0
  65. package/lib/types/src/Visitor.d.ts +12 -0
  66. package/lib/types/src/VisitorsQueue.d.ts +14 -0
  67. package/lib/types/src/config/index.d.ts +192 -0
  68. package/lib/types/src/config/models/Base64Image.d.ts +6 -0
  69. package/lib/types/src/config/models/BaseMatch.d.ts +8 -0
  70. package/lib/types/src/config/models/BaseRule.d.ts +6 -0
  71. package/lib/types/src/config/models/BaseRuleWithBooleanValue.d.ts +7 -0
  72. package/lib/types/src/config/models/BaseRuleWithBrowserNameValue.d.ts +21 -0
  73. package/lib/types/src/config/models/BaseRuleWithCountryCodeValue.d.ts +7 -0
  74. package/lib/types/src/config/models/BaseRuleWithDayOfWeekValue.d.ts +7 -0
  75. package/lib/types/src/config/models/BaseRuleWithExperienceBucketedValue.d.ts +7 -0
  76. package/lib/types/src/config/models/BaseRuleWithGoalTriggeredValue.d.ts +7 -0
  77. package/lib/types/src/config/models/BaseRuleWithHourOfDayValue.d.ts +7 -0
  78. package/lib/types/src/config/models/BaseRuleWithJsCodeValue.d.ts +9 -0
  79. package/lib/types/src/config/models/BaseRuleWithLanguageCodeValue.d.ts +7 -0
  80. package/lib/types/src/config/models/BaseRuleWithMinuteOfHourValue.d.ts +7 -0
  81. package/lib/types/src/config/models/BaseRuleWithNumericValue.d.ts +7 -0
  82. package/lib/types/src/config/models/BaseRuleWithOsValue.d.ts +21 -0
  83. package/lib/types/src/config/models/BaseRuleWithSegmentBucketedValue.d.ts +7 -0
  84. package/lib/types/src/config/models/BaseRuleWithStringValue.d.ts +7 -0
  85. package/lib/types/src/config/models/BaseRuleWithVisitorTypeValue.d.ts +16 -0
  86. package/lib/types/src/config/models/BaseRuleWithWeatherConditionValue.d.ts +34 -0
  87. package/lib/types/src/config/models/BoolMatchRulesTypes.d.ts +6 -0
  88. package/lib/types/src/config/models/BrowserNameMatchRule.d.ts +10 -0
  89. package/lib/types/src/config/models/BrowserNameMatchRulesTypes.d.ts +3 -0
  90. package/lib/types/src/config/models/BucketingEvent.d.ts +15 -0
  91. package/lib/types/src/config/models/ChoiceContainsOptions.d.ts +3 -0
  92. package/lib/types/src/config/models/ChoiceMatchingOptions.d.ts +3 -0
  93. package/lib/types/src/config/models/ClicksElementGoal.d.ts +11 -0
  94. package/lib/types/src/config/models/ClicksElementGoalSettings.d.ts +6 -0
  95. package/lib/types/src/config/models/ClicksLinkGoal.d.ts +11 -0
  96. package/lib/types/src/config/models/ClicksLinkGoalSettings.d.ts +6 -0
  97. package/lib/types/src/config/models/ConfigAudience.d.ts +21 -0
  98. package/lib/types/src/config/models/ConfigAudienceTypes.d.ts +10 -0
  99. package/lib/types/src/config/models/ConfigExperience.d.ts +98 -0
  100. package/lib/types/src/config/models/ConfigFeature.d.ts +22 -0
  101. package/lib/types/src/config/models/ConfigGoal.d.ts +9 -0
  102. package/lib/types/src/config/models/ConfigGoalBase.d.ts +24 -0
  103. package/lib/types/src/config/models/ConfigLocation.d.ts +21 -0
  104. package/lib/types/src/config/models/ConfigProject.d.ts +151 -0
  105. package/lib/types/src/config/models/ConfigResponseData.d.ts +45 -0
  106. package/lib/types/src/config/models/ConfigSegment.d.ts +19 -0
  107. package/lib/types/src/config/models/ConversionEvent.d.ts +30 -0
  108. package/lib/types/src/config/models/CookieMatchRule.d.ts +14 -0
  109. package/lib/types/src/config/models/CookieMatchRulesTypes.d.ts +3 -0
  110. package/lib/types/src/config/models/CountryMatchRule.d.ts +10 -0
  111. package/lib/types/src/config/models/CountryMatchRulesTypes.d.ts +3 -0
  112. package/lib/types/src/config/models/DayOfWeekMatchRule.d.ts +10 -0
  113. package/lib/types/src/config/models/DayOfWeekMatchRulesTypes.d.ts +4 -0
  114. package/lib/types/src/config/models/DomInteractionGoal.d.ts +11 -0
  115. package/lib/types/src/config/models/DomInteractionGoalSettings.d.ts +15 -0
  116. package/lib/types/src/config/models/ErrorData.d.ts +5 -0
  117. package/lib/types/src/config/models/ExperienceBucketedMatchRule.d.ts +9 -0
  118. package/lib/types/src/config/models/ExperienceChange.d.ts +10 -0
  119. package/lib/types/src/config/models/ExperienceChangeAdd.d.ts +10 -0
  120. package/lib/types/src/config/models/ExperienceChangeBase.d.ts +27 -0
  121. package/lib/types/src/config/models/ExperienceChangeCustomCodeData.d.ts +6 -0
  122. package/lib/types/src/config/models/ExperienceChangeCustomCodeDataAdd.d.ts +6 -0
  123. package/lib/types/src/config/models/ExperienceChangeCustomCodeDataBase.d.ts +29 -0
  124. package/lib/types/src/config/models/ExperienceChangeCustomCodeDataUpdate.d.ts +6 -0
  125. package/lib/types/src/config/models/ExperienceChangeCustomCodeDataUpdateNoId.d.ts +5 -0
  126. package/lib/types/src/config/models/ExperienceChangeDefaultCodeData.d.ts +6 -0
  127. package/lib/types/src/config/models/ExperienceChangeDefaultCodeDataAdd.d.ts +6 -0
  128. package/lib/types/src/config/models/ExperienceChangeDefaultCodeDataBase.d.ts +29 -0
  129. package/lib/types/src/config/models/ExperienceChangeDefaultCodeDataUpdate.d.ts +6 -0
  130. package/lib/types/src/config/models/ExperienceChangeDefaultCodeDataUpdateNoId.d.ts +5 -0
  131. package/lib/types/src/config/models/ExperienceChangeDefaultCodeMultipageData.d.ts +6 -0
  132. package/lib/types/src/config/models/ExperienceChangeDefaultCodeMultipageDataAdd.d.ts +6 -0
  133. package/lib/types/src/config/models/ExperienceChangeDefaultCodeMultipageDataBase.d.ts +33 -0
  134. package/lib/types/src/config/models/ExperienceChangeDefaultCodeMultipageDataUpdate.d.ts +6 -0
  135. package/lib/types/src/config/models/ExperienceChangeDefaultCodeMultipageDataUpdateNoId.d.ts +5 -0
  136. package/lib/types/src/config/models/ExperienceChangeDefaultRedirectData.d.ts +6 -0
  137. package/lib/types/src/config/models/ExperienceChangeDefaultRedirectDataAdd.d.ts +6 -0
  138. package/lib/types/src/config/models/ExperienceChangeDefaultRedirectDataBase.d.ts +29 -0
  139. package/lib/types/src/config/models/ExperienceChangeDefaultRedirectDataUpdate.d.ts +6 -0
  140. package/lib/types/src/config/models/ExperienceChangeDefaultRedirectDataUpdateNoId.d.ts +5 -0
  141. package/lib/types/src/config/models/ExperienceChangeFullStackFeature.d.ts +6 -0
  142. package/lib/types/src/config/models/ExperienceChangeFullStackFeatureAdd.d.ts +6 -0
  143. package/lib/types/src/config/models/ExperienceChangeFullStackFeatureBase.d.ts +25 -0
  144. package/lib/types/src/config/models/ExperienceChangeFullStackFeatureUpdate.d.ts +6 -0
  145. package/lib/types/src/config/models/ExperienceChangeFullStackFeatureUpdateNoId.d.ts +5 -0
  146. package/lib/types/src/config/models/ExperienceChangeId.d.ts +9 -0
  147. package/lib/types/src/config/models/ExperienceChangeIdReadOnly.d.ts +9 -0
  148. package/lib/types/src/config/models/ExperienceChangeRichStructureData.d.ts +6 -0
  149. package/lib/types/src/config/models/ExperienceChangeRichStructureDataAdd.d.ts +6 -0
  150. package/lib/types/src/config/models/ExperienceChangeRichStructureDataBase.d.ts +16 -0
  151. package/lib/types/src/config/models/ExperienceChangeRichStructureDataUpdate.d.ts +6 -0
  152. package/lib/types/src/config/models/ExperienceChangeRichStructureDataUpdateNoId.d.ts +5 -0
  153. package/lib/types/src/config/models/ExperienceChangeUpdate.d.ts +10 -0
  154. package/lib/types/src/config/models/ExperienceChangeUpdateNoId.d.ts +10 -0
  155. package/lib/types/src/config/models/ExperienceIntegrationBaidu.d.ts +7 -0
  156. package/lib/types/src/config/models/ExperienceIntegrationBase.d.ts +10 -0
  157. package/lib/types/src/config/models/ExperienceIntegrationClicktale.d.ts +2 -0
  158. package/lib/types/src/config/models/ExperienceIntegrationClicky.d.ts +2 -0
  159. package/lib/types/src/config/models/ExperienceIntegrationCnzz.d.ts +7 -0
  160. package/lib/types/src/config/models/ExperienceIntegrationCrazyegg.d.ts +9 -0
  161. package/lib/types/src/config/models/ExperienceIntegrationEconda.d.ts +2 -0
  162. package/lib/types/src/config/models/ExperienceIntegrationEulerian.d.ts +2 -0
  163. package/lib/types/src/config/models/ExperienceIntegrationGA3.d.ts +9 -0
  164. package/lib/types/src/config/models/ExperienceIntegrationGA4.d.ts +8 -0
  165. package/lib/types/src/config/models/ExperienceIntegrationGA4Base.d.ts +4 -0
  166. package/lib/types/src/config/models/ExperienceIntegrationGAServing.d.ts +3 -0
  167. package/lib/types/src/config/models/ExperienceIntegrationGoogleAnalytics.d.ts +3 -0
  168. package/lib/types/src/config/models/ExperienceIntegrationGosquared.d.ts +2 -0
  169. package/lib/types/src/config/models/ExperienceIntegrationHeapanalytics.d.ts +2 -0
  170. package/lib/types/src/config/models/ExperienceIntegrationHotjar.d.ts +2 -0
  171. package/lib/types/src/config/models/ExperienceIntegrationMixpanel.d.ts +2 -0
  172. package/lib/types/src/config/models/ExperienceIntegrationMouseflow.d.ts +2 -0
  173. package/lib/types/src/config/models/ExperienceIntegrationPiwik.d.ts +7 -0
  174. package/lib/types/src/config/models/ExperienceIntegrationSegmentio.d.ts +2 -0
  175. package/lib/types/src/config/models/ExperienceIntegrationSitecatalyst.d.ts +7 -0
  176. package/lib/types/src/config/models/ExperienceIntegrationWoopra.d.ts +2 -0
  177. package/lib/types/src/config/models/ExperienceIntegrationYsance.d.ts +7 -0
  178. package/lib/types/src/config/models/ExperienceTypes.d.ts +8 -0
  179. package/lib/types/src/config/models/ExperienceVariationConfig.d.ts +30 -0
  180. package/lib/types/src/config/models/Extra.d.ts +4 -0
  181. package/lib/types/src/config/models/FeatureVariableItemData.d.ts +25 -0
  182. package/lib/types/src/config/models/GA_Settings.d.ts +3 -0
  183. package/lib/types/src/config/models/GA_SettingsBase.d.ts +6 -0
  184. package/lib/types/src/config/models/GaGoal.d.ts +11 -0
  185. package/lib/types/src/config/models/GaGoalSettings.d.ts +6 -0
  186. package/lib/types/src/config/models/GenericBoolKeyValueMatchRule.d.ts +11 -0
  187. package/lib/types/src/config/models/GenericBoolKeyValueMatchRulesTypes.d.ts +3 -0
  188. package/lib/types/src/config/models/GenericBoolMatchRule.d.ts +10 -0
  189. package/lib/types/src/config/models/GenericKey.d.ts +6 -0
  190. package/lib/types/src/config/models/GenericNumericKeyValueMatchRule.d.ts +11 -0
  191. package/lib/types/src/config/models/GenericNumericKeyValueMatchRulesTypes.d.ts +3 -0
  192. package/lib/types/src/config/models/GenericNumericMatchRule.d.ts +10 -0
  193. package/lib/types/src/config/models/GenericSetMatchRule.d.ts +9 -0
  194. package/lib/types/src/config/models/GenericTextKeyValueMatchRule.d.ts +11 -0
  195. package/lib/types/src/config/models/GenericTextKeyValueMatchRulesTypes.d.ts +3 -0
  196. package/lib/types/src/config/models/GenericTextMatchRule.d.ts +10 -0
  197. package/lib/types/src/config/models/GoalTriggeredMatchRule.d.ts +10 -0
  198. package/lib/types/src/config/models/GoalTriggeredMatchRulesTypes.d.ts +3 -0
  199. package/lib/types/src/config/models/GoalTypes.d.ts +10 -0
  200. package/lib/types/src/config/models/HourOfDayMatchRule.d.ts +10 -0
  201. package/lib/types/src/config/models/HourOfDayMatchRulesTypes.d.ts +4 -0
  202. package/lib/types/src/config/models/IntegrationGA3.d.ts +12 -0
  203. package/lib/types/src/config/models/IntegrationGA4.d.ts +7 -0
  204. package/lib/types/src/config/models/IntegrationGA4Base.d.ts +12 -0
  205. package/lib/types/src/config/models/IntegrationProvider.d.ts +23 -0
  206. package/lib/types/src/config/models/JsConditionMatchRule.d.ts +10 -0
  207. package/lib/types/src/config/models/JsConditionMatchRulesTypes.d.ts +3 -0
  208. package/lib/types/src/config/models/KeyValueMatchRulesTypes.d.ts +4 -0
  209. package/lib/types/src/config/models/LanguageMatchRule.d.ts +10 -0
  210. package/lib/types/src/config/models/LanguageMatchRulesTypes.d.ts +3 -0
  211. package/lib/types/src/config/models/LocationTrigger.d.ts +5 -0
  212. package/lib/types/src/config/models/LocationTriggerBase.d.ts +14 -0
  213. package/lib/types/src/config/models/LocationTriggerCallback.d.ts +13 -0
  214. package/lib/types/src/config/models/LocationTriggerDomChange.d.ts +17 -0
  215. package/lib/types/src/config/models/LocationTriggerManual.d.ts +9 -0
  216. package/lib/types/src/config/models/LocationTriggerUrlChange.d.ts +9 -0
  217. package/lib/types/src/config/models/MinuteOfHourMatchRule.d.ts +10 -0
  218. package/lib/types/src/config/models/MinuteOfHourMatchRulesTypes.d.ts +4 -0
  219. package/lib/types/src/config/models/NoSettingsGoal.d.ts +11 -0
  220. package/lib/types/src/config/models/NumericMatchRulesTypes.d.ts +8 -0
  221. package/lib/types/src/config/models/NumericMatchingOptions.d.ts +5 -0
  222. package/lib/types/src/config/models/OnlyCount.d.ts +7 -0
  223. package/lib/types/src/config/models/OsMatchRule.d.ts +10 -0
  224. package/lib/types/src/config/models/OsMatchRulesTypes.d.ts +3 -0
  225. package/lib/types/src/config/models/PageNumber.d.ts +9 -0
  226. package/lib/types/src/config/models/Pagination.d.ts +18 -0
  227. package/lib/types/src/config/models/ProjectGASettingsBase.d.ts +7 -0
  228. package/lib/types/src/config/models/ProjectIntegrationGA3.d.ts +3 -0
  229. package/lib/types/src/config/models/ProjectIntegrationGA4.d.ts +8 -0
  230. package/lib/types/src/config/models/ResultsPerPage.d.ts +10 -0
  231. package/lib/types/src/config/models/RevenueGoal.d.ts +11 -0
  232. package/lib/types/src/config/models/RevenueGoalSettings.d.ts +25 -0
  233. package/lib/types/src/config/models/RuleElement.d.ts +20 -0
  234. package/lib/types/src/config/models/RuleElementNoUrl.d.ts +20 -0
  235. package/lib/types/src/config/models/RuleObject.d.ts +20 -0
  236. package/lib/types/src/config/models/RuleObjectNoUrl.d.ts +20 -0
  237. package/lib/types/src/config/models/RulesTypes.d.ts +17 -0
  238. package/lib/types/src/config/models/ScrollPercentageGoal.d.ts +11 -0
  239. package/lib/types/src/config/models/ScrollPercentageGoalSettings.d.ts +6 -0
  240. package/lib/types/src/config/models/SegmentBucketedMatchRule.d.ts +10 -0
  241. package/lib/types/src/config/models/SegmentBucketedMatchRulesTypes.d.ts +3 -0
  242. package/lib/types/src/config/models/SendTrackingEventsRequestData.d.ts +39 -0
  243. package/lib/types/src/config/models/SetMatchingOptions.d.ts +3 -0
  244. package/lib/types/src/config/models/SortDirection.d.ts +21 -0
  245. package/lib/types/src/config/models/SubmitsFormGoal.d.ts +11 -0
  246. package/lib/types/src/config/models/SubmitsFormGoalSettings.d.ts +6 -0
  247. package/lib/types/src/config/models/SuccessData.d.ts +4 -0
  248. package/lib/types/src/config/models/TextMatchRulesTypes.d.ts +23 -0
  249. package/lib/types/src/config/models/TextMatchingOptions.d.ts +7 -0
  250. package/lib/types/src/config/models/UTC_Offset.d.ts +4 -0
  251. package/lib/types/src/config/models/UpdateExperienceChangeRequestData.d.ts +2 -0
  252. package/lib/types/src/config/models/VariationStatuses.d.ts +7 -0
  253. package/lib/types/src/config/models/VisitorSegments.d.ts +78 -0
  254. package/lib/types/src/config/models/VisitorTrackingEvents.d.ts +21 -0
  255. package/lib/types/src/config/models/VisitorTypeMatchRule.d.ts +10 -0
  256. package/lib/types/src/config/models/VisitorTypeMatchRulesTypes.d.ts +3 -0
  257. package/lib/types/src/config/models/WeatherConditionMatchRule.d.ts +10 -0
  258. package/lib/types/src/config/models/WeatherConditionMatchRulesTypes.d.ts +3 -0
  259. package/lib/types/src/config/models/WeatherConditions.d.ts +30 -0
  260. package/lib/utils/index.d.ts +14 -0
  261. package/lib/utils/src/array-utils.d.ts +11 -0
  262. package/lib/utils/src/comparisons.d.ts +22 -0
  263. package/lib/utils/src/data-store.d.ts +39 -0
  264. package/lib/utils/src/file-logger.d.ts +40 -0
  265. package/lib/utils/src/http-client.d.ts +115 -0
  266. package/lib/utils/src/object-utils.d.ts +35 -0
  267. package/lib/utils/src/string-utils.d.ts +20 -0
  268. package/lib/utils/src/types-utils.d.ts +12 -0
  269. package/package.json +35 -31
package/README.md CHANGED
@@ -4,8 +4,8 @@
4
4
 
5
5
  ## About
6
6
 
7
- This repository contains the **Rules Manager** dependency for **JavaScript SDK** needed to integrate Convert.com's **Fullstack Product (feature tests, feature flags, feature rollouts)** inside third-party apps. This is maintained by the Convert.com team.
7
+ This repository contains the **Rules Manager** dependency for the **JavaScript SDK** needed to integrate Convert.com's **Fullstack Product (feature tests, feature flags, feature rollouts)** inside third-party apps. This is maintained by the Convert.com team.
8
8
 
9
9
  ## Credits
10
10
 
11
- Copyright(c) 2023 Convert Insights, Inc.
11
+ Copyright (c) 2023 Convert Insights, Inc.
@@ -0,0 +1,26 @@
1
+ /*!
2
+ * Convert JS SDK test
3
+ * Version 1.0.0
4
+ * Copyright(c) 2020 Convert Insights, Inc
5
+ * License Apache-2.0
6
+ */
7
+ export * from './src/bucketing-error';
8
+ export * from './src/conversion-setting-key';
9
+ export * from './src/data-enitites';
10
+ export * from './src/dictionary';
11
+ export * from './src/do-not-track';
12
+ export * from './src/entity-type';
13
+ export * from './src/feature-status';
14
+ export * from './src/goal-data-key';
15
+ export * from './src/log-level';
16
+ export * from './src/log-method';
17
+ export * from './src/project-type';
18
+ export * from './src/rule-error';
19
+ export * from './src/system-events';
20
+ export * from './src/variable-types';
21
+ export * from './src/variation-change-type';
22
+ export * from './src/segments/browser-type';
23
+ export * from './src/segments/device-type';
24
+ export * from './src/segments/segments-keys';
25
+ export * from './src/segments/source-type';
26
+ export * from './src/segments/visitor-type';
@@ -0,0 +1,9 @@
1
+ /*!
2
+ * Convert JS SDK
3
+ * Version 1.0.0
4
+ * Copyright(c) 2020 Convert Insights, Inc
5
+ * License Apache-2.0
6
+ */
7
+ export declare enum BucketingError {
8
+ VARIAION_NOT_DECIDED = "convert.com_variation_not_decided"
9
+ }
@@ -0,0 +1,9 @@
1
+ /*!
2
+ * Convert JS SDK
3
+ * Version 1.0.0
4
+ * Copyright(c) 2020 Convert Insights, Inc
5
+ * License Apache-2.0
6
+ */
7
+ export declare enum ConversionSettingKey {
8
+ FORCE_MULTIPLE_TRANSACTIONS = "forceMultipleTransactions"
9
+ }
@@ -0,0 +1,16 @@
1
+ /*!
2
+ * Convert JS SDK
3
+ * Version 1.0.0
4
+ * Copyright(c) 2020 Convert Insights, Inc
5
+ * License Apache-2.0
6
+ */
7
+ export declare const DATA_ENTITIES: string[];
8
+ export declare const DATA_ENTITIES_MAP: {
9
+ goal: string;
10
+ audience: string;
11
+ location: string;
12
+ segment: string;
13
+ experience: string;
14
+ variation: string;
15
+ feature: string;
16
+ };
@@ -0,0 +1,65 @@
1
+ /*!
2
+ * Convert JS SDK
3
+ * Version 1.0.0
4
+ * Copyright(c) 2020 Convert Insights, Inc
5
+ * License Apache-2.0
6
+ */
7
+ export declare const ERROR_MESSAGES: {
8
+ SDK_KEY_MISSING: string;
9
+ DATA_OBJECT_MISSING: string;
10
+ CONFIG_DATA_NOT_VALID: string;
11
+ SDK_OR_DATA_OBJECT_REQUIRED: string;
12
+ RULE_NOT_VALID: string;
13
+ RULE_DATA_NOT_VALID: string;
14
+ RULE_MATCH_TYPE_NOT_SUPPORTED: string;
15
+ RULE_ERROR: string;
16
+ DATA_STORE_NOT_VALID: string;
17
+ VISITOR_ID_REQUIRED: string;
18
+ GOAL_DATA_NOT_VALID: string;
19
+ UNABLE_TO_SELECT_BUCKET_FOR_VISITOR: string;
20
+ UNABLE_TO_PERFORM_NETWORK_REQUEST: string;
21
+ UNSUPPORTED_RESPONSE_TYPE: string;
22
+ };
23
+ export declare const MESSAGES: {
24
+ CONFIG_DATA_UPDATED: string;
25
+ CORE_CONSTRUCTOR: string;
26
+ CORE_INITIALIZED: string;
27
+ EXPERIENCE_CONSTRUCTOR: string;
28
+ EXPERIENCE_NOT_FOUND: string;
29
+ EXPERIENCE_RULES_MATCHED: string;
30
+ VARIATIONS_NOT_FOUND: string;
31
+ VARIATION_CHANGE_NOT_SUPPORTED: string;
32
+ FEATURE_CONSTRUCTOR: string;
33
+ FEATURE_NOT_FOUND: string;
34
+ FEATURE_VARIABLES_NOT_FOUND: string;
35
+ FEATURE_VARIABLES_TYPE_NOT_FOUND: string;
36
+ BUCKETING_CONSTRUCTOR: string;
37
+ DATA_CONSTRUCTOR: string;
38
+ RULE_CONSTRUCTOR: string;
39
+ PROCESSING_ENTITY: string;
40
+ LOCATION_MATCH: string;
41
+ LOCATION_NOT_MATCH: string;
42
+ LOCATION_NOT_RESTRICTED: string;
43
+ AUDIENCE_MATCH: string;
44
+ AUDIENCE_NOT_MATCH: string;
45
+ NON_PERMANENT_AUDIENCE_NOT_RESTRICTED: string;
46
+ AUDIENCE_NOT_RESTRICTED: string;
47
+ SEGMENTATION_MATCH: string;
48
+ SEGMENTATION_NOT_RESTRICTED: string;
49
+ RULE_NOT_MATCH: string;
50
+ RULE_MATCH: string;
51
+ RULE_MATCH_AND: string;
52
+ RULE_MATCH_START: string;
53
+ LOCATION_ACTIVATED: string;
54
+ LOCATION_DEACTIVATED: string;
55
+ BUCKETED_VISITOR_FOUND: string;
56
+ BUCKETED_VISITOR_FORCED: string;
57
+ BUCKETED_VISITOR: string;
58
+ GOAL_NOT_FOUND: string;
59
+ GOAL_RULE_NOT_MATCH: string;
60
+ GOAL_FOUND: string;
61
+ SEGMENTS_NOT_FOUND: string;
62
+ SEGMENTS_RULE_NOT_MATCH: string;
63
+ CUSTOM_SEGMENTS_KEY_FOUND: string;
64
+ SEND_BEACON_SUCCESS: string;
65
+ };
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * Convert JS SDK
3
+ * Version 1.0.0
4
+ * Copyright(c) 2020 Convert Insights, Inc
5
+ * License Apache-2.0
6
+ */
7
+ export declare enum DoNotTrack {
8
+ OFF = "OFF",
9
+ EU_ONLY = "EU ONLY",
10
+ EEA_ONLY = "EEA ONLY",
11
+ WORLDWIDE = "Worldwide"
12
+ }
@@ -0,0 +1,15 @@
1
+ /*!
2
+ * Convert JS SDK
3
+ * Version 1.0.0
4
+ * Copyright(c) 2020 Convert Insights, Inc
5
+ * License Apache-2.0
6
+ */
7
+ export declare enum EntityType {
8
+ AUDIENCE = "audience",
9
+ LOCATION = "location",
10
+ SEGMENT = "segment",
11
+ FEATURE = "feature",
12
+ GOAL = "goal",
13
+ EXPERIENCE = "experience",
14
+ VARIATION = "variation"
15
+ }
@@ -0,0 +1,10 @@
1
+ /*!
2
+ * Convert JS SDK
3
+ * Version 1.0.0
4
+ * Copyright(c) 2020 Convert Insights, Inc
5
+ * License Apache-2.0
6
+ */
7
+ export declare enum FeatureStatus {
8
+ ENABLED = "enabled",
9
+ DISABLED = "disabled"
10
+ }
@@ -0,0 +1,11 @@
1
+ /*!
2
+ * Convert JS SDK
3
+ * Version 1.0.0
4
+ * Copyright(c) 2020 Convert Insights, Inc
5
+ * License Apache-2.0
6
+ */
7
+ export declare enum GoalDataKey {
8
+ AMOUNT = "amount",
9
+ PRODUCTS_COUNT = "productsCount",
10
+ TRANSACTION_ID = "transactionId"
11
+ }
@@ -0,0 +1,14 @@
1
+ /*!
2
+ * Convert JS SDK
3
+ * Version 1.0.0
4
+ * Copyright(c) 2020 Convert Insights, Inc
5
+ * License Apache-2.0
6
+ */
7
+ export declare enum LogLevel {
8
+ TRACE = 0,
9
+ DEBUG = 1,
10
+ INFO = 2,
11
+ WARN = 3,
12
+ ERROR = 4,
13
+ SILENT = 5
14
+ }
@@ -0,0 +1,14 @@
1
+ /*!
2
+ * Convert JS SDK
3
+ * Version 1.0.0
4
+ * Copyright(c) 2020 Convert Insights, Inc
5
+ * License Apache-2.0
6
+ */
7
+ export declare enum LogMethod {
8
+ LOG = "log",
9
+ TRACE = "trace",
10
+ DEBUG = "debug",
11
+ INFO = "info",
12
+ WARN = "warn",
13
+ ERROR = "error"
14
+ }
@@ -0,0 +1,10 @@
1
+ /*!
2
+ * Convert JS SDK
3
+ * Version 1.0.0
4
+ * Copyright(c) 2020 Convert Insights, Inc
5
+ * License Apache-2.0
6
+ */
7
+ export declare enum ProjectType {
8
+ WEB = "web",
9
+ FULLSTACK = "fullstack"
10
+ }
@@ -0,0 +1,10 @@
1
+ /*!
2
+ * Convert JS SDK
3
+ * Version 1.0.0
4
+ * Copyright(c) 2020 Convert Insights, Inc
5
+ * License Apache-2.0
6
+ */
7
+ export declare enum RuleError {
8
+ NO_DATA_FOUND = "convert.com_no_data_found",
9
+ NEED_MORE_DATA = "convert.com_need_more_data"
10
+ }
@@ -0,0 +1,17 @@
1
+ /*!
2
+ * Convert JS SDK
3
+ * Version 1.0.0
4
+ * Copyright(c) 2020 Convert Insights, Inc
5
+ * License Apache-2.0
6
+ */
7
+ export declare enum BrowserType {
8
+ IE = "IE",
9
+ CH = "CH",
10
+ FF = "FF",
11
+ OP = "OP",
12
+ SF = "SF",
13
+ EDG = "EDG",
14
+ MO = "MO",
15
+ NS = "NS",
16
+ OTH = "OTH"
17
+ }
@@ -0,0 +1,16 @@
1
+ /*!
2
+ * Convert JS SDK
3
+ * Version 1.0.0
4
+ * Copyright(c) 2020 Convert Insights, Inc
5
+ * License Apache-2.0
6
+ */
7
+ export declare enum DeviceType {
8
+ ALLPH = "ALLPH",
9
+ IPH = "IPH",
10
+ OTHPH = "OTHPH",
11
+ ALLTAB = "ALLTAB",
12
+ IPAD = "IPAD",
13
+ OTHTAB = "OTHTAB",
14
+ DESK = "DESK",
15
+ OTHDEV = "OTHDEV"
16
+ }
@@ -0,0 +1,15 @@
1
+ /*!
2
+ * Convert JS SDK
3
+ * Version 1.0.0
4
+ * Copyright(c) 2020 Convert Insights, Inc
5
+ * License Apache-2.0
6
+ */
7
+ export declare enum SegmentsKeys {
8
+ COUNTRY = "country",
9
+ BROWSER = "browser",
10
+ DEVICES = "devices",
11
+ SOURCE = "source",
12
+ CAMPAIGN = "campaign",
13
+ VISITOR_TYPE = "visitorType",
14
+ CUSTOM_SEGMENTS = "customSegments"
15
+ }
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * Convert JS SDK
3
+ * Version 1.0.0
4
+ * Copyright(c) 2020 Convert Insights, Inc
5
+ * License Apache-2.0
6
+ */
7
+ export declare enum SourceType {
8
+ CAMPAIGN = "campaign",
9
+ SEARCH = "search",
10
+ REFERRAL = "referral",
11
+ DIRECT = "direct"
12
+ }
@@ -0,0 +1,10 @@
1
+ /*!
2
+ * Convert JS SDK
3
+ * Version 1.0.0
4
+ * Copyright(c) 2020 Convert Insights, Inc
5
+ * License Apache-2.0
6
+ */
7
+ export declare enum VisitorType {
8
+ NEW = "new",
9
+ RETURNING = "returning"
10
+ }
@@ -0,0 +1,22 @@
1
+ /*!
2
+ * Convert JS SDK
3
+ * Version 1.0.0
4
+ * Copyright(c) 2020 Convert Insights, Inc
5
+ * License Apache-2.0
6
+ */
7
+ /**
8
+ * SDK system events. Possible values: 'ready' | 'queue-released'
9
+ * or custom visitor's event
10
+ */
11
+ export declare enum SystemEvents {
12
+ READY = "ready",
13
+ CONFIG_UPDATED = "config.updated",
14
+ API_QUEUE_RELEASED = "api.queue.released",
15
+ BUCKETING = "bucketing",
16
+ CONVERSION = "conversion",
17
+ SEGMENTS = "segments",
18
+ LOCATION_ACTIVATED = "location.activated",
19
+ LOCATION_DEACTIVATED = "location.deactivated",
20
+ AUDIENCES = "audiences",
21
+ DATA_STORE_QUEUE_RELEASED = "datastore.queue.released"
22
+ }
@@ -0,0 +1,7 @@
1
+ /*!
2
+ * Convert JS SDK
3
+ * Version 1.0.0
4
+ * Copyright(c) 2020 Convert Insights, Inc
5
+ * License Apache-2.0
6
+ */
7
+ export declare const VARIABLE_TYPES: readonly ["boolean", "float", "json", "integer", "string"];
@@ -0,0 +1,14 @@
1
+ /*!
2
+ * Convert JS SDK
3
+ * Version 1.0.0
4
+ * Copyright(c) 2020 Convert Insights, Inc
5
+ * License Apache-2.0
6
+ */
7
+ export declare enum VariationChangeType {
8
+ RICH_STRUCTURE = "richStructure",
9
+ CUSTOM_CODE = "customCode",
10
+ DEFAULT_CODE = "defaultCode",
11
+ DEFAULT_CODE_MULTIPAGE = "defaultCodeMultipage",
12
+ DEFAULT_REDIRECT = "defaultRedirect",
13
+ FULLSTACK_FEATURE = "fullStackFeature"
14
+ }
package/lib/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { RuleSet, Rule, Config } from '@convertcom/js-sdk-types';
2
- import { RuleError } from '@convertcom/js-sdk-enums';
3
- import { LogManagerInterface } from '@convertcom/js-sdk-logger';
1
+ import { RuleObject, RuleElement, Config } from './types';
2
+ import { RuleError } from './enums';
3
+ import { LogManagerInterface } from './logger';
4
4
 
5
5
  /*!
6
6
  * Convert JS SDK
@@ -12,8 +12,8 @@ import { LogManagerInterface } from '@convertcom/js-sdk-logger';
12
12
  interface RuleManagerInterface {
13
13
  comparisonProcessor: Record<string, any>;
14
14
  getComparisonProcessorMethods(): Array<string>;
15
- isRuleMatched(data: Record<string, any>, ruleSet: RuleSet, logEntry?: string): boolean | RuleError;
16
- isValidRule(rule: Rule): boolean;
15
+ isRuleMatched(data: Record<string, any>, ruleSet: RuleObject, logEntry?: string): boolean | RuleError;
16
+ isValidRule(rule: RuleElement): boolean;
17
17
  }
18
18
 
19
19
  /**
@@ -53,16 +53,16 @@ declare class RuleManager implements RuleManagerInterface {
53
53
  /**
54
54
  * Check input data matching to rule set
55
55
  * @param {Record<string, any>} data Single value or key-value data set to compare
56
- * @param {RuleSet} ruleSet
56
+ * @param {RuleObject} ruleSet
57
57
  * @return {boolean | RuleError}
58
58
  */
59
- isRuleMatched(data: Record<string, any>, ruleSet: RuleSet, logEntry?: string): boolean | RuleError;
59
+ isRuleMatched(data: Record<string, any>, ruleSet: RuleObject, logEntry?: string): boolean | RuleError;
60
60
  /**
61
61
  * Check is rule object valid
62
- * @param {Rule} rule
62
+ * @param {RuleElement} rule
63
63
  * @return {boolean}
64
64
  */
65
- isValidRule(rule: Rule): boolean;
65
+ isValidRule(rule: RuleElement): boolean;
66
66
  /**
67
67
  * Process AND block of rule set. Return first false if found
68
68
  * @param {Record<string, any>} data Single value or key-value data set to compare
@@ -82,7 +82,7 @@ declare class RuleManager implements RuleManagerInterface {
82
82
  /**
83
83
  * Process single rule item
84
84
  * @param {Record<string, any>} data Single value or key-value data set to compare
85
- * @param {Rule} rule A single rule to compare
85
+ * @param {RuleElement} rule A single rule to compare
86
86
  * @return {boolean | RuleError} Comparison result
87
87
  * @private
88
88
  */