@kameleoon/react-sdk 7.6.1 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/README.md +3 -7
  2. package/dist/KameleoonContext.js +1 -1
  3. package/dist/KameleoonContext.js.map +1 -1
  4. package/dist/KameleoonProvider.js +1 -3
  5. package/dist/KameleoonProvider.js.map +1 -1
  6. package/dist/eventSource/browserEventSource.js +1 -6
  7. package/dist/eventSource/browserEventSource.js.map +1 -1
  8. package/dist/eventSource/nativeEventSource.js +1 -1
  9. package/dist/eventSource/nativeEventSource.js.map +1 -1
  10. package/dist/index.d.ts +3 -6
  11. package/dist/index.js +1 -1
  12. package/dist/index.js.map +1 -1
  13. package/dist/kameleoonClient.d.ts +3 -2
  14. package/dist/kameleoonClient.js +1 -5
  15. package/dist/kameleoonClient.js.map +1 -1
  16. package/dist/kameleoonUtils/browserUtils.js +1 -14
  17. package/dist/kameleoonUtils/browserUtils.js.map +1 -1
  18. package/dist/kameleoonUtils/nativeUtils.js +1 -12
  19. package/dist/kameleoonUtils/nativeUtils.js.map +1 -1
  20. package/dist/requester.js +1 -1
  21. package/dist/requester.js.map +1 -1
  22. package/dist/storage/localStorage.js +1 -1
  23. package/dist/storage/localStorage.js.map +1 -1
  24. package/dist/storage/nativeStorage.js +1 -1
  25. package/dist/storage/nativeStorage.js.map +1 -1
  26. package/dist/types.d.ts +9 -0
  27. package/dist/types.js +2 -0
  28. package/dist/types.js.map +1 -0
  29. package/dist/useAddData.d.ts +1 -1
  30. package/dist/useAddData.js +1 -5
  31. package/dist/useAddData.js.map +1 -1
  32. package/dist/useBrowserVisitorCode.js +1 -5
  33. package/dist/useBrowserVisitorCode.js.map +1 -1
  34. package/dist/useConfigurationUpdate.d.ts +1 -1
  35. package/dist/useConfigurationUpdate.js +1 -5
  36. package/dist/useConfigurationUpdate.js.map +1 -1
  37. package/dist/useEngineTrackingCode.js.map +1 -1
  38. package/dist/useFeatureFlagActive.d.ts +2 -2
  39. package/dist/useFeatureFlagActive.js +1 -5
  40. package/dist/useFeatureFlagActive.js.map +1 -1
  41. package/dist/useFeatureFlagVariationKey.d.ts +2 -2
  42. package/dist/useFeatureFlagVariationKey.js +1 -5
  43. package/dist/useFeatureFlagVariationKey.js.map +1 -1
  44. package/dist/useFeatureFlags.d.ts +1 -1
  45. package/dist/useFeatureFlags.js +1 -5
  46. package/dist/useFeatureFlags.js.map +1 -1
  47. package/dist/useFeatureVariable.d.ts +4 -4
  48. package/dist/useFeatureVariable.js +1 -5
  49. package/dist/useFeatureVariable.js.map +1 -1
  50. package/dist/useFeatureVariables.d.ts +25 -0
  51. package/dist/useFeatureVariables.js +2 -0
  52. package/dist/useFeatureVariables.js.map +1 -0
  53. package/dist/useFlush.d.ts +1 -1
  54. package/dist/useFlush.js +1 -5
  55. package/dist/useFlush.js.map +1 -1
  56. package/dist/useInitialize.js +1 -5
  57. package/dist/useInitialize.js.map +1 -1
  58. package/dist/useKameleoon.js +1 -6
  59. package/dist/useKameleoon.js.map +1 -1
  60. package/dist/useNativeVisitorCode.js +1 -5
  61. package/dist/useNativeVisitorCode.js.map +1 -1
  62. package/dist/useRemoteData.js +1 -5
  63. package/dist/useRemoteData.js.map +1 -1
  64. package/dist/useRemoteVisitorData.d.ts +5 -5
  65. package/dist/useRemoteVisitorData.js +1 -5
  66. package/dist/useRemoteVisitorData.js.map +1 -1
  67. package/dist/useTrackConversion.js +1 -5
  68. package/dist/useTrackConversion.js.map +1 -1
  69. package/dist/useVisitorFeatureFlags.d.ts +1 -1
  70. package/dist/useVisitorFeatureFlags.js +1 -5
  71. package/dist/useVisitorFeatureFlags.js.map +1 -1
  72. package/dist/useVisitorWarehouseAudience.js +1 -5
  73. package/dist/useVisitorWarehouseAudience.js.map +1 -1
  74. package/package.json +2 -2
  75. package/dist/useExperimentVariationData.d.ts +0 -21
  76. package/dist/useExperimentVariationData.js +0 -6
  77. package/dist/useExperimentVariationData.js.map +0 -1
  78. package/dist/useExperiments.d.ts +0 -18
  79. package/dist/useExperiments.js +0 -6
  80. package/dist/useExperiments.js.map +0 -1
  81. package/dist/useFlushData.d.ts +0 -19
  82. package/dist/useFlushData.js +0 -4
  83. package/dist/useFlushData.js.map +0 -1
  84. package/dist/useTriggerExperiment.d.ts +0 -24
  85. package/dist/useTriggerExperiment.js +0 -6
  86. package/dist/useTriggerExperiment.js.map +0 -1
  87. package/dist/useVisitorExperiments.d.ts +0 -22
  88. package/dist/useVisitorExperiments.js +0 -6
  89. package/dist/useVisitorExperiments.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"localStorage.js","names":["_javascriptSdkCore","require","Object","defineProperty","exports","value","LocalStorageConstructor","_typeof","a","Symbol","iterator","constructor","prototype","_defineProperty","b","c","_toPropertyKey","enumerable","configurable","writable","_classCallCheck","TypeError","_defineProperties","d","length","key","_createClass","_toPrimitive","toPrimitive","call","String","Number","initialize","storage","LocalStorage","storageKey","get","read","data","localStorage","getItem","parse","Err","KameleoonError","KameleoonException","StorageRead","write","setItem","JSON","stringify","Ok","err","StorageWrite","result","StorageParse"],"sources":["../../src/storage/localStorage.ts"],"sourcesContent":["import {\n Ok,\n Err,\n Result,\n KameleoonError,\n IExternalStorage,\n KameleoonException,\n KameleoonStorageKey,\n IExternalStorageConstructor,\n StorageDataType,\n} from '@kameleoon/javascript-sdk-core';\n\nexport class LocalStorageConstructor implements IExternalStorageConstructor {\n public initialize<T extends StorageDataType>(\n key: KameleoonStorageKey,\n ): IExternalStorage<T> {\n const storage = new LocalStorage<T>(key);\n\n return storage;\n }\n}\n\nclass LocalStorage<T> implements IExternalStorage<T> {\n private storageKey: KameleoonStorageKey;\n\n constructor(key: KameleoonStorageKey) {\n this.storageKey = key;\n }\n\n get key(): KameleoonStorageKey {\n return this.storageKey;\n }\n\n public read(): Result<T, KameleoonError> {\n const data = localStorage.getItem(this.storageKey);\n\n if (!data) {\n return Err(\n new KameleoonError(KameleoonException.StorageRead, this.storageKey),\n );\n }\n\n return this.parse(data);\n }\n\n public write(data: T): Result<void, KameleoonError> {\n try {\n localStorage.setItem(this.storageKey, JSON.stringify(data));\n\n return Ok();\n } catch (err) {\n return Err(new KameleoonError(KameleoonException.StorageWrite, err));\n }\n }\n\n private parse(data: string): Result<T, KameleoonError> {\n let result: T;\n\n try {\n result = JSON.parse(data);\n } catch (err) {\n throw new KameleoonError(KameleoonException.StorageParse, err, this.key);\n }\n\n return Ok(result);\n }\n}\n"],"mappings":"aAAA,IAAAA,kBAAA,CAAAC,OAAA,mCAUwCC,MAAA,CAAAC,cAAA,CAAAC,OAAA,eAAAC,KAAA,MAAAD,OAAA,CAAAE,uBAAA,iBAAAC,QAAAC,CAAA,mCAAAD,OAAA,oBAAAE,MAAA,mBAAAA,MAAA,CAAAC,QAAA,UAAAF,CAAA,gBAAAA,CAAA,WAAAA,CAAA,SAAAA,CAAA,qBAAAC,MAAA,EAAAD,CAAA,CAAAG,WAAA,GAAAF,MAAA,EAAAD,CAAA,GAAAC,MAAA,CAAAG,SAAA,iBAAAJ,CAAA,EAAAD,OAAA,CAAAC,CAAA,WAAAK,gBAAAL,CAAA,CAAAM,CAAA,CAAAC,CAAA,SAAAD,CAAA,CAAAE,cAAA,CAAAF,CAAA,EAAAA,CAAA,IAAAN,CAAA,CAAAN,MAAA,CAAAC,cAAA,CAAAK,CAAA,CAAAM,CAAA,EAAAT,KAAA,CAAAU,CAAA,CAAAE,UAAA,IAAAC,YAAA,IAAAC,QAAA,MAAAX,CAAA,CAAAM,CAAA,EAAAC,CAAA,CAAAP,CAAA,UAAAY,gBAAAZ,CAAA,CAAAM,CAAA,OAAAN,CAAA,YAAAM,CAAA,YAAAO,SAAA,+CAAAC,kBAAAd,CAAA,CAAAM,CAAA,UAAAC,CAAA,CAAAQ,CAAA,GAAAA,CAAA,CAAAT,CAAA,CAAAU,MAAA,CAAAD,CAAA,GAAAR,CAAA,CAAAD,CAAA,CAAAS,CAAA,EAAAR,CAAA,CAAAE,UAA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AA7C,CAAA"}
1
+ {"version":3,"file":"localStorage.js","names":["_javascriptSdkCore","require","Object","defineProperty","exports","value","LocalStorageConstructor","_typeof","a","Symbol","iterator","constructor","prototype","_defineProperty","b","c","_toPropertyKey","enumerable","configurable","writable","_classCallCheck","TypeError","_defineProperties","d","length","key","_createClass","_toPrimitive","toPrimitive","call","String","Number","initialize","storage","LocalStorage","storageKey","get","read","data","localStorage","getItem","parse","Err","KameleoonError","KameleoonException","StorageRead","write","setItem","JSON","stringify","Ok","err","StorageWrite","result","StorageParse"],"sources":["../../src/storage/localStorage.ts"],"sourcesContent":["import {\n Ok,\n Err,\n Result,\n KameleoonError,\n IExternalStorage,\n KameleoonException,\n KameleoonStorageKey,\n IExternalStorageConstructor,\n StorageDataType,\n} from '@kameleoon/javascript-sdk-core';\n\nexport class LocalStorageConstructor implements IExternalStorageConstructor {\n public initialize<T extends StorageDataType>(\n key: KameleoonStorageKey,\n ): IExternalStorage<T> {\n const storage = new LocalStorage<T>(key);\n\n return storage;\n }\n}\n\nclass LocalStorage<T> implements IExternalStorage<T> {\n private storageKey: KameleoonStorageKey;\n\n constructor(key: KameleoonStorageKey) {\n this.storageKey = key;\n }\n\n get key(): KameleoonStorageKey {\n return this.storageKey;\n }\n\n public read(): Result<T, KameleoonError> {\n const data = localStorage.getItem(this.storageKey);\n\n if (!data) {\n return Err(\n new KameleoonError(KameleoonException.StorageRead, this.storageKey),\n );\n }\n\n return this.parse(data);\n }\n\n public write(data: T): Result<void, KameleoonError> {\n try {\n localStorage.setItem(this.storageKey, JSON.stringify(data));\n\n return Ok();\n } catch (err) {\n return Err(new KameleoonError(KameleoonException.StorageWrite, err));\n }\n }\n\n private parse(data: string): Result<T, KameleoonError> {\n let result: T;\n\n try {\n result = JSON.parse(data);\n } catch (err) {\n throw new KameleoonError(KameleoonException.StorageParse, err, this.key);\n }\n\n return Ok(result);\n }\n}\n"],"mappings":"aAAA,IAAAA,kBAAA,CAAAC,OAAA,mCAUwCC,MAAA,CAA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AAC,MAE9C,CAAAG,CAAI,CAMF,IAAI,CAACG,KAAK,CAACH,CAAI,CAAC,CALd,GAAAI,sBAAG,EACR,GAAI,CAAAC,iCAAc,CAACC,qCAAkB,CAACC,WAAW,CAAE,IAAI,CAACV,UAAU,CAAC,CAKzE,CAAC,GAAAV,GAAA,SAAApB,KAAA,CAED,SAAAyC,MAAaR,CAAO,CAAgC,CAClD,GAAI,CAGF,MAFA,CAAAC,YAAY,CAACQ,OAAO,CAAC,IAAI,CAACZ,UAAU,CAAEa,IAAI,CAACC,SAAS,CAACX,CAAI,CAAC,CAAC,CAEpD,GAAAY,qBAAE,GACX,CAAE,MAAOC,CAAG,CAAE,CACZ,MAAO,GAAAT,sBAAG,EAAC,GAAI,CAAAC,iCAAc,CAACC,qCAAkB,CAACQ,YAAY,CAAED,CAAG,CAAC,CACrE,CACF,CAAC,GAAA1B,GAAA,SAAApB,KAAA,CAED,SAAAoC,MAAcH,CAAY,CAA6B,CACrD,GAAI,CAAAe,CAAS,CAEb,GAAI,CACFA,CAAM,CAAGL,IAAI,CAACP,KAAK,CAACH,CAAI,CAC1B,CAAE,MAAOa,CAAG,CAAE,CACZ,KAAM,IAAI,CAAAR,iCAAc,CAACC,qCAAkB,CAACU,YAAY,CAAEH,CAAG,CAAE,IAAI,CAAC1B,GAAG,CACzE,CAEA,MAAO,GAAAyB,qBAAE,EAACG,CAAM,CAClB,CAAC,IAAA7C,CAAA"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.NativeStorageConstructor=void 0;var _javascriptSdkCore=require("@kameleoon/javascript-sdk-core"),_reactNativeMmkv=require("react-native-mmkv");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _defineProperty(a,b,c){return b=_toPropertyKey(b),b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"===_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!==_typeof(a)||null===a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var d=c.call(a,b||"default");if("object"!==_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}var NativeStorageConstructor=/*#__PURE__*/function(){function a(){_classCallCheck(this,a)}return _createClass(a,[{key:"initialize",value:function initialize(a){var b=new NativeStorage(a);return b}}]),a}();exports.NativeStorageConstructor=NativeStorageConstructor;var NativeStorage=/*#__PURE__*/function(){function a(b){_classCallCheck(this,a),_defineProperty(this,"storageKey",void 0),_defineProperty(this,"storage",void 0),this.storage=new _reactNativeMmkv.MMKV,this.storageKey=b}return _createClass(a,[{key:"key",get:function get(){return this.storageKey}},{key:"read",value:function read(){var a=this.storage.getString(this.storageKey);return a?this.parse(a):(0,_javascriptSdkCore.Err)(new _javascriptSdkCore.KameleoonError(_javascriptSdkCore.KameleoonException.StorageRead,this.storageKey))}},{key:"write",value:function write(a){return this.storage.set(this.storageKey,JSON.stringify(a)),(0,_javascriptSdkCore.Ok)()}},{key:"parse",value:function parse(a){var b;try{b=JSON.parse(a)}catch(a){throw new _javascriptSdkCore.KameleoonError(_javascriptSdkCore.KameleoonException.StorageParse,a,this.key)}return(0,_javascriptSdkCore.Ok)(b)}}]),a}();
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.NativeStorageConstructor=void 0;var _javascriptSdkCore=require("@kameleoon/javascript-sdk-core"),_reactNativeMmkv=require("react-native-mmkv");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _defineProperty(a,b,c){return b=_toPropertyKey(b),b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"===_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!==_typeof(a)||null===a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var d=c.call(a,b||"default");if("object"!==_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}var NativeStorageConstructor=function(){function a(){_classCallCheck(this,a)}return _createClass(a,[{key:"initialize",value:function initialize(a){var b=new NativeStorage(a);return b}}]),a}();exports.NativeStorageConstructor=NativeStorageConstructor;var NativeStorage=function(){function a(b){_classCallCheck(this,a),_defineProperty(this,"storageKey",void 0),_defineProperty(this,"storage",void 0),this.storage=new _reactNativeMmkv.MMKV,this.storageKey=b}return _createClass(a,[{key:"key",get:function get(){return this.storageKey}},{key:"read",value:function read(){var a=this.storage.getString(this.storageKey);return a?this.parse(a):(0,_javascriptSdkCore.Err)(new _javascriptSdkCore.KameleoonError(_javascriptSdkCore.KameleoonException.StorageRead,this.storageKey))}},{key:"write",value:function write(a){return this.storage.set(this.storageKey,JSON.stringify(a)),(0,_javascriptSdkCore.Ok)()}},{key:"parse",value:function parse(a){var b;try{b=JSON.parse(a)}catch(a){throw new _javascriptSdkCore.KameleoonError(_javascriptSdkCore.KameleoonException.StorageParse,a,this.key)}return(0,_javascriptSdkCore.Ok)(b)}}]),a}();
2
2
  //# sourceMappingURL=nativeStorage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nativeStorage.js","names":["NativeStorageConstructor","a","_classCallCheck","_createClass","key","value","initialize","storage","NativeStorage","exports","_defineProperty","MMKV","storageKey","get","read","data","getString","parse","Err","KameleoonError","KameleoonException","StorageRead","write","set","JSON","stringify","Ok","result","err","StorageParse"],"sources":["../../src/storage/nativeStorage.ts"],"sourcesContent":["import {\n Ok,\n Err,\n Result,\n KameleoonError,\n IExternalStorage,\n KameleoonException,\n KameleoonStorageKey,\n IExternalStorageConstructor,\n StorageDataType,\n} from '@kameleoon/javascript-sdk-core';\nimport { MMKV } from 'react-native-mmkv';\n\nexport class NativeStorageConstructor implements IExternalStorageConstructor {\n public initialize<T extends StorageDataType>(\n key: KameleoonStorageKey,\n ): IExternalStorage<T> {\n const storage = new NativeStorage<T>(key);\n\n return storage;\n }\n}\n\nclass NativeStorage<T> implements IExternalStorage<T> {\n private storageKey: KameleoonStorageKey;\n private storage: MMKV;\n\n constructor(key: KameleoonStorageKey) {\n this.storage = new MMKV();\n this.storageKey = key;\n }\n\n get key(): KameleoonStorageKey {\n return this.storageKey;\n }\n\n public read(): Result<T, KameleoonError> {\n const data = this.storage.getString(this.storageKey);\n\n if (!data) {\n return Err(\n new KameleoonError(KameleoonException.StorageRead, this.storageKey),\n );\n }\n\n return this.parse(data);\n }\n\n public write(data: T): Result<void, KameleoonError> {\n this.storage.set(this.storageKey, JSON.stringify(data));\n\n return Ok();\n }\n\n private parse(data: string): Result<T, KameleoonError> {\n let result: T;\n\n try {\n result = JSON.parse(data);\n } catch (err) {\n throw new KameleoonError(KameleoonException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SAAAC,KAAA,CAED,SAAAY,MAAcF,CAAY,CAA6B,CACrD,GAAI,CAAAY,CAAS,CAEb,GAAI,CACFA,CAAM,CAAGH,IAAI,CAACP,KAAK,CAACF,CAAI,CAC1B,CAAE,MAAOa,CAAG,CAAE,CACZ,KAAM,IAAI,CAAAT,iCAAc,CAACC,qCAAkB,CAACS,YAAY,CAAED,CAAG,CAAE,IAAI,CAACxB,GAAG,CACzE,CAEA,MAAO,GAAAsB,qBAAE,EAACC,CAAM,CAClB,CAAC,IAAA1B,CAAA"}
1
+ {"version":3,"file":"nativeStorage.js","names":["NativeStorageConstructor","a","_classCallCheck","_createClass","key","value","initialize","storage","NativeStorage","exports","_defineProperty","MMKV","storageKey","get","read","data","getString","parse","Err","KameleoonError","KameleoonException","StorageRead","write","set","JSON","stringify","Ok","result","err","StorageParse"],"sources":["../../src/storage/nativeStorage.ts"],"sourcesContent":["import {\n Ok,\n Err,\n Result,\n KameleoonError,\n IExternalStorage,\n KameleoonException,\n KameleoonStorageKey,\n IExternalStorageConstructor,\n StorageDataType,\n} from '@kameleoon/javascript-sdk-core';\nimport { MMKV } from 'react-native-mmkv';\n\nexport class NativeStorageConstructor implements IExternalStorageConstructor {\n public initialize<T extends StorageDataType>(\n key: KameleoonStorageKey,\n ): IExternalStorage<T> {\n const storage = new NativeStorage<T>(key);\n\n return storage;\n }\n}\n\nclass NativeStorage<T> implements IExternalStorage<T> {\n private storageKey: KameleoonStorageKey;\n private storage: MMKV;\n\n constructor(key: KameleoonStorageKey) {\n this.storage = new MMKV();\n this.storageKey = key;\n }\n\n get key(): KameleoonStorageKey {\n return this.storageKey;\n }\n\n public read(): Result<T, KameleoonError> {\n const data = this.storage.getString(this.storageKey);\n\n if (!data) {\n return Err(\n new KameleoonError(KameleoonException.StorageRead, this.storageKey),\n );\n }\n\n return this.parse(data);\n }\n\n public write(data: T): Result<void, KameleoonError> {\n this.storage.set(this.storageKey, JSON.stringify(data));\n\n return Ok();\n }\n\n private parse(data: string): Result<T, KameleoonError> {\n let result: T;\n\n try {\n result = JSON.parse(data);\n } catch (err) {\n throw new KameleoonError(KameleoonException.StorageParse, err, this.key);\n }\n\n return Ok(result);\n }\n}\n"],"mappings":"u8CAaa,CAAAA,wBAAwB,qBAAAC,EAAA,EAAAC,eAAA,MAAAD,CAAA,SAAAE,YAAA,CAAAF,CAAA,GAAAG,GAAA,cAAAC,KAAA,CACnC,SAAAC,WACEF,CAAwB,CACH,CACrB,GAAM,CAAAG,CAAO,CAAG,GAAI,CAAAC,aAAa,CAAIJ,CAAG,CAAC,CAEzC,MAAO,CAAAG,CACT,CAAC,IAAAN,CAAA,IAAAQ,OAAA,CAAAT,wBAAA,CAAAA,wBAAA,IAGG,CAAAQ,aAAa,YAIjB,SAAAP,EAAYG,CAAwB,CAAE,CAAAF,eAAA,MAAAD,CAAA,EAAAS,eAAA,2BAAAA,eAAA,wBACpC,IAAI,CAACH,OAAO,CAAG,GAAI,CAAAI,qBAAM,CACzB,IAAI,CAACC,UAAU,CAAGR,CACpB,CAAC,OAAAD,YAAA,CAAAF,CAAA,GAAAG,GAAA,OAAAS,GAAA,CAED,SAAAA,IAAA,CAA+B,CAC7B,MAAO,KAAI,CAACD,UACd,CAAC,GAAAR,GAAA,QAAAC,KAAA,CAED,SAAAS,KAAA,CAAyC,CACvC,GAAM,CAAAC,CAAI,CAAG,IAAI,CAACR,OAAO,CAACS,SAAS,CAAC,IAAI,CAACJ,UAAU,CAAC,CAAC,MAEhD,CAAAG,CAAI,CAMF,IAAI,CAACE,KAAK,CAACF,CAAI,CAAC,CALd,GAAAG,sBAAG,EACR,GAAI,CAAAC,iCAAc,CAACC,qCAAkB,CAACC,WAAW,CAAE,IAAI,CAACT,UAAU,CAAC,CAKzE,CAAC,GAAAR,GAAA,SAAAC,KAAA,CAED,SAAAiB,MAAaP,CAAO,CAAgC,CAGlD,MAFA,KAAI,CAACR,OAAO,CAACgB,GAAG,CAAC,IAAI,CAACX,UAAU,CAAEY,IAAI,CAACC,SAAS,CAACV,CAAI,CAAC,CAAC,CAEhD,GAAAW,qBAAE,GACX,CAAC,GAAAtB,GAAA,SAAAC,KAAA,CAED,SAAAY,MAAcF,CAAY,CAA6B,CACrD,GAAI,CAAAY,CAAS,CAEb,GAAI,CACFA,CAAM,CAAGH,IAAI,CAACP,KAAK,CAACF,CAAI,CAC1B,CAAE,MAAOa,CAAG,CAAE,CACZ,KAAM,IAAI,CAAAT,iCAAc,CAACC,qCAAkB,CAACS,YAAY,CAAED,CAAG,CAAE,IAAI,CAACxB,GAAG,CACzE,CAEA,MAAO,GAAAsB,qBAAE,EAACC,CAAM,CAClB,CAAC,IAAA1B,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { SDKConfigurationType } from '@kameleoon/javascript-sdk-core';
2
+ /**
3
+ * @param {string} siteCode - client's siteCode defined on Kameleoon platform
4
+ * @param {Partial<SDKConfigurationType> | undefined} configuration - client's configuration
5
+ * */
6
+ export type SDKParameters = {
7
+ siteCode: string;
8
+ configuration?: Partial<SDKConfigurationType>;
9
+ };
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["import { SDKConfigurationType } from '@kameleoon/javascript-sdk-core';\n\n/**\n * @param {string} siteCode - client's siteCode defined on Kameleoon platform\n * @param {Partial<SDKConfigurationType> | undefined} configuration - client's configuration\n * */\nexport type SDKParameters = {\n siteCode: string;\n configuration?: Partial<SDKConfigurationType>;\n};\n"],"mappings":""}
@@ -10,7 +10,7 @@ export interface IAddDataHookResult {
10
10
  * - `KameleoonException.VisitorCodeMaxLength` The visitor code length was exceeded.
11
11
  * - `KameleoonException.VisitorCodeEmpty` The visitor code is empty
12
12
  * - `KameleoonException.StorageWrite` Couldn't update storage data.
13
- * - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`.
13
+ * - `KameleoonException.Initialization` - Method was executed before the `kameleoonClient` completed it's `initialize` call.
14
14
  */
15
15
  addData: (visitorCode: string, ...data: KameleoonDataType[]) => void;
16
16
  }
@@ -1,6 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useAddData=useAddData;var _react=require("react"),_useKameleoon2=require("./useKameleoon");/**
2
- * A React Hook that returns `addData` function for adding targeting data to the Kameleoon storage.
3
- *
4
- * @returns {IAddDataHookResult} an object containing the `addData` function.
5
- */function useAddData(){var a=(0,_useKameleoon2.useKameleoon)(),b=a.client,c=(0,_react.useCallback)(function(a){for(var c=arguments.length,d=Array(1<c?c-1:0),e=1;e<c;e++)d[e-1]=arguments[e];b.addData.apply(b,[a].concat(d))},[b]);return{addData:c}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useAddData=useAddData;var _react=require("react"),_useKameleoon2=require("./useKameleoon");function useAddData(){var a=(0,_useKameleoon2.useKameleoon)(),b=a.client,c=(0,_react.useCallback)(function(a){for(var c=arguments.length,d=Array(1<c?c-1:0),e=1;e<c;e++)d[e-1]=arguments[e];b.addData.apply(b,[a].concat(d))},[b]);return{addData:c}}
6
2
  //# sourceMappingURL=useAddData.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAddData.js","names":["useAddData","a","useKameleoon","client","addData","useCallback","visitorCode","c","arguments","length","data","Array","e","apply","concat"],"sources":["../src/useAddData.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { KameleoonDataType } from '@kameleoon/javascript-sdk-core';\nimport { useKameleoon } from './useKameleoon';\n\nexport interface IAddDataHookResult {\n /**\n * Adds targeting data to the storage so that other methods could decide whether the current visitor is targeted or not. Note: userAgent data will not be stored in storage like other data, and it will be sent with every tracking request for bot filtration.\n *\n * @param {string} visitorCode - unique visitor identification string, can't exceed 255 characters length.\n * @param {KameleoonDataType[]} data - number of instances of any type of `KameleoonData`, can be added solely in array or as a sequential arguments.\n * @throws `KameleoonError` with one of the following `type` s:\n *\n * - `KameleoonException.VisitorCodeMaxLength` The visitor code length was exceeded.\n * - `KameleoonException.VisitorCodeEmpty` The visitor code is empty\n * - `KameleoonException.StorageWrite` Couldn't update storage data.\n * - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`.\n */\n addData: (visitorCode: string, ...data: KameleoonDataType[]) => void;\n}\n\n/**\n * A React Hook that returns `addData` function for adding targeting data to the Kameleoon storage.\n *\n * @returns {IAddDataHookResult} an object containing the `addData` function.\n */\nexport function useAddData(): IAddDataHookResult {\n const { client } = useKameleoon();\n\n const addData = useCallback(\n (visitorCode: string, ...data: KameleoonDataType[]): void => {\n client.addData(visitorCode, ...data);\n },\n [client],\n );\n\n return {\n addData,\n };\n}\n"],"mappings":"uKAoBA;AACA;AACA;AACA;AACA,GACO,QAAS,CAAAA,UAAUA,CAAA,CAAuB,KAAAC,CAAA,CAC5B,GAAAC,2BAAY,GAAE,CAAzBC,CAAM,CAAAF,CAAA,CAANE,MAAM,CAERC,CAAO,CAAG,GAAAC,kBAAW,EACzB,SAACC,CAAmB,CAAyC,SAAAC,CAAA,CAAAC,SAAA,CAAAC,MAAA,CAApCC,CAAI,CAAAC,KAAA,GAAAJ,CAAA,CAAAA,CAAA,MAAAK,CAAA,GAAAA,CAAA,CAAAL,CAAA,CAAAK,CAAA,GAAJF,CAAI,CAAAE,CAAA,IAAAJ,SAAA,CAAAI,CAAA,EAC3BT,CAAM,CAACC,OAAO,CAAAS,KAAA,CAAdV,CAAM,EAASG,CAAW,EAAAQ,MAAA,CAAKJ,CAAI,EACrC,CAAC,CACD,CAACP,CAAM,CAAC,CACT,CAED,MAAO,CACLC,OAAO,CAAPA,CACF,CACF"}
1
+ {"version":3,"file":"useAddData.js","names":["useAddData","a","useKameleoon","client","addData","useCallback","visitorCode","c","arguments","length","data","Array","e","apply","concat"],"sources":["../src/useAddData.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { KameleoonDataType } from '@kameleoon/javascript-sdk-core';\nimport { useKameleoon } from './useKameleoon';\n\nexport interface IAddDataHookResult {\n /**\n * Adds targeting data to the storage so that other methods could decide whether the current visitor is targeted or not. Note: userAgent data will not be stored in storage like other data, and it will be sent with every tracking request for bot filtration.\n *\n * @param {string} visitorCode - unique visitor identification string, can't exceed 255 characters length.\n * @param {KameleoonDataType[]} data - number of instances of any type of `KameleoonData`, can be added solely in array or as a sequential arguments.\n * @throws `KameleoonError` with one of the following `type` s:\n *\n * - `KameleoonException.VisitorCodeMaxLength` The visitor code length was exceeded.\n * - `KameleoonException.VisitorCodeEmpty` The visitor code is empty\n * - `KameleoonException.StorageWrite` Couldn't update storage data.\n * - `KameleoonException.Initialization` - Method was executed before the `kameleoonClient` completed it's `initialize` call.\n */\n addData: (visitorCode: string, ...data: KameleoonDataType[]) => void;\n}\n\n/**\n * A React Hook that returns `addData` function for adding targeting data to the Kameleoon storage.\n *\n * @returns {IAddDataHookResult} an object containing the `addData` function.\n */\nexport function useAddData(): IAddDataHookResult {\n const { client } = useKameleoon();\n\n const addData = useCallback(\n (visitorCode: string, ...data: KameleoonDataType[]): void => {\n client.addData(visitorCode, ...data);\n },\n [client],\n );\n\n return {\n addData,\n };\n}\n"],"mappings":"uKAyBO,QAAS,CAAAA,UAAUA,CAAA,CAAuB,KAAAC,CAAA,CAC5B,GAAAC,2BAAY,GAAE,CAAzBC,CAAM,CAAAF,CAAA,CAANE,MAAM,CAERC,CAAO,CAAG,GAAAC,kBAAW,EACzB,SAACC,CAAmB,CAAyC,SAAAC,CAAA,CAAAC,SAAA,CAAAC,MAAA,CAApCC,CAAI,CAAAC,KAAA,GAAAJ,CAAA,CAAAA,CAAA,MAAAK,CAAA,GAAAA,CAAA,CAAAL,CAAA,CAAAK,CAAA,GAAJF,CAAI,CAAAE,CAAA,IAAAJ,SAAA,CAAAI,CAAA,EAC3BT,CAAM,CAACC,OAAO,CAAAS,KAAA,CAAdV,CAAM,EAASG,CAAW,EAAAQ,MAAA,CAAKJ,CAAI,EACrC,CAAC,CACD,CAACP,CAAM,CAAC,CACT,CAED,MAAO,CACLC,OAAO,CAAPA,CACF,CACF"}
@@ -1,6 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useBrowserVisitorCode=useBrowserVisitorCode;var _react=require("react"),_browserUtils=require("./kameleoonUtils/browserUtils");/**
2
- * A React Hook that returns `getBrowserVisitorCode` function which obtains the Kameleoon visitorCode.
3
- *
4
- * @returns {IBrowserVisitorCodeHookResult} an object containing the `getBrowserVisitorCode` function.
5
- */function useBrowserVisitorCode(){var a=(0,_react.useCallback)(function(a,b){return _browserUtils.BrowserUtils.getVisitorCode(a,b)},[]);return{getBrowserVisitorCode:a}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useBrowserVisitorCode=useBrowserVisitorCode;var _react=require("react"),_browserUtils=require("./kameleoonUtils/browserUtils");function useBrowserVisitorCode(){var a=(0,_react.useCallback)(function(a,b){return _browserUtils.BrowserUtils.getVisitorCode(a,b)},[]);return{getBrowserVisitorCode:a}}
6
2
  //# sourceMappingURL=useBrowserVisitorCode.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useBrowserVisitorCode.js","names":["useBrowserVisitorCode","getBrowserVisitorCode","useCallback","domain","defaultVisitorCode","BrowserUtils","getVisitorCode"],"sources":["../src/useBrowserVisitorCode.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { BrowserUtils } from './kameleoonUtils/browserUtils';\n\nexport interface IBrowserVisitorCodeHookResult {\n /**\n * Obtains visitor code from browser cookie, if no cookie exists returns new random visitor code (or the specified default value).\n *\n * @param {string} domain - domain to be set to browser cookie along with visitor code.\n * @param {string | undefined} defaultVisitorCode - visitor code to be used instead of randomly generated visitor code in case there is no visitor code saved in browser cookie.\n * @returns {string} result visitor code.\n */\n getBrowserVisitorCode: (\n domain: string,\n defaultVisitorCode?: string,\n ) => string;\n}\n\n/**\n * A React Hook that returns `getBrowserVisitorCode` function which obtains the Kameleoon visitorCode.\n *\n * @returns {IBrowserVisitorCodeHookResult} an object containing the `getBrowserVisitorCode` function.\n */\nexport function useBrowserVisitorCode(): IBrowserVisitorCodeHookResult {\n const getBrowserVisitorCode = useCallback(\n (domain: string, defaultVisitorCode?: string): string => {\n return BrowserUtils.getVisitorCode(domain, defaultVisitorCode);\n },\n [],\n );\n\n return {\n getBrowserVisitorCode,\n };\n}\n"],"mappings":"2MAiBA;AACA;AACA;AACA;AACA,GACO,QAAS,CAAAA,qBAAqBA,CAAA,CAAkC,CACrE,GAAM,CAAAC,CAAqB,CAAG,GAAAC,kBAAW,EACvC,SAACC,CAAc,CAAEC,CAA2B,CAAa,CACvD,MAAO,CAAAC,0BAAY,CAACC,cAAc,CAACH,CAAM,CAAEC,CAAkB,CAC/D,CAAC,CACD,EAAE,CACH,CAED,MAAO,CACLH,qBAAqB,CAArBA,CACF,CACF"}
1
+ {"version":3,"file":"useBrowserVisitorCode.js","names":["useBrowserVisitorCode","getBrowserVisitorCode","useCallback","domain","defaultVisitorCode","BrowserUtils","getVisitorCode"],"sources":["../src/useBrowserVisitorCode.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { BrowserUtils } from './kameleoonUtils/browserUtils';\n\nexport interface IBrowserVisitorCodeHookResult {\n /**\n * Obtains visitor code from browser cookie, if no cookie exists returns new random visitor code (or the specified default value).\n *\n * @param {string} domain - domain to be set to browser cookie along with visitor code.\n * @param {string | undefined} defaultVisitorCode - visitor code to be used instead of randomly generated visitor code in case there is no visitor code saved in browser cookie.\n * @returns {string} result visitor code.\n */\n getBrowserVisitorCode: (\n domain: string,\n defaultVisitorCode?: string,\n ) => string;\n}\n\n/**\n * A React Hook that returns `getBrowserVisitorCode` function which obtains the Kameleoon visitorCode.\n *\n * @returns {IBrowserVisitorCodeHookResult} an object containing the `getBrowserVisitorCode` function.\n */\nexport function useBrowserVisitorCode(): IBrowserVisitorCodeHookResult {\n const getBrowserVisitorCode = useCallback(\n (domain: string, defaultVisitorCode?: string): string => {\n return BrowserUtils.getVisitorCode(domain, defaultVisitorCode);\n },\n [],\n );\n\n return {\n getBrowserVisitorCode,\n };\n}\n"],"mappings":"2MAsBO,QAAS,CAAAA,qBAAqBA,CAAA,CAAkC,CACrE,GAAM,CAAAC,CAAqB,CAAG,GAAAC,kBAAW,EACvC,SAACC,CAAc,CAAEC,CAA2B,CAAa,CACvD,MAAO,CAAAC,0BAAY,CAACC,cAAc,CAACH,CAAM,CAAEC,CAAkB,CAC/D,CAAC,CACD,EAAE,CACH,CAED,MAAO,CACLH,qBAAqB,CAArBA,CACF,CACF"}
@@ -5,7 +5,7 @@ export interface IConfigurationUpdateHookResult {
5
5
  * @param {() => void} callback - callback function with no parameters that will be called upon configuration update.
6
6
  * @throws `KameleoonError` with one of the following `type` s:
7
7
  *
8
- * - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`.
8
+ * - `KameleoonException.Initialization` - Method was executed before the `kameleoonClient` completed it's `initialize` call.
9
9
  */
10
10
  onConfigurationUpdate: (callback: () => void) => void;
11
11
  }
@@ -1,6 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useConfigurationUpdate=useConfigurationUpdate;var _react=require("react"),_useKameleoon2=require("./useKameleoon");/**
2
- * A React Hook that returns `onConfigurationUpdate` function which fires a callback on client configuration update.
3
- *
4
- * @returns {IConfigurationUpdateHookResult} an object containing the `onConfigurationUpdate` function.
5
- */function useConfigurationUpdate(){var a=(0,_useKameleoon2.useKameleoon)(),b=a.client,c=(0,_react.useCallback)(function(a){b.onConfigurationUpdate(a)},[b]);return{onConfigurationUpdate:c}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useConfigurationUpdate=useConfigurationUpdate;var _react=require("react"),_useKameleoon2=require("./useKameleoon");function useConfigurationUpdate(){var a=(0,_useKameleoon2.useKameleoon)(),b=a.client,c=(0,_react.useCallback)(function(a){b.onConfigurationUpdate(a)},[b]);return{onConfigurationUpdate:c}}
6
2
  //# sourceMappingURL=useConfigurationUpdate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useConfigurationUpdate.js","names":["useConfigurationUpdate","a","useKameleoon","client","onConfigurationUpdate","useCallback","callback"],"sources":["../src/useConfigurationUpdate.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useKameleoon } from './useKameleoon';\n\nexport interface IConfigurationUpdateHookResult {\n /**\n * Fires a callback on client configuration update. Note: this method only works for server sent events of real time update.\n *\n * @param {() => void} callback - callback function with no parameters that will be called upon configuration update.\n * @throws `KameleoonError` with one of the following `type` s:\n * \n * - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`.\n */\n onConfigurationUpdate: (callback: () => void) => void;\n}\n\n/**\n * A React Hook that returns `onConfigurationUpdate` function which fires a callback on client configuration update.\n *\n * @returns {IConfigurationUpdateHookResult} an object containing the `onConfigurationUpdate` function.\n */\nexport function useConfigurationUpdate(): IConfigurationUpdateHookResult {\n const { client } = useKameleoon();\n\n const onConfigurationUpdate = useCallback(\n (callback: () => void): void => {\n client.onConfigurationUpdate(callback);\n },\n [client],\n );\n\n return {\n onConfigurationUpdate,\n };\n}\n"],"mappings":"+LAeA;AACA;AACA;AACA;AACA,GACO,QAAS,CAAAA,sBAAsBA,CAAA,CAAmC,KAAAC,CAAA,CACpD,GAAAC,2BAAY,GAAE,CAAzBC,CAAM,CAAAF,CAAA,CAANE,MAAM,CAERC,CAAqB,CAAG,GAAAC,kBAAW,EACvC,SAACC,CAAoB,CAAW,CAC9BH,CAAM,CAACC,qBAAqB,CAACE,CAAQ,CACvC,CAAC,CACD,CAACH,CAAM,CAAC,CACT,CAED,MAAO,CACLC,qBAAqB,CAArBA,CACF,CACF"}
1
+ {"version":3,"file":"useConfigurationUpdate.js","names":["useConfigurationUpdate","a","useKameleoon","client","onConfigurationUpdate","useCallback","callback"],"sources":["../src/useConfigurationUpdate.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useKameleoon } from './useKameleoon';\n\nexport interface IConfigurationUpdateHookResult {\n /**\n * Fires a callback on client configuration update. Note: this method only works for server sent events of real time update.\n *\n * @param {() => void} callback - callback function with no parameters that will be called upon configuration update.\n * @throws `KameleoonError` with one of the following `type` s:\n * \n * - `KameleoonException.Initialization` - Method was executed before the `kameleoonClient` completed it's `initialize` call.\n */\n onConfigurationUpdate: (callback: () => void) => void;\n}\n\n/**\n * A React Hook that returns `onConfigurationUpdate` function which fires a callback on client configuration update.\n *\n * @returns {IConfigurationUpdateHookResult} an object containing the `onConfigurationUpdate` function.\n */\nexport function useConfigurationUpdate(): IConfigurationUpdateHookResult {\n const { client } = useKameleoon();\n\n const onConfigurationUpdate = useCallback(\n (callback: () => void): void => {\n client.onConfigurationUpdate(callback);\n },\n [client],\n );\n\n return {\n onConfigurationUpdate,\n };\n}\n"],"mappings":"+LAoBO,QAAS,CAAAA,sBAAsBA,CAAA,CAAmC,KAAAC,CAAA,CACpD,GAAAC,2BAAY,GAAE,CAAzBC,CAAM,CAAAF,CAAA,CAANE,MAAM,CAERC,CAAqB,CAAG,GAAAC,kBAAW,EACvC,SAACC,CAAoB,CAAW,CAC9BH,CAAM,CAACC,qBAAqB,CAACE,CAAQ,CACvC,CAAC,CACD,CAACH,CAAM,CAAC,CACT,CAED,MAAO,CACLC,qBAAqB,CAArBA,CACF,CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"useEngineTrackingCode.js","names":["useEngineTrackingCode","a","useKameleoon","client","getEngineTrackingCode","useCallback","visitorCode"],"sources":["../src/useEngineTrackingCode.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useKameleoon } from './useKameleoon';\n\nexport interface IEngineTrackingCodeHookResult {\n /**\n * Returns Kameleoon tracking code for the current visitor. Tracking code is built of the experiments that were triggered and feature flag variations that were assigned during the last 5 seconds.\n * See [Kameleoon Automation API](https://developers.kameleoon.com/apis/activation-api-js/api-reference#trigger-1) for the details\n *\n * @param {string} visitorCode - unique visitor identification string, can't exceed 255 characters length\n * @returns {string} Kameleoon tracking code\n * @throws `KameleoonError` with one of the following `type` s:\n *\n * - `KameleoonException.VisitorCodeMaxLength` - The visitor code length was exceeded\n * - `KameleoonException.VisitorCodeEmpty` The visitor code is empty\n */\n}\n\nexport function useEngineTrackingCode() {\n const { client } = useKameleoon();\n\n const getEngineTrackingCode = useCallback(\n (visitorCode: string): string => {\n return client.getEngineTrackingCode(visitorCode);\n },\n [client],\n );\n\n return {\n getEngineTrackingCode,\n };\n}\n"],"mappings":"6LAiBO,QAAS,CAAAA,qBAAqBA,CAAA,CAAG,KAAAC,CAAA,CACnB,GAAAC,2BAAY,GAAE,CAAzBC,CAAM,CAAAF,CAAA,CAANE,MAAM,CAERC,CAAqB,CAAG,GAAAC,kBAAW,EACvC,SAACC,CAAmB,CAAa,CAC/B,MAAO,CAAAH,CAAM,CAACC,qBAAqB,CAACE,CAAW,CACjD,CAAC,CACD,CAACH,CAAM,CAAC,CACT,CAED,MAAO,CACLC,qBAAqB,CAArBA,CACF,CACF"}
1
+ {"version":3,"file":"useEngineTrackingCode.js","names":["useEngineTrackingCode","a","useKameleoon","client","getEngineTrackingCode","useCallback","visitorCode"],"sources":["../src/useEngineTrackingCode.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useKameleoon } from './useKameleoon';\n\nexport interface IEngineTrackingCodeHookResult {\n /**\n * Returns Kameleoon tracking code for the current visitor. Tracking code is built of the feature flag variations that were assigned during the last 5 seconds.\n * See [Kameleoon Automation API](https://developers.kameleoon.com/apis/activation-api-js/api-reference#trigger-1) for the details\n *\n * @param {string} visitorCode - unique visitor identification string, can't exceed 255 characters length\n * @returns {string} Kameleoon tracking code\n * @throws `KameleoonError` with one of the following `type` s:\n *\n * - `KameleoonException.VisitorCodeMaxLength` - The visitor code length was exceeded\n * - `KameleoonException.VisitorCodeEmpty` The visitor code is empty\n */\n}\n\nexport function useEngineTrackingCode() {\n const { client } = useKameleoon();\n\n const getEngineTrackingCode = useCallback(\n (visitorCode: string): string => {\n return client.getEngineTrackingCode(visitorCode);\n },\n [client],\n );\n\n return {\n getEngineTrackingCode,\n };\n}\n"],"mappings":"6LAiBO,QAAS,CAAAA,qBAAqBA,CAAA,CAAG,KAAAC,CAAA,CACnB,GAAAC,2BAAY,GAAE,CAAzBC,CAAM,CAAAF,CAAA,CAANE,MAAM,CAERC,CAAqB,CAAG,GAAAC,kBAAW,EACvC,SAACC,CAAmB,CAAa,CAC/B,MAAO,CAAAH,CAAM,CAACC,qBAAqB,CAACE,CAAW,CACjD,CAAC,CACD,CAACH,CAAM,CAAC,CACT,CAED,MAAO,CACLC,qBAAqB,CAArBA,CACF,CACF"}
@@ -9,8 +9,8 @@ export interface IFeatureFlagActiveHookResult {
9
9
  *
10
10
  * - `KameleoonException.VisitorCodeMaxLength` - The visitor code length was exceeded.
11
11
  * - `KameleoonException.VisitorCodeEmpty` The visitor code is empty
12
- * - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`.
13
- * - `KameleoonException.FeatureFlagConfigurationNotFound` - No feature flag was found for provided `visitorCode` and `featureKey`.
12
+ * - `KameleoonException.Initialization` - Method was executed before the `kameleoonClient` completed it's `initialize` call.
13
+ * - `KameleoonException.FeatureFlagConfigurationNotFound` - No feature flag was found for provided `featureKey`.
14
14
  * - `KameleoonException.DataInconsistency` - Allocated variation was found but there is no feature flag with according `featureKey`.
15
15
  * - `KameleoonException.NotTargeted` - Current visitor is not targeted.
16
16
  */
@@ -1,6 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useFeatureFlagActive=useFeatureFlagActive;var _react=require("react"),_useKameleoon2=require("./useKameleoon");/**
2
- * A React Hook that returns `isFeatureFlagActive` function which indicates whether the visitor with `visitorCode` has `featureKey` active for him.
3
- *
4
- * @returns {IFeatureFlagActiveHookResult} an object containing the `isFeatureFlagActive` function.
5
- */function useFeatureFlagActive(){var a=(0,_useKameleoon2.useKameleoon)(),b=a.client,c=(0,_react.useCallback)(function(a,c){return b.isFeatureFlagActive(a,c)},[b]);return{isFeatureFlagActive:c}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useFeatureFlagActive=useFeatureFlagActive;var _react=require("react"),_useKameleoon2=require("./useKameleoon");function useFeatureFlagActive(){var a=(0,_useKameleoon2.useKameleoon)(),b=a.client,c=(0,_react.useCallback)(function(a,c){return b.isFeatureFlagActive(a,c)},[b]);return{isFeatureFlagActive:c}}
6
2
  //# sourceMappingURL=useFeatureFlagActive.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFeatureFlagActive.js","names":["useFeatureFlagActive","a","useKameleoon","client","isFeatureFlagActive","useCallback","visitorCode","featureKey"],"sources":["../src/useFeatureFlagActive.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useKameleoon } from './useKameleoon';\n\nexport interface IFeatureFlagActiveHookResult {\n /**\n * Indicates whether the visitor with `visitorCode` has `featureKey` active for him, this method includes targeting check, finding the according variation exposed to the visitor and saving it to storage along with sending tracking request.\n *\n * @param {string} visitorCode - unique visitor identification string, can't exceed 255 characters length.\n * @param {string} featureKey - a unique key for feature flag.\n * @returns {boolean} a boolean indicator of whether the feature flag with `featureKey` is active for visitor with `visitorCode`.\n * @throws `KameleoonError` with one of the following `type` s:\n *\n * - `KameleoonException.VisitorCodeMaxLength` - The visitor code length was exceeded.\n * - `KameleoonException.VisitorCodeEmpty` The visitor code is empty\n * - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`.\n * - `KameleoonException.FeatureFlagConfigurationNotFound` - No feature flag was found for provided `visitorCode` and `featureKey`.\n * - `KameleoonException.DataInconsistency` - Allocated variation was found but there is no feature flag with according `featureKey`.\n * - `KameleoonException.NotTargeted` - Current visitor is not targeted.\n */\n isFeatureFlagActive: (visitorCode: string, featureKey: string) => boolean;\n}\n\n/**\n * A React Hook that returns `isFeatureFlagActive` function which indicates whether the visitor with `visitorCode` has `featureKey` active for him.\n *\n * @returns {IFeatureFlagActiveHookResult} an object containing the `isFeatureFlagActive` function.\n */\nexport function useFeatureFlagActive(): IFeatureFlagActiveHookResult {\n const { client } = useKameleoon();\n\n const isFeatureFlagActive = useCallback(\n (visitorCode: string, featureKey: string): boolean => {\n return client.isFeatureFlagActive(visitorCode, featureKey);\n },\n [client],\n );\n\n return {\n isFeatureFlagActive,\n };\n}\n"],"mappings":"2LAsBA;AACA;AACA;AACA;AACA,GACO,QAAS,CAAAA,oBAAoBA,CAAA,CAAiC,KAAAC,CAAA,CAChD,GAAAC,2BAAY,GAAE,CAAzBC,CAAM,CAAAF,CAAA,CAANE,MAAM,CAERC,CAAmB,CAAG,GAAAC,kBAAW,EACrC,SAACC,CAAmB,CAAEC,CAAkB,CAAc,CACpD,MAAO,CAAAJ,CAAM,CAACC,mBAAmB,CAACE,CAAW,CAAEC,CAAU,CAC3D,CAAC,CACD,CAACJ,CAAM,CAAC,CACT,CAED,MAAO,CACLC,mBAAmB,CAAnBA,CACF,CACF"}
1
+ {"version":3,"file":"useFeatureFlagActive.js","names":["useFeatureFlagActive","a","useKameleoon","client","isFeatureFlagActive","useCallback","visitorCode","featureKey"],"sources":["../src/useFeatureFlagActive.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useKameleoon } from './useKameleoon';\n\nexport interface IFeatureFlagActiveHookResult {\n /**\n * Indicates whether the visitor with `visitorCode` has `featureKey` active for him, this method includes targeting check, finding the according variation exposed to the visitor and saving it to storage along with sending tracking request.\n *\n * @param {string} visitorCode - unique visitor identification string, can't exceed 255 characters length.\n * @param {string} featureKey - a unique key for feature flag.\n * @returns {boolean} a boolean indicator of whether the feature flag with `featureKey` is active for visitor with `visitorCode`.\n * @throws `KameleoonError` with one of the following `type` s:\n *\n * - `KameleoonException.VisitorCodeMaxLength` - The visitor code length was exceeded.\n * - `KameleoonException.VisitorCodeEmpty` The visitor code is empty\n * - `KameleoonException.Initialization` - Method was executed before the `kameleoonClient` completed it's `initialize` call.\n * - `KameleoonException.FeatureFlagConfigurationNotFound` - No feature flag was found for provided `featureKey`.\n * - `KameleoonException.DataInconsistency` - Allocated variation was found but there is no feature flag with according `featureKey`.\n * - `KameleoonException.NotTargeted` - Current visitor is not targeted.\n */\n isFeatureFlagActive: (visitorCode: string, featureKey: string) => boolean;\n}\n\n/**\n * A React Hook that returns `isFeatureFlagActive` function which indicates whether the visitor with `visitorCode` has `featureKey` active for him.\n *\n * @returns {IFeatureFlagActiveHookResult} an object containing the `isFeatureFlagActive` function.\n */\nexport function useFeatureFlagActive(): IFeatureFlagActiveHookResult {\n const { client } = useKameleoon();\n\n const isFeatureFlagActive = useCallback(\n (visitorCode: string, featureKey: string): boolean => {\n return client.isFeatureFlagActive(visitorCode, featureKey);\n },\n [client],\n );\n\n return {\n isFeatureFlagActive,\n };\n}\n"],"mappings":"2LA2BO,QAAS,CAAAA,oBAAoBA,CAAA,CAAiC,KAAAC,CAAA,CAChD,GAAAC,2BAAY,GAAE,CAAzBC,CAAM,CAAAF,CAAA,CAANE,MAAM,CAERC,CAAmB,CAAG,GAAAC,kBAAW,EACrC,SAACC,CAAmB,CAAEC,CAAkB,CAAc,CACpD,MAAO,CAAAJ,CAAM,CAACC,mBAAmB,CAACE,CAAW,CAAEC,CAAU,CAC3D,CAAC,CACD,CAACJ,CAAM,CAAC,CACT,CAED,MAAO,CACLC,mBAAmB,CAAnBA,CACF,CACF"}
@@ -9,8 +9,8 @@ export interface IFeatureFlagVariationKeyHookResult {
9
9
  *
10
10
  * - `KameleoonException.VisitorCodeMaxLength` - The visitor code length was exceeded.
11
11
  * - `KameleoonException.VisitorCodeEmpty` The visitor code is empty
12
- * - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`.
13
- * - `KameleoonException.FeatureFlagConfigurationNotFound` - No feature flag was found for provided `visitorCode` and `featureKey`.
12
+ * - `KameleoonException.Initialization` - Method was executed before the `kameleoonClient` completed it's `initialize` call.
13
+ * - `KameleoonException.FeatureFlagConfigurationNotFound` - No feature flag was found for provided `featureKey`.
14
14
  * - `KameleoonException.NotTargeted` - Current visitor is not targeted.
15
15
  */
16
16
  getFeatureFlagVariationKey: (visitorCode: string, featureKey: string) => string;
@@ -1,6 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useFeatureFlagVariationKey=useFeatureFlagVariationKey;var _react=require("react"),_useKameleoon2=require("./useKameleoon");/**
2
- * A React Hook that returns `getFeatureFlagVariationKey` function which returns variation key for the visitor under `visitorCode` in the found feature flag.
3
- *
4
- * @returns {IFeatureFlagVariationKeyHookResult} an object containing the `getFeatureFlagVariationKey` function.
5
- */function useFeatureFlagVariationKey(){var a=(0,_useKameleoon2.useKameleoon)(),b=a.client,c=(0,_react.useCallback)(function(a,c){return b.getFeatureFlagVariationKey(a,c)},[b]);return{getFeatureFlagVariationKey:c}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useFeatureFlagVariationKey=useFeatureFlagVariationKey;var _react=require("react"),_useKameleoon2=require("./useKameleoon");function useFeatureFlagVariationKey(){var a=(0,_useKameleoon2.useKameleoon)(),b=a.client,c=(0,_react.useCallback)(function(a,c){return b.getFeatureFlagVariationKey(a,c)},[b]);return{getFeatureFlagVariationKey:c}}
6
2
  //# sourceMappingURL=useFeatureFlagVariationKey.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFeatureFlagVariationKey.js","names":["useFeatureFlagVariationKey","a","useKameleoon","client","getFeatureFlagVariationKey","useCallback","visitorCode","featureKey"],"sources":["../src/useFeatureFlagVariationKey.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useKameleoon } from './useKameleoon';\n\nexport interface IFeatureFlagVariationKeyHookResult {\n /**\n * Returns variation key for the visitor under `visitorCode` in the found feature flag, this method includes targeting check, finding the according variation exposed to the visitor and saving it to storage along with sending tracking request.\n *\n * @param {string} visitorCode - unique visitor identification string, can't exceed 255 characters length.\n * @param {string} featureKey - a unique key for feature flag.\n * @returns {string} a string containing variable key for the allocated feature flag variation for the provided visitor.\n * @throws `KameleoonError` with one of the following `type` s:\n *\n * - `KameleoonException.VisitorCodeMaxLength` - The visitor code length was exceeded.\n * - `KameleoonException.VisitorCodeEmpty` The visitor code is empty\n * - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`.\n * - `KameleoonException.FeatureFlagConfigurationNotFound` - No feature flag was found for provided `visitorCode` and `featureKey`.\n * - `KameleoonException.NotTargeted` - Current visitor is not targeted.\n */\n getFeatureFlagVariationKey: (\n visitorCode: string,\n featureKey: string,\n ) => string;\n}\n\n/**\n * A React Hook that returns `getFeatureFlagVariationKey` function which returns variation key for the visitor under `visitorCode` in the found feature flag.\n *\n * @returns {IFeatureFlagVariationKeyHookResult} an object containing the `getFeatureFlagVariationKey` function.\n */\nexport function useFeatureFlagVariationKey(): IFeatureFlagVariationKeyHookResult {\n const { client } = useKameleoon();\n\n const getFeatureFlagVariationKey = useCallback(\n (visitorCode: string, featureKey: string): string => {\n return client.getFeatureFlagVariationKey(visitorCode, featureKey);\n },\n [client],\n );\n\n return {\n getFeatureFlagVariationKey,\n };\n}\n"],"mappings":"uMAwBA;AACA;AACA;AACA;AACA,GACO,QAAS,CAAAA,0BAA0BA,CAAA,CAAuC,KAAAC,CAAA,CAC5D,GAAAC,2BAAY,GAAE,CAAzBC,CAAM,CAAAF,CAAA,CAANE,MAAM,CAERC,CAA0B,CAAG,GAAAC,kBAAW,EAC5C,SAACC,CAAmB,CAAEC,CAAkB,CAAa,CACnD,MAAO,CAAAJ,CAAM,CAACC,0BAA0B,CAACE,CAAW,CAAEC,CAAU,CAClE,CAAC,CACD,CAACJ,CAAM,CAAC,CACT,CAED,MAAO,CACLC,0BAA0B,CAA1BA,CACF,CACF"}
1
+ {"version":3,"file":"useFeatureFlagVariationKey.js","names":["useFeatureFlagVariationKey","a","useKameleoon","client","getFeatureFlagVariationKey","useCallback","visitorCode","featureKey"],"sources":["../src/useFeatureFlagVariationKey.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useKameleoon } from './useKameleoon';\n\nexport interface IFeatureFlagVariationKeyHookResult {\n /**\n * Returns variation key for the visitor under `visitorCode` in the found feature flag, this method includes targeting check, finding the according variation exposed to the visitor and saving it to storage along with sending tracking request.\n *\n * @param {string} visitorCode - unique visitor identification string, can't exceed 255 characters length.\n * @param {string} featureKey - a unique key for feature flag.\n * @returns {string} a string containing variable key for the allocated feature flag variation for the provided visitor.\n * @throws `KameleoonError` with one of the following `type` s:\n *\n * - `KameleoonException.VisitorCodeMaxLength` - The visitor code length was exceeded.\n * - `KameleoonException.VisitorCodeEmpty` The visitor code is empty\n * - `KameleoonException.Initialization` - Method was executed before the `kameleoonClient` completed it's `initialize` call.\n * - `KameleoonException.FeatureFlagConfigurationNotFound` - No feature flag was found for provided `featureKey`.\n * - `KameleoonException.NotTargeted` - Current visitor is not targeted.\n */\n getFeatureFlagVariationKey: (\n visitorCode: string,\n featureKey: string,\n ) => string;\n}\n\n/**\n * A React Hook that returns `getFeatureFlagVariationKey` function which returns variation key for the visitor under `visitorCode` in the found feature flag.\n *\n * @returns {IFeatureFlagVariationKeyHookResult} an object containing the `getFeatureFlagVariationKey` function.\n */\nexport function useFeatureFlagVariationKey(): IFeatureFlagVariationKeyHookResult {\n const { client } = useKameleoon();\n\n const getFeatureFlagVariationKey = useCallback(\n (visitorCode: string, featureKey: string): string => {\n return client.getFeatureFlagVariationKey(visitorCode, featureKey);\n },\n [client],\n );\n\n return {\n getFeatureFlagVariationKey,\n };\n}\n"],"mappings":"uMA6BO,QAAS,CAAAA,0BAA0BA,CAAA,CAAuC,KAAAC,CAAA,CAC5D,GAAAC,2BAAY,GAAE,CAAzBC,CAAM,CAAAF,CAAA,CAANE,MAAM,CAERC,CAA0B,CAAG,GAAAC,kBAAW,EAC5C,SAACC,CAAmB,CAAEC,CAAkB,CAAa,CACnD,MAAO,CAAAJ,CAAM,CAACC,0BAA0B,CAACE,CAAW,CAAEC,CAAU,CAClE,CAAC,CACD,CAACJ,CAAM,CAAC,CACT,CAED,MAAO,CACLC,0BAA0B,CAA1BA,CACF,CACF"}
@@ -6,7 +6,7 @@ export interface IFeatureFlagsHookResult {
6
6
  * @returns {FeatureFlagType[]} a list of all feature flags items with `id` and `key` fields.
7
7
  * @throws `KameleoonError` with one of the following `type` s:
8
8
  *
9
- * - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`.
9
+ * - `KameleoonException.Initialization` - Method was executed before the `kameleoonClient` completed it's `initialize` call.
10
10
  */
11
11
  getFeatureFlags: () => FeatureFlagType[];
12
12
  }
@@ -1,6 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useFeatureFlags=useFeatureFlags;var _react=require("react"),_useKameleoon2=require("./useKameleoon");/**
2
- * A React Hook that returns `getFeatureFlags` function which returns a list of feature flags.
3
- *
4
- * @returns {IFeatureFlagsHookResult} an object containing the `getFeatureFlags` function.
5
- */function useFeatureFlags(){var a=(0,_useKameleoon2.useKameleoon)(),b=a.client,c=(0,_react.useCallback)(function(){return b.getFeatureFlags()},[b]);return{getFeatureFlags:c}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useFeatureFlags=useFeatureFlags;var _react=require("react"),_useKameleoon2=require("./useKameleoon");function useFeatureFlags(){var a=(0,_useKameleoon2.useKameleoon)(),b=a.client,c=(0,_react.useCallback)(function(){return b.getFeatureFlags()},[b]);return{getFeatureFlags:c}}
6
2
  //# sourceMappingURL=useFeatureFlags.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFeatureFlags.js","names":["useFeatureFlags","a","useKameleoon","client","getFeatureFlags","useCallback"],"sources":["../src/useFeatureFlags.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { FeatureFlagType } from '@kameleoon/javascript-sdk-core';\nimport { useKameleoon } from './useKameleoon';\n\nexport interface IFeatureFlagsHookResult {\n /**\n * Returns a list of feature flags stored in the client configuration.\n *\n * @returns {FeatureFlagType[]} a list of all feature flags items with `id` and `key` fields.\n * @throws `KameleoonError` with one of the following `type` s:\n * \n * - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`.\n */\n getFeatureFlags: () => FeatureFlagType[];\n}\n\n/**\n * A React Hook that returns `getFeatureFlags` function which returns a list of feature flags.\n *\n * @returns {IFeatureFlagsHookResult} an object containing the `getFeatureFlags` function.\n */\nexport function useFeatureFlags(): IFeatureFlagsHookResult {\n const { client } = useKameleoon();\n\n const getFeatureFlags = useCallback((): FeatureFlagType[] => {\n return client.getFeatureFlags();\n }, [client]);\n\n return {\n getFeatureFlags,\n };\n}\n"],"mappings":"iLAgBA;AACA;AACA;AACA;AACA,GACO,QAAS,CAAAA,eAAeA,CAAA,CAA4B,KAAAC,CAAA,CACtC,GAAAC,2BAAY,GAAE,CAAzBC,CAAM,CAAAF,CAAA,CAANE,MAAM,CAERC,CAAe,CAAG,GAAAC,kBAAW,EAAC,UAAyB,CAC3D,MAAO,CAAAF,CAAM,CAACC,eAAe,EAC/B,CAAC,CAAE,CAACD,CAAM,CAAC,CAAC,CAEZ,MAAO,CACLC,eAAe,CAAfA,CACF,CACF"}
1
+ {"version":3,"file":"useFeatureFlags.js","names":["useFeatureFlags","a","useKameleoon","client","getFeatureFlags","useCallback"],"sources":["../src/useFeatureFlags.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { FeatureFlagType } from '@kameleoon/javascript-sdk-core';\nimport { useKameleoon } from './useKameleoon';\n\nexport interface IFeatureFlagsHookResult {\n /**\n * Returns a list of feature flags stored in the client configuration.\n *\n * @returns {FeatureFlagType[]} a list of all feature flags items with `id` and `key` fields.\n * @throws `KameleoonError` with one of the following `type` s:\n * \n * - `KameleoonException.Initialization` - Method was executed before the `kameleoonClient` completed it's `initialize` call.\n */\n getFeatureFlags: () => FeatureFlagType[];\n}\n\n/**\n * A React Hook that returns `getFeatureFlags` function which returns a list of feature flags.\n *\n * @returns {IFeatureFlagsHookResult} an object containing the `getFeatureFlags` function.\n */\nexport function useFeatureFlags(): IFeatureFlagsHookResult {\n const { client } = useKameleoon();\n\n const getFeatureFlags = useCallback((): FeatureFlagType[] => {\n return client.getFeatureFlags();\n }, [client]);\n\n return {\n getFeatureFlags,\n };\n}\n"],"mappings":"iLAqBO,QAAS,CAAAA,eAAeA,CAAA,CAA4B,KAAAC,CAAA,CACtC,GAAAC,2BAAY,GAAE,CAAzBC,CAAM,CAAAF,CAAA,CAANE,MAAM,CAERC,CAAe,CAAG,GAAAC,kBAAW,EAAC,UAAyB,CAC3D,MAAO,CAAAF,CAAM,CAACC,eAAe,EAC/B,CAAC,CAAE,CAACD,CAAM,CAAC,CAAC,CAEZ,MAAO,CACLC,eAAe,CAAfA,CACF,CACF"}
@@ -4,13 +4,13 @@ export interface IFeatureVariableHookResult {
4
4
  * Returns a variable for the visitor under `visitorCode` in the found feature flag, this method includes targeting check, finding the according variation exposed to the visitor and saving it to storage along with sending tracking request.
5
5
  *
6
6
  * @param {GetFeatureFlagVariableParamsType} params - `visitorCode`, `featureKey` and `variableKey` parameters to return variable.
7
- * @return {FeatureVariableResultType} a variable object containing `type` and `value` fields, `type` can be checked against `FeatureVariableType` enum, if the `type` is `FeatureVariableType.BOOLEAN` then the `value` type will be `boolean` and so on.
7
+ * @return {FeatureVariableResultType} a variable object containing `type` and `value` fields. You can check the `type` field against `FeatureVariableType` enum. For example, if the `type` is `FeatureVariableType.BOOLEAN` then `value` will be a `boolean` type.
8
8
  * @throws `KameleoonError` with one of the following `type` s:
9
9
  *
10
10
  * - `KameleoonException.VisitorCodeMaxLength` - The visitor code length was exceeded.
11
11
  * - `KameleoonException.VisitorCodeEmpty` The visitor code is empty
12
- * - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`.
13
- * - `KameleoonException.FeatureFlagConfigurationNotFound` - No feature flag was found for provided `visitorCode` and `featureKey`.
12
+ * - `KameleoonException.Initialization` - Method was executed before the `kameleoonClient` completed it's `initialize` call.
13
+ * - `KameleoonException.FeatureFlagConfigurationNotFound` - No feature flag was found for provided `featureKey`.
14
14
  * - `KameleoonException.FeatureFlagVariableNotFound` - No feature variable was found for provided `visitorCode` and `variableKey`
15
15
  * - `KameleoonException.NotTargeted` - Current visitor is not targeted.
16
16
  * - `KameleoonException.JSONParse` - Couldn't pass JSON value.
@@ -21,6 +21,6 @@ export interface IFeatureVariableHookResult {
21
21
  /**
22
22
  * A React Hook that returns `getFeatureFlagVariable` function which retrieves a feature variable.
23
23
  *
24
- * @returns {IPageViewHookResult} an object containing the `getFeatureFlagVariable` function.
24
+ * @returns {IFeatureVariableHookResult} an object containing the `getFeatureFlagVariable` function.
25
25
  */
26
26
  export declare function useFeatureVariable(): IFeatureVariableHookResult;
@@ -1,6 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useFeatureVariable=useFeatureVariable;var _react=require("react"),_useKameleoon2=require("./useKameleoon");/**
2
- * A React Hook that returns `getFeatureFlagVariable` function which retrieves a feature variable.
3
- *
4
- * @returns {IPageViewHookResult} an object containing the `getFeatureFlagVariable` function.
5
- */function useFeatureVariable(){var a=(0,_useKameleoon2.useKameleoon)(),b=a.client,c=(0,_react.useCallback)(function(a){var c=a.visitorCode,d=a.featureKey,e=a.variableKey;return b.getFeatureFlagVariable({visitorCode:c,featureKey:d,variableKey:e})},[b]);return{getFeatureFlagVariable:c}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useFeatureVariable=useFeatureVariable;var _react=require("react"),_useKameleoon2=require("./useKameleoon");function useFeatureVariable(){var a=(0,_useKameleoon2.useKameleoon)(),b=a.client,c=(0,_react.useCallback)(function(a){var c=a.visitorCode,d=a.featureKey,e=a.variableKey;return b.getFeatureFlagVariable({visitorCode:c,featureKey:d,variableKey:e})},[b]);return{getFeatureFlagVariable:c}}
6
2
  //# sourceMappingURL=useFeatureVariable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFeatureVariable.js","names":["useFeatureVariable","a","useKameleoon","client","getFeatureFlagVariable","useCallback","visitorCode","featureKey","variableKey"],"sources":["../src/useFeatureVariable.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport {\n GetFeatureFlagVariableParamsType,\n FeatureVariableResultType,\n} from '@kameleoon/javascript-sdk-core';\nimport { useKameleoon } from './useKameleoon';\n\nexport interface IFeatureVariableHookResult {\n /**\n * Returns a variable for the visitor under `visitorCode` in the found feature flag, this method includes targeting check, finding the according variation exposed to the visitor and saving it to storage along with sending tracking request.\n *\n * @param {GetFeatureFlagVariableParamsType} params - `visitorCode`, `featureKey` and `variableKey` parameters to return variable.\n * @return {FeatureVariableResultType} a variable object containing `type` and `value` fields, `type` can be checked against `FeatureVariableType` enum, if the `type` is `FeatureVariableType.BOOLEAN` then the `value` type will be `boolean` and so on.\n * @throws `KameleoonError` with one of the following `type` s:\n *\n * - `KameleoonException.VisitorCodeMaxLength` - The visitor code length was exceeded.\n * - `KameleoonException.VisitorCodeEmpty` The visitor code is empty\n * - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`.\n * - `KameleoonException.FeatureFlagConfigurationNotFound` - No feature flag was found for provided `visitorCode` and `featureKey`.\n * - `KameleoonException.FeatureFlagVariableNotFound` - No feature variable was found for provided `visitorCode` and `variableKey`\n * - `KameleoonException.NotTargeted` - Current visitor is not targeted.\n * - `KameleoonException.JSONParse` - Couldn't pass JSON value.\n * - `KameleoonException.NumberParse` - Couldn't pass Number value.\n */\n getFeatureFlagVariable: (\n params: GetFeatureFlagVariableParamsType,\n ) => FeatureVariableResultType;\n}\n\n/**\n * A React Hook that returns `getFeatureFlagVariable` function which retrieves a feature variable.\n *\n * @returns {IPageViewHookResult} an object containing the `getFeatureFlagVariable` function.\n */\nexport function useFeatureVariable(): IFeatureVariableHookResult {\n const { client } = useKameleoon();\n\n const getFeatureFlagVariable = useCallback(\n ({\n visitorCode,\n featureKey,\n variableKey,\n }: GetFeatureFlagVariableParamsType): FeatureVariableResultType => {\n return client.getFeatureFlagVariable({\n visitorCode,\n featureKey,\n variableKey,\n });\n },\n [client],\n );\n\n return {\n getFeatureFlagVariable,\n };\n}\n"],"mappings":"uLA6BA;AACA;AACA;AACA;AACA,GACO,QAAS,CAAAA,kBAAkBA,CAAA,CAA+B,KAAAC,CAAA,CAC5C,GAAAC,2BAAY,GAAE,CAAzBC,CAAM,CAAAF,CAAA,CAANE,MAAM,CAERC,CAAsB,CAAG,GAAAC,kBAAW,EACxC,SAAAJ,CAAA,CAImE,IAHjE,CAAAK,CAAW,CAAAL,CAAA,CAAXK,WAAW,CACXC,CAAU,CAAAN,CAAA,CAAVM,UAAU,CACVC,CAAW,CAAAP,CAAA,CAAXO,WAAW,CAEX,MAAO,CAAAL,CAAM,CAACC,sBAAsB,CAAC,CACnCE,WAAW,CAAXA,CAAW,CACXC,UAAU,CAAVA,CAAU,CACVC,WAAW,CAAXA,CACF,CAAC,CACH,CAAC,CACD,CAACL,CAAM,CAAC,CACT,CAED,MAAO,CACLC,sBAAsB,CAAtBA,CACF,CACF"}
1
+ {"version":3,"file":"useFeatureVariable.js","names":["useFeatureVariable","a","useKameleoon","client","getFeatureFlagVariable","useCallback","visitorCode","featureKey","variableKey"],"sources":["../src/useFeatureVariable.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport {\n GetFeatureFlagVariableParamsType,\n FeatureVariableResultType,\n} from '@kameleoon/javascript-sdk-core';\nimport { useKameleoon } from './useKameleoon';\n\nexport interface IFeatureVariableHookResult {\n /**\n * Returns a variable for the visitor under `visitorCode` in the found feature flag, this method includes targeting check, finding the according variation exposed to the visitor and saving it to storage along with sending tracking request.\n *\n * @param {GetFeatureFlagVariableParamsType} params - `visitorCode`, `featureKey` and `variableKey` parameters to return variable.\n * @return {FeatureVariableResultType} a variable object containing `type` and `value` fields. You can check the `type` field against `FeatureVariableType` enum. For example, if the `type` is `FeatureVariableType.BOOLEAN` then `value` will be a `boolean` type.\n * @throws `KameleoonError` with one of the following `type` s:\n *\n * - `KameleoonException.VisitorCodeMaxLength` - The visitor code length was exceeded.\n * - `KameleoonException.VisitorCodeEmpty` The visitor code is empty\n * - `KameleoonException.Initialization` - Method was executed before the `kameleoonClient` completed it's `initialize` call.\n * - `KameleoonException.FeatureFlagConfigurationNotFound` - No feature flag was found for provided `featureKey`.\n * - `KameleoonException.FeatureFlagVariableNotFound` - No feature variable was found for provided `visitorCode` and `variableKey`\n * - `KameleoonException.NotTargeted` - Current visitor is not targeted.\n * - `KameleoonException.JSONParse` - Couldn't pass JSON value.\n * - `KameleoonException.NumberParse` - Couldn't pass Number value.\n */\n getFeatureFlagVariable: (\n params: GetFeatureFlagVariableParamsType,\n ) => FeatureVariableResultType;\n}\n\n/**\n * A React Hook that returns `getFeatureFlagVariable` function which retrieves a feature variable.\n *\n * @returns {IFeatureVariableHookResult} an object containing the `getFeatureFlagVariable` function.\n */\nexport function useFeatureVariable(): IFeatureVariableHookResult {\n const { client } = useKameleoon();\n\n const getFeatureFlagVariable = useCallback(\n ({\n visitorCode,\n featureKey,\n variableKey,\n }: GetFeatureFlagVariableParamsType): FeatureVariableResultType => {\n return client.getFeatureFlagVariable({\n visitorCode,\n featureKey,\n variableKey,\n });\n },\n [client],\n );\n\n return {\n getFeatureFlagVariable,\n };\n}\n"],"mappings":"uLAkCO,QAAS,CAAAA,kBAAkBA,CAAA,CAA+B,KAAAC,CAAA,CAC5C,GAAAC,2BAAY,GAAE,CAAzBC,CAAM,CAAAF,CAAA,CAANE,MAAM,CAERC,CAAsB,CAAG,GAAAC,kBAAW,EACxC,SAAAJ,CAAA,CAImE,IAHjE,CAAAK,CAAW,CAAAL,CAAA,CAAXK,WAAW,CACXC,CAAU,CAAAN,CAAA,CAAVM,UAAU,CACVC,CAAW,CAAAP,CAAA,CAAXO,WAAW,CAEX,MAAO,CAAAL,CAAM,CAACC,sBAAsB,CAAC,CACnCE,WAAW,CAAXA,CAAW,CACXC,UAAU,CAAVA,CAAU,CACVC,WAAW,CAAXA,CACF,CAAC,CACH,CAAC,CACD,CAACL,CAAM,CAAC,CACT,CAED,MAAO,CACLC,sBAAsB,CAAtBA,CACF,CACF"}
@@ -0,0 +1,25 @@
1
+ import { FeatureVariableResultType } from '@kameleoon/javascript-sdk-core';
2
+ export interface IFeatureVariablesHookResult {
3
+ /**
4
+ * Returns a list of variables for the visitor under `visitorCode` in the found feature flag, this method includes targeting check, finding the according variation exposed to the visitor and saving it to storage along with sending tracking request.
5
+ *
6
+ * @param {string} visitorCode - a unique visitor identifier, shouldn't exceed 255 characters.
7
+ * @param {string} featureKey - a unique key for feature flag.
8
+ * @return {FeatureVariableResultType[]} a list of variable objects containing `type` and `value` fields. You can check the `type` field against `FeatureVariableType` enum. For example, if the `type` is `FeatureVariableType.BOOLEAN` then `value` will be a `boolean` type.
9
+ * @throws `KameleoonError` with one of the following `type` s:
10
+ * - `KameleoonException.VisitorCodeMaxLength` - The visitor code length was exceeded
11
+ * - `KameleoonException.VisitorCodeEmpty` The visitor code is empty
12
+ * - `KameleoonException.Initialization` - Method was executed before the `kameleoonClient` completed it's `initialize` call
13
+ * - `KameleoonException.FeatureFlagConfigurationNotFound` - No feature flag was found for provided `featureKey`
14
+ * - `KameleoonException.FeatureFlagVariationNotFound` - No feature variation was found for provided `visitorCode` and `variationKey`
15
+ * - `KameleoonException.JSONParse` - Couldn't pass JSON value
16
+ * - `KameleoonException.NumberParse` - Couldn't pass Number value
17
+ */
18
+ getFeatureFlagVariables: (visitorCode: string, featureKey: string) => FeatureVariableResultType[];
19
+ }
20
+ /**
21
+ * A React Hook that returns `getFeatureFlagVariables` function which retrieves a list of feature variables.
22
+ *
23
+ * @returns {IFeatureVariablesHookResult} an object containing the `getFeatureFlagVariables` function.
24
+ */
25
+ export declare function useFeatureVariables(): IFeatureVariablesHookResult;
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useFeatureVariables=useFeatureVariables;var _react=require("react"),_useKameleoon2=require("./useKameleoon");function useFeatureVariables(){var a=(0,_useKameleoon2.useKameleoon)(),b=a.client,c=(0,_react.useCallback)(function(a,c){return b.getFeatureFlagVariables(a,c)},[b]);return{getFeatureFlagVariables:c}}
2
+ //# sourceMappingURL=useFeatureVariables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFeatureVariables.js","names":["useFeatureVariables","a","useKameleoon","client","getFeatureFlagVariables","useCallback","visitorCode","featureKey"],"sources":["../src/useFeatureVariables.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { FeatureVariableResultType } from '@kameleoon/javascript-sdk-core';\nimport { useKameleoon } from './useKameleoon';\n\nexport interface IFeatureVariablesHookResult {\n /**\n * Returns a list of variables for the visitor under `visitorCode` in the found feature flag, this method includes targeting check, finding the according variation exposed to the visitor and saving it to storage along with sending tracking request.\n *\n * @param {string} visitorCode - a unique visitor identifier, shouldn't exceed 255 characters.\n * @param {string} featureKey - a unique key for feature flag.\n * @return {FeatureVariableResultType[]} a list of variable objects containing `type` and `value` fields. You can check the `type` field against `FeatureVariableType` enum. For example, if the `type` is `FeatureVariableType.BOOLEAN` then `value` will be a `boolean` type.\n * @throws `KameleoonError` with one of the following `type` s:\n * - `KameleoonException.VisitorCodeMaxLength` - The visitor code length was exceeded\n * - `KameleoonException.VisitorCodeEmpty` The visitor code is empty\n * - `KameleoonException.Initialization` - Method was executed before the `kameleoonClient` completed it's `initialize` call\n * - `KameleoonException.FeatureFlagConfigurationNotFound` - No feature flag was found for provided `featureKey`\n * - `KameleoonException.FeatureFlagVariationNotFound` - No feature variation was found for provided `visitorCode` and `variationKey`\n * - `KameleoonException.JSONParse` - Couldn't pass JSON value\n * - `KameleoonException.NumberParse` - Couldn't pass Number value\n */\n getFeatureFlagVariables: (\n visitorCode: string,\n featureKey: string,\n ) => FeatureVariableResultType[];\n}\n\n/**\n * A React Hook that returns `getFeatureFlagVariables` function which retrieves a list of feature variables.\n *\n * @returns {IFeatureVariablesHookResult} an object containing the `getFeatureFlagVariables` function.\n */\nexport function useFeatureVariables(): IFeatureVariablesHookResult {\n const { client } = useKameleoon();\n\n const getFeatureFlagVariables = useCallback(\n (visitorCode, featureKey): FeatureVariableResultType[] => {\n return client.getFeatureFlagVariables(visitorCode, featureKey);\n },\n [client],\n );\n\n return {\n getFeatureFlagVariables,\n };\n}\n"],"mappings":"yLA+BO,QAAS,CAAAA,mBAAmBA,CAAA,CAAgC,KAAAC,CAAA,CAC9C,GAAAC,2BAAY,GAAE,CAAzBC,CAAM,CAAAF,CAAA,CAANE,MAAM,CAERC,CAAuB,CAAG,GAAAC,kBAAW,EACzC,SAACC,CAAW,CAAEC,CAAU,CAAkC,CACxD,MAAO,CAAAJ,CAAM,CAACC,uBAAuB,CAACE,CAAW,CAAEC,CAAU,CAC/D,CAAC,CACD,CAACJ,CAAM,CAAC,CACT,CAED,MAAO,CACLC,uBAAuB,CAAvBA,CACF,CACF"}
@@ -9,7 +9,7 @@ export interface IFlushHookResult {
9
9
  *
10
10
  * - `KameleoonException.VisitorCodeMaxLength` - The visitor code length was exceeded
11
11
  * - `KameleoonException.VisitorCodeEmpty` The visitor code is empty
12
- * - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`.
12
+ * - `KameleoonException.Initialization` - Method was executed before the `kameleoonClient` completed it's `initialize` call.
13
13
  */
14
14
  flush: (visitorCode: string) => void;
15
15
  }
package/dist/useFlush.js CHANGED
@@ -1,6 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useFlush=useFlush;var _react=require("react"),_useKameleoon2=require("./useKameleoon");/**
2
- * A React Hook that returns `flush` function
3
- *
4
- * @returns {IFlushHookResult} an object containing the `flush` function.
5
- */function useFlush(){var a=(0,_useKameleoon2.useKameleoon)(),b=a.client,c=(0,_react.useCallback)(function(a){b.flush(a)},[b]);return{flush:c}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useFlush=useFlush;var _react=require("react"),_useKameleoon2=require("./useKameleoon");function useFlush(){var a=(0,_useKameleoon2.useKameleoon)(),b=a.client,c=(0,_react.useCallback)(function(a){b.flush(a)},[b]);return{flush:c}}
6
2
  //# sourceMappingURL=useFlush.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFlush.js","names":["useFlush","a","useKameleoon","client","flush","useCallback","visitorCode"],"sources":["../src/useFlush.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useKameleoon } from './useKameleoon';\n\nexport interface IFlushHookResult {\n /**\n * Takes visitor associated kameleoon data and sends the data tracking request with collected data sent data is removed from `KameleoonClient` instance but not from the storage for correct targeting checks.\n * If no visitor is passed, then data for all visitors is sent and removed from `KameleoonClient` instance. Moreover, regardless of visitor code input\n * execution starts with sending all previously failed tracking requests which were stored locally during the offline mode and then proceeds further.\n *\n * @param {string | undefined} visitorCode - unique visitor identification string, can't exceed 255 characters length.\n * @throws `KameleoonError` with one of the following `type` s:\n *\n * - `KameleoonException.VisitorCodeMaxLength` - The visitor code length was exceeded\n * - `KameleoonException.VisitorCodeEmpty` The visitor code is empty\n * - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`.\n */\n flush: (visitorCode: string) => void;\n}\n\n/**\n * A React Hook that returns `flush` function\n *\n * @returns {IFlushHookResult} an object containing the `flush` function.\n */\nexport function useFlush(): IFlushHookResult {\n const { client } = useKameleoon();\n\n const flush = useCallback(\n (visitorCode: string): void => {\n client.flush(visitorCode);\n },\n [client],\n );\n\n return {\n flush,\n };\n}\n"],"mappings":"mKAmBA;AACA;AACA;AACA;AACA,GACO,QAAS,CAAAA,QAAQA,CAAA,CAAqB,KAAAC,CAAA,CACxB,GAAAC,2BAAY,GAAE,CAAzBC,CAAM,CAAAF,CAAA,CAANE,MAAM,CAERC,CAAK,CAAG,GAAAC,kBAAW,EACvB,SAACC,CAAmB,CAAW,CAC7BH,CAAM,CAACC,KAAK,CAACE,CAAW,CAC1B,CAAC,CACD,CAACH,CAAM,CAAC,CACT,CAED,MAAO,CACLC,KAAK,CAALA,CACF,CACF"}
1
+ {"version":3,"file":"useFlush.js","names":["useFlush","a","useKameleoon","client","flush","useCallback","visitorCode"],"sources":["../src/useFlush.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useKameleoon } from './useKameleoon';\n\nexport interface IFlushHookResult {\n /**\n * Takes visitor associated kameleoon data and sends the data tracking request with collected data sent data is removed from `KameleoonClient` instance but not from the storage for correct targeting checks.\n * If no visitor is passed, then data for all visitors is sent and removed from `KameleoonClient` instance. Moreover, regardless of visitor code input\n * execution starts with sending all previously failed tracking requests which were stored locally during the offline mode and then proceeds further.\n *\n * @param {string | undefined} visitorCode - unique visitor identification string, can't exceed 255 characters length.\n * @throws `KameleoonError` with one of the following `type` s:\n *\n * - `KameleoonException.VisitorCodeMaxLength` - The visitor code length was exceeded\n * - `KameleoonException.VisitorCodeEmpty` The visitor code is empty\n * - `KameleoonException.Initialization` - Method was executed before the `kameleoonClient` completed it's `initialize` call.\n */\n flush: (visitorCode: string) => void;\n}\n\n/**\n * A React Hook that returns `flush` function\n *\n * @returns {IFlushHookResult} an object containing the `flush` function.\n */\nexport function useFlush(): IFlushHookResult {\n const { client } = useKameleoon();\n\n const flush = useCallback(\n (visitorCode: string): void => {\n client.flush(visitorCode);\n },\n [client],\n );\n\n return {\n flush,\n };\n}\n"],"mappings":"mKAwBO,QAAS,CAAAA,QAAQA,CAAA,CAAqB,KAAAC,CAAA,CACxB,GAAAC,2BAAY,GAAE,CAAzBC,CAAM,CAAAF,CAAA,CAANE,MAAM,CAERC,CAAK,CAAG,GAAAC,kBAAW,EACvB,SAACC,CAAmB,CAAW,CAC7BH,CAAM,CAACC,KAAK,CAACE,CAAW,CAC1B,CAAC,CACD,CAACH,CAAM,CAAC,CACT,CAED,MAAO,CACLC,KAAK,CAALA,CACF,CACF"}
@@ -1,6 +1,2 @@
1
- "use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.useInitialize=useInitialize;var _react=require("react"),_useKameleoon2=require("./useKameleoon");function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function a(a,b,c){return Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}),a[b]}function b(a,b,c,e){var f=b&&b.prototype instanceof d?b:d,g=Object.create(f.prototype),h=new m(e||[]);return s(g,"_invoke",{value:i(a,c,h)}),g}function c(a,b,c){try{return{type:"normal",arg:a.call(b,c)}}catch(a){return{type:"throw",arg:a}}}function d(){}function e(){}function f(){}function g(b){["next","throw","return"].forEach(function(c){a(b,c,function(a){return this._invoke(c,a)})})}function h(a,b){function d(e,f,g,h){var i=c(a[e],a,f);if("throw"!==i.type){var j=i.arg,k=j.value;return k&&"object"==_typeof(k)&&r.call(k,"__await")?b.resolve(k.__await).then(function(a){d("next",a,g,h)},function(a){d("throw",a,g,h)}):b.resolve(k).then(function(a){j.value=a,g(j)},function(a){return d("throw",a,g,h)})}h(i.arg)}var e;s(this,"_invoke",{value:function value(a,c){function f(){return new b(function(b,e){d(a,c,b,e)})}return e=e?e.then(f,f):f()}})}function i(a,b,d){var e="suspendedStart";return function(f,g){if("executing"==e)throw new Error("Generator is already running");if("completed"==e){if("throw"===f)throw g;return o()}for(d.method=f,d.arg=g;;){var h=d.delegate;if(h){var i=j(h,d);if(i){if(i===x)continue;return i}}if("next"===d.method)d.sent=d._sent=d.arg;else if("throw"===d.method){if("suspendedStart"==e)throw e="completed",d.arg;d.dispatchException(d.arg)}else"return"===d.method&&d.abrupt("return",d.arg);e="executing";var k=c(a,b,d);if("normal"===k.type){if(e=d.done?"completed":"suspendedYield",k.arg===x)continue;return{value:k.arg,done:d.done}}"throw"===k.type&&(e="completed",d.method="throw",d.arg=k.arg)}}}function j(a,b){var d=b.method,e=a.iterator[d];if(void 0===e)return b.delegate=null,"throw"===d&&a.iterator.return&&(b.method="return",b.arg=void 0,j(a,b),"throw"===b.method)||"return"!==d&&(b.method="throw",b.arg=new TypeError("The iterator does not provide a '"+d+"' method")),x;var f=c(e,a.iterator,b.arg);if("throw"===f.type)return b.method="throw",b.arg=f.arg,b.delegate=null,x;var g=f.arg;return g?g.done?(b[a.resultName]=g.value,b.next=a.nextLoc,"return"!==b.method&&(b.method="next",b.arg=void 0),b.delegate=null,x):g:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,x)}function k(a){var b={tryLoc:a[0]};1 in a&&(b.catchLoc=a[1]),2 in a&&(b.finallyLoc=a[2],b.afterLoc=a[3]),this.tryEntries.push(b)}function l(a){var b=a.completion||{};b.type="normal",delete b.arg,a.completion=b}function m(a){this.tryEntries=[{tryLoc:"root"}],a.forEach(k,this),this.reset(!0)}function n(a){if(a){var b=a[u];if(b)return b.call(a);if("function"==typeof a.next)return a;if(!isNaN(a.length)){var c=-1,d=function b(){for(;++c<a.length;)if(r.call(a,c))return b.value=a[c],b.done=!1,b;return b.value=void 0,b.done=!0,b};return d.next=d}}return{next:o}}function o(){return{value:void 0,done:!0}}_regeneratorRuntime=function(){return p};var p={},q=Object.prototype,r=q.hasOwnProperty,s=Object.defineProperty||function(a,b,c){a[b]=c.value},t="function"==typeof Symbol?Symbol:{},u=t.iterator||"@@iterator",v=t.asyncIterator||"@@asyncIterator",w=t.toStringTag||"@@toStringTag";try{a({},"")}catch(b){a=function(a,b,c){return a[b]=c}}p.wrap=b;var x={},y={};a(y,u,function(){return this});var z=Object.getPrototypeOf,A=z&&z(z(n([])));A&&A!==q&&r.call(A,u)&&(y=A);var B=f.prototype=d.prototype=Object.create(y);return e.prototype=f,s(B,"constructor",{value:f,configurable:!0}),s(f,"constructor",{value:e,configurable:!0}),e.displayName=a(f,w,"GeneratorFunction"),p.isGeneratorFunction=function(a){var b="function"==typeof a&&a.constructor;return!!b&&(b===e||"GeneratorFunction"===(b.displayName||b.name))},p.mark=function(b){return Object.setPrototypeOf?Object.setPrototypeOf(b,f):(b.__proto__=f,a(b,w,"GeneratorFunction")),b.prototype=Object.create(B),b},p.awrap=function(a){return{__await:a}},g(h.prototype),a(h.prototype,v,function(){return this}),p.AsyncIterator=h,p.async=function(a,c,d,e,f){void 0===f&&(f=Promise);var g=new h(b(a,c,d,e),f);return p.isGeneratorFunction(c)?g:g.next().then(function(a){return a.done?a.value:g.next()})},g(B),a(B,w,"Generator"),a(B,u,function(){return this}),a(B,"toString",function(){return"[object Generator]"}),p.keys=function(a){var b=Object(a),c=[];for(var d in b)c.push(d);return c.reverse(),function a(){for(;c.length;){var d=c.pop();if(d in b)return a.value=d,a.done=!1,a}return a.done=!0,a}},p.values=n,m.prototype={constructor:m,reset:function reset(a){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(l),!a)for(var b in this)"t"===b.charAt(0)&&r.call(this,b)&&!isNaN(+b.slice(1))&&(this[b]=void 0)},stop:function stop(){this.done=!0;var a=this.tryEntries[0].completion;if("throw"===a.type)throw a.arg;return this.rval},dispatchException:function dispatchException(a){function b(b,d){return f.type="throw",f.arg=a,c.next=b,d&&(c.method="next",c.arg=void 0),!!d}if(this.done)throw a;for(var c=this,d=this.tryEntries.length-1;0<=d;--d){var e=this.tryEntries[d],f=e.completion;if("root"===e.tryLoc)return b("end");if(e.tryLoc<=this.prev){var g=r.call(e,"catchLoc"),h=r.call(e,"finallyLoc");if(g&&h){if(this.prev<e.catchLoc)return b(e.catchLoc,!0);if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(!g){if(!h)throw new Error("try statement without catch or finally");if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(this.prev<e.catchLoc)return b(e.catchLoc,!0)}}},abrupt:function abrupt(a,b){for(var c,d=this.tryEntries.length-1;0<=d;--d)if(c=this.tryEntries[d],c.tryLoc<=this.prev&&r.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var e=c;break}e&&("break"===a||"continue"===a)&&e.tryLoc<=b&&b<=e.finallyLoc&&(e=null);var f=e?e.completion:{};return f.type=a,f.arg=b,e?(this.method="next",this.next=e.finallyLoc,x):this.complete(f)},complete:function complete(a,b){if("throw"===a.type)throw a.arg;return"break"===a.type||"continue"===a.type?this.next=a.arg:"return"===a.type?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):"normal"===a.type&&b&&(this.next=b),x},finish:function finish(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.finallyLoc===a)return this.complete(b.completion,b.afterLoc),l(b),x},catch:function _catch(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.tryLoc===a){var d=b.completion;if("throw"===d.type){var e=d.arg;l(b)}return e}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(a,b,c){return this.delegate={iterator:n(a),resultName:b,nextLoc:c},"next"===this.method&&(this.arg=void 0),x}},p}function asyncGeneratorStep(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){return void c(a)}h.done?b(i):Promise.resolve(i).then(d,e)}function _asyncToGenerator(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){function f(a){asyncGeneratorStep(h,d,e,f,g,"next",a)}function g(a){asyncGeneratorStep(h,d,e,f,g,"throw",a)}var h=a.apply(b,c);f(void 0)})}}/**
2
- * A React Hook that returns asynchronous `initialize` function.
3
- *
4
- * @returns {IInitializeHookResult} an object containing the asynchronous `initialize` function.
5
- */function useInitialize(){var a=(0,_useKameleoon2.useKameleoon)(),b=a.client,c=(0,_react.useCallback)(/*#__PURE__*/function(){var a=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function c(a){return _regeneratorRuntime().wrap(function d(c){for(;1;)switch(c.prev=c.next){case 0:return c.next=2,b.initialize(a);case 2:return c.abrupt("return",c.sent);case 3:case"end":return c.stop();}},c)}));return function(b){return a.apply(this,arguments)}}(),[b]);return{initialize:c}}
1
+ "use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.useInitialize=useInitialize;var _react=require("react"),_useKameleoon2=require("./useKameleoon");function _regeneratorRuntime(){"use strict";function a(a,b,c){return Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}),a[b]}function b(a,b,c,e){var f=b&&b.prototype instanceof d?b:d,g=Object.create(f.prototype),h=new m(e||[]);return s(g,"_invoke",{value:i(a,c,h)}),g}function c(a,b,c){try{return{type:"normal",arg:a.call(b,c)}}catch(a){return{type:"throw",arg:a}}}function d(){}function e(){}function f(){}function g(b){["next","throw","return"].forEach(function(c){a(b,c,function(a){return this._invoke(c,a)})})}function h(a,b){function d(e,f,g,h){var i=c(a[e],a,f);if("throw"!==i.type){var j=i.arg,k=j.value;return k&&"object"==_typeof(k)&&r.call(k,"__await")?b.resolve(k.__await).then(function(a){d("next",a,g,h)},function(a){d("throw",a,g,h)}):b.resolve(k).then(function(a){j.value=a,g(j)},function(a){return d("throw",a,g,h)})}h(i.arg)}var e;s(this,"_invoke",{value:function value(a,c){function f(){return new b(function(b,e){d(a,c,b,e)})}return e=e?e.then(f,f):f()}})}function i(a,b,d){var e="suspendedStart";return function(f,g){if("executing"==e)throw new Error("Generator is already running");if("completed"==e){if("throw"===f)throw g;return o()}for(d.method=f,d.arg=g;;){var h=d.delegate;if(h){var i=j(h,d);if(i){if(i===x)continue;return i}}if("next"===d.method)d.sent=d._sent=d.arg;else if("throw"===d.method){if("suspendedStart"==e)throw e="completed",d.arg;d.dispatchException(d.arg)}else"return"===d.method&&d.abrupt("return",d.arg);e="executing";var k=c(a,b,d);if("normal"===k.type){if(e=d.done?"completed":"suspendedYield",k.arg===x)continue;return{value:k.arg,done:d.done}}"throw"===k.type&&(e="completed",d.method="throw",d.arg=k.arg)}}}function j(a,b){var d=b.method,e=a.iterator[d];if(void 0===e)return b.delegate=null,"throw"===d&&a.iterator.return&&(b.method="return",b.arg=void 0,j(a,b),"throw"===b.method)||"return"!==d&&(b.method="throw",b.arg=new TypeError("The iterator does not provide a '"+d+"' method")),x;var f=c(e,a.iterator,b.arg);if("throw"===f.type)return b.method="throw",b.arg=f.arg,b.delegate=null,x;var g=f.arg;return g?g.done?(b[a.resultName]=g.value,b.next=a.nextLoc,"return"!==b.method&&(b.method="next",b.arg=void 0),b.delegate=null,x):g:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,x)}function k(a){var b={tryLoc:a[0]};1 in a&&(b.catchLoc=a[1]),2 in a&&(b.finallyLoc=a[2],b.afterLoc=a[3]),this.tryEntries.push(b)}function l(a){var b=a.completion||{};b.type="normal",delete b.arg,a.completion=b}function m(a){this.tryEntries=[{tryLoc:"root"}],a.forEach(k,this),this.reset(!0)}function n(a){if(a){var b=a[u];if(b)return b.call(a);if("function"==typeof a.next)return a;if(!isNaN(a.length)){var c=-1,d=function b(){for(;++c<a.length;)if(r.call(a,c))return b.value=a[c],b.done=!1,b;return b.value=void 0,b.done=!0,b};return d.next=d}}return{next:o}}function o(){return{value:void 0,done:!0}}_regeneratorRuntime=function(){return p};var p={},q=Object.prototype,r=q.hasOwnProperty,s=Object.defineProperty||function(a,b,c){a[b]=c.value},t="function"==typeof Symbol?Symbol:{},u=t.iterator||"@@iterator",v=t.asyncIterator||"@@asyncIterator",w=t.toStringTag||"@@toStringTag";try{a({},"")}catch(b){a=function(a,b,c){return a[b]=c}}p.wrap=b;var x={},y={};a(y,u,function(){return this});var z=Object.getPrototypeOf,A=z&&z(z(n([])));A&&A!==q&&r.call(A,u)&&(y=A);var B=f.prototype=d.prototype=Object.create(y);return e.prototype=f,s(B,"constructor",{value:f,configurable:!0}),s(f,"constructor",{value:e,configurable:!0}),e.displayName=a(f,w,"GeneratorFunction"),p.isGeneratorFunction=function(a){var b="function"==typeof a&&a.constructor;return!!b&&(b===e||"GeneratorFunction"===(b.displayName||b.name))},p.mark=function(b){return Object.setPrototypeOf?Object.setPrototypeOf(b,f):(b.__proto__=f,a(b,w,"GeneratorFunction")),b.prototype=Object.create(B),b},p.awrap=function(a){return{__await:a}},g(h.prototype),a(h.prototype,v,function(){return this}),p.AsyncIterator=h,p.async=function(a,c,d,e,f){void 0===f&&(f=Promise);var g=new h(b(a,c,d,e),f);return p.isGeneratorFunction(c)?g:g.next().then(function(a){return a.done?a.value:g.next()})},g(B),a(B,w,"Generator"),a(B,u,function(){return this}),a(B,"toString",function(){return"[object Generator]"}),p.keys=function(a){var b=Object(a),c=[];for(var d in b)c.push(d);return c.reverse(),function a(){for(;c.length;){var d=c.pop();if(d in b)return a.value=d,a.done=!1,a}return a.done=!0,a}},p.values=n,m.prototype={constructor:m,reset:function reset(a){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(l),!a)for(var b in this)"t"===b.charAt(0)&&r.call(this,b)&&!isNaN(+b.slice(1))&&(this[b]=void 0)},stop:function stop(){this.done=!0;var a=this.tryEntries[0].completion;if("throw"===a.type)throw a.arg;return this.rval},dispatchException:function dispatchException(a){function b(b,d){return f.type="throw",f.arg=a,c.next=b,d&&(c.method="next",c.arg=void 0),!!d}if(this.done)throw a;for(var c=this,d=this.tryEntries.length-1;0<=d;--d){var e=this.tryEntries[d],f=e.completion;if("root"===e.tryLoc)return b("end");if(e.tryLoc<=this.prev){var g=r.call(e,"catchLoc"),h=r.call(e,"finallyLoc");if(g&&h){if(this.prev<e.catchLoc)return b(e.catchLoc,!0);if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(!g){if(!h)throw new Error("try statement without catch or finally");if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(this.prev<e.catchLoc)return b(e.catchLoc,!0)}}},abrupt:function abrupt(a,b){for(var c,d=this.tryEntries.length-1;0<=d;--d)if(c=this.tryEntries[d],c.tryLoc<=this.prev&&r.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var e=c;break}e&&("break"===a||"continue"===a)&&e.tryLoc<=b&&b<=e.finallyLoc&&(e=null);var f=e?e.completion:{};return f.type=a,f.arg=b,e?(this.method="next",this.next=e.finallyLoc,x):this.complete(f)},complete:function complete(a,b){if("throw"===a.type)throw a.arg;return"break"===a.type||"continue"===a.type?this.next=a.arg:"return"===a.type?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):"normal"===a.type&&b&&(this.next=b),x},finish:function finish(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.finallyLoc===a)return this.complete(b.completion,b.afterLoc),l(b),x},catch:function _catch(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.tryLoc===a){var d=b.completion;if("throw"===d.type){var e=d.arg;l(b)}return e}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(a,b,c){return this.delegate={iterator:n(a),resultName:b,nextLoc:c},"next"===this.method&&(this.arg=void 0),x}},p}function asyncGeneratorStep(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){return void c(a)}h.done?b(i):Promise.resolve(i).then(d,e)}function _asyncToGenerator(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){function f(a){asyncGeneratorStep(h,d,e,f,g,"next",a)}function g(a){asyncGeneratorStep(h,d,e,f,g,"throw",a)}var h=a.apply(b,c);f(void 0)})}}function useInitialize(){var a=(0,_useKameleoon2.useKameleoon)(),b=a.client,c=(0,_react.useCallback)(function(){var a=_asyncToGenerator(_regeneratorRuntime().mark(function c(a){return _regeneratorRuntime().wrap(function d(c){for(;1;)switch(c.prev=c.next){case 0:return c.next=2,b.initialize(a);case 2:return c.abrupt("return",c.sent);case 3:case"end":return c.stop();}},c)}));return function(b){return a.apply(this,arguments)}}(),[b]);return{initialize:c}}
6
2
  //# sourceMappingURL=useInitialize.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useInitialize.js","names":["a","b","c","Object","defineProperty","value","enumerable","configurable","writable","e","f","prototype","d","g","create","h","m","s","i","type","arg","call","forEach","_invoke","j","k","_typeof","r","resolve","__await","then","Error","o","method","delegate","x","sent","_sent","dispatchException","abrupt","done","iterator","return","TypeError","resultName","next","nextLoc","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","l","completion","reset","n","u","isNaN","length","_regeneratorRuntime","p","q","hasOwnProperty","t","Symbol","v","asyncIterator","w","toStringTag","wrap","y","z","getPrototypeOf","A","B","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","AsyncIterator","async","Promise","keys","reverse","pop","values","prev","charAt","slice","stop","rval","complete","finish","catch","_catch","delegateYield","asyncGeneratorStep","_asyncToGenerator","arguments","apply","useInitialize","useKameleoon","client","initialize","useCallback","useCache"],"sources":["../src/useInitialize.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useKameleoon } from './useKameleoon';\n\nexport interface IInitializeHookResult {\n /**\n * An asynchronous method for KameleoonClient initialization by fetching Kameleoon SDK related data from server or by retrieving data from local source if data is up-to-date or update interval has not been reached.\n *\n * @param {boolean | undefined} useCache - optional parameter for activating SDK offline mode, if `true` is passed failed polls will not return error and will use cached data if such data is available, default value is `false`. Note: if offline mode is on, SDK will still try to retrieve the latest data.\n * @throws `KameleoonError` with one of the following `type` s:\n *\n * - `KameleoonException.StorageWrite` Couldn't update storage data.\n * - `KameleoonException.ClientConfiguration` Couldn't retrieve client configuration from Kameleoon Api.\n * - `KameleoonException.MaximumRetriesReached` Maximum retries reached, request failed\n */\n initialize: () => Promise<boolean>;\n}\n\n/**\n * A React Hook that returns asynchronous `initialize` function.\n *\n * @returns {IInitializeHookResult} an object containing the asynchronous `initialize` function.\n */\nexport function useInitialize(): IInitializeHookResult {\n const { client } = useKameleoon();\n\n const initialize = useCallback(\n async (useCache?: boolean): Promise<boolean> => {\n return await client.initialize(useCache);\n },\n [client],\n );\n\n return {\n initialize,\n };\n}\n"],"mappings":"2eACA,6JAAAA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AAA4F,IAAA,MAAA5F,CAAA,EACzC,mBAAAD,CAAA,SAAAD,CAAA,CAAAwG,KAAA,MAAAD,SAAA,MACD,CAACI,CAAM,CAAC,CACT,CAED,MAAO,CACLC,UAAU,CAAVA,CACF,CACF"}
1
+ {"version":3,"file":"useInitialize.js","names":["useInitialize","a","useKameleoon","client","initialize","useCallback","_asyncToGenerator","_regeneratorRuntime","mark","c","useCache","wrap","d","prev","next","abrupt","sent","stop","b","apply","arguments"],"sources":["../src/useInitialize.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useKameleoon } from './useKameleoon';\n\nexport interface IInitializeHookResult {\n /**\n * An asynchronous method for KameleoonClient initialization by fetching Kameleoon SDK related data from server or by retrieving data from local source if data is up-to-date or update interval has not been reached.\n *\n * @param {boolean | undefined} useCache - optional parameter for activating SDK offline mode, if `true` is passed failed polls will not return error and will use cached data if such data is available, default value is `false`. Note: if offline mode is on, SDK will still try to retrieve the latest data.\n * @throws `KameleoonError` with one of the following `type` s:\n *\n * - `KameleoonException.StorageWrite` Couldn't update storage data.\n * - `KameleoonException.ClientConfiguration` Couldn't retrieve client configuration from Kameleoon Api.\n * - `KameleoonException.MaximumRetriesReached` Maximum retries reached, request failed\n */\n initialize: () => Promise<boolean>;\n}\n\n/**\n * A React Hook that returns asynchronous `initialize` function.\n *\n * @returns {IInitializeHookResult} an object containing the asynchronous `initialize` function.\n */\nexport function useInitialize(): IInitializeHookResult {\n const { client } = useKameleoon();\n\n const initialize = useCallback(\n async (useCache?: boolean): Promise<boolean> => {\n return await client.initialize(useCache);\n },\n [client],\n );\n\n return {\n initialize,\n };\n}\n"],"mappings":"s0OAsBO,QAAS,CAAAA,aAAaA,CAAA,CAA0B,KAAAC,CAAA,CAClC,GAAAC,2BAAY,GAAE,CAAzBC,CAAM,CAAAF,CAAA,CAANE,MAAM,CAERC,CAAU,CAAG,GAAAC,kBAAW,iBAAAJ,CAAA,CAAAK,iBAAA,CAAAC,mBAAA,GAAAC,IAAA,CAC5B,SAAAC,EAAOC,CAAkB,SAAAH,mBAAA,GAAAI,IAAA,UAAAC,EAAAH,CAAA,iBAAAA,CAAA,CAAAI,IAAA,CAAAJ,CAAA,CAAAK,IAAA,gBAAAL,CAAA,CAAAK,IAAA,GACVX,CAAM,CAACC,UAAU,CAACM,CAAQ,CAAC,eAAAD,CAAA,CAAAM,MAAA,UAAAN,CAAA,CAAAO,IAAA,0BAAAP,CAAA,CAAAQ,IAAA,MAAAR,CAAA,EACzC,mBAAAS,CAAA,SAAAjB,CAAA,CAAAkB,KAAA,MAAAC,SAAA,MACD,CAACjB,CAAM,CAAC,CACT,CAED,MAAO,CACLC,UAAU,CAAVA,CACF,CACF"}
@@ -1,7 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useKameleoon=useKameleoon;var _react=require("react"),_KameleoonContext=require("./KameleoonContext");/**
2
- * A React Hook that validates if context is used within a KameleoonProvider and returns it.
3
- *
4
- * @returns {IKameleoonHookResult} an object containing the `client` field.
5
- * @throws useKameleoon must be used within a KameleoonProvider.
6
- */function useKameleoon(){var a=(0,_react.useContext)(_KameleoonContext.KameleoonContext);if(!a)throw new Error("useKameleoon must be used within a KameleoonProvider");return{client:a}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useKameleoon=useKameleoon;var _react=require("react"),_KameleoonContext=require("./KameleoonContext");function useKameleoon(){var a=(0,_react.useContext)(_KameleoonContext.KameleoonContext);if(!a)throw new Error("useKameleoon must be used within a KameleoonProvider");return{client:a}}
7
2
  //# sourceMappingURL=useKameleoon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useKameleoon.js","names":["useKameleoon","context","useContext","KameleoonContext","Error","client"],"sources":["../src/useKameleoon.ts"],"sourcesContent":["import { useContext } from 'react';\nimport { KameleoonCore } from '@kameleoon/javascript-sdk-core';\nimport { KameleoonContext } from './KameleoonContext';\n\nexport interface IKameleoonHookResult {\n /** An instance of KameleoonClient. */\n client: KameleoonCore;\n}\n\n/**\n * A React Hook that validates if context is used within a KameleoonProvider and returns it.\n *\n * @returns {IKameleoonHookResult} an object containing the `client` field.\n * @throws useKameleoon must be used within a KameleoonProvider.\n */\nexport function useKameleoon(): IKameleoonHookResult {\n const context = useContext(KameleoonContext);\n\n if (!context) {\n throw new Error('useKameleoon must be used within a KameleoonProvider');\n }\n\n return {\n client: context,\n };\n}\n"],"mappings":"kLASA;AACA;AACA;AACA;AACA;AACA,GACO,QAAS,CAAAA,YAAYA,CAAA,CAAyB,CACnD,GAAM,CAAAC,CAAO,CAAG,GAAAC,iBAAU,EAACC,kCAAgB,CAAC,CAE5C,GAAI,CAACF,CAAO,CACV,KAAM,IAAI,CAAAG,KAAK,CAAC,sDAAsD,CAAC,CAGzE,MAAO,CACLC,MAAM,CAAEJ,CACV,CACF"}
1
+ {"version":3,"file":"useKameleoon.js","names":["useKameleoon","context","useContext","KameleoonContext","Error","client"],"sources":["../src/useKameleoon.ts"],"sourcesContent":["import { useContext } from 'react';\nimport { KameleoonCore } from '@kameleoon/javascript-sdk-core';\nimport { KameleoonContext } from './KameleoonContext';\n\nexport interface IKameleoonHookResult {\n /** An instance of KameleoonClient. */\n client: KameleoonCore;\n}\n\n/**\n * A React Hook that validates if context is used within a KameleoonProvider and returns it.\n *\n * @returns {IKameleoonHookResult} an object containing the `client` field.\n * @throws useKameleoon must be used within a KameleoonProvider.\n */\nexport function useKameleoon(): IKameleoonHookResult {\n const context = useContext(KameleoonContext);\n\n if (!context) {\n throw new Error('useKameleoon must be used within a KameleoonProvider');\n }\n\n return {\n client: context,\n };\n}\n"],"mappings":"kLAeO,QAAS,CAAAA,YAAYA,CAAA,CAAyB,CACnD,GAAM,CAAAC,CAAO,CAAG,GAAAC,iBAAU,EAACC,kCAAgB,CAAC,CAE5C,GAAI,CAACF,CAAO,CACV,KAAM,IAAI,CAAAG,KAAK,CAAC,sDAAsD,CAAC,CAGzE,MAAO,CACLC,MAAM,CAAEJ,CACV,CACF"}
@@ -1,6 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useNativeVisitorCode=useNativeVisitorCode;var _react=require("react"),_nativeUtils=require("./kameleoonUtils/nativeUtils");/**
2
- * A React Hook that returns `getNativeVisitorCode function which obtains the Kameleoon visitorCode.
3
- *
4
- * @returns {INativeVisitorCodeHookResult} an object containing the `getNativeVisitorCode` function.
5
- */function useNativeVisitorCode(){var a=(0,_react.useCallback)(function(a){return _nativeUtils.NativeUtils.getVisitorCode(a)},[]);return{getNativeVisitorCode:a}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useNativeVisitorCode=useNativeVisitorCode;var _react=require("react"),_nativeUtils=require("./kameleoonUtils/nativeUtils");function useNativeVisitorCode(){var a=(0,_react.useCallback)(function(a){return _nativeUtils.NativeUtils.getVisitorCode(a)},[]);return{getNativeVisitorCode:a}}
6
2
  //# sourceMappingURL=useNativeVisitorCode.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useNativeVisitorCode.js","names":["useNativeVisitorCode","getNativeVisitorCode","useCallback","defaultVisitorCode","NativeUtils","getVisitorCode"],"sources":["../src/useNativeVisitorCode.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { NativeUtils } from './kameleoonUtils/nativeUtils';\n\nexport interface INativeVisitorCodeHookResult {\n /**\n * Obtains visitor code from the storage, if no visitor code exists returns a new random visitor code (or the specified default value).\n *\n * @param {string | undefined} defaultVisitorCode - visitor code to be used instead of randomly generated visitor code in case there is no visitor code saved in storage.\n * @returns {string} result visitor code.\n */\n getNativeVisitorCode: (defaultVisitorCode?: string) => string;\n}\n\n/**\n * A React Hook that returns `getNativeVisitorCode function which obtains the Kameleoon visitorCode.\n *\n * @returns {INativeVisitorCodeHookResult} an object containing the `getNativeVisitorCode` function.\n */\nexport function useNativeVisitorCode(): INativeVisitorCodeHookResult {\n const getNativeVisitorCode = useCallback(\n (defaultVisitorCode?: string): string => {\n return NativeUtils.getVisitorCode(defaultVisitorCode);\n },\n [],\n );\n\n return {\n getNativeVisitorCode,\n };\n}\n"],"mappings":"uMAaA;AACA;AACA;AACA;AACA,GACO,QAAS,CAAAA,oBAAoBA,CAAA,CAAiC,CACnE,GAAM,CAAAC,CAAoB,CAAG,GAAAC,kBAAW,EACtC,SAACC,CAA2B,CAAa,CACvC,MAAO,CAAAC,wBAAW,CAACC,cAAc,CAACF,CAAkB,CACtD,CAAC,CACD,EAAE,CACH,CAED,MAAO,CACLF,oBAAoB,CAApBA,CACF,CACF"}
1
+ {"version":3,"file":"useNativeVisitorCode.js","names":["useNativeVisitorCode","getNativeVisitorCode","useCallback","defaultVisitorCode","NativeUtils","getVisitorCode"],"sources":["../src/useNativeVisitorCode.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { NativeUtils } from './kameleoonUtils/nativeUtils';\n\nexport interface INativeVisitorCodeHookResult {\n /**\n * Obtains visitor code from the storage, if no visitor code exists returns a new random visitor code (or the specified default value).\n *\n * @param {string | undefined} defaultVisitorCode - visitor code to be used instead of randomly generated visitor code in case there is no visitor code saved in storage.\n * @returns {string} result visitor code.\n */\n getNativeVisitorCode: (defaultVisitorCode?: string) => string;\n}\n\n/**\n * A React Hook that returns `getNativeVisitorCode function which obtains the Kameleoon visitorCode.\n *\n * @returns {INativeVisitorCodeHookResult} an object containing the `getNativeVisitorCode` function.\n */\nexport function useNativeVisitorCode(): INativeVisitorCodeHookResult {\n const getNativeVisitorCode = useCallback(\n (defaultVisitorCode?: string): string => {\n return NativeUtils.getVisitorCode(defaultVisitorCode);\n },\n [],\n );\n\n return {\n getNativeVisitorCode,\n };\n}\n"],"mappings":"uMAkBO,QAAS,CAAAA,oBAAoBA,CAAA,CAAiC,CACnE,GAAM,CAAAC,CAAoB,CAAG,GAAAC,kBAAW,EACtC,SAACC,CAA2B,CAAa,CACvC,MAAO,CAAAC,wBAAW,CAACC,cAAc,CAACF,CAAkB,CACtD,CAAC,CACD,EAAE,CACH,CAED,MAAO,CACLF,oBAAoB,CAApBA,CACF,CACF"}