@kameleoon/javascript-sdk-core 2.8.3 → 2.9.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"kameleoonClient.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","_classCallCheck","_defineProperties","_toPropertyKey","key","_createClass","_defineProperty","_toPrimitive","toPrimitive","String","Number","KameleoonClient","siteCode","configuration","internalConfiguration","ClientSettings","clientSettings","settings","externalStorage","externalEventSource","externalPackageInfo","externalRequestDispatcher","externalClientConfiguration","requester","Requester","environment","packageInfo","requestDispatcher","trackingCache","CacheManager","CACHE_CLEANUP_TIMEOUT","clientDataStorage","ExternalStorage","initialize","KameleoonStorageKey","ClientData","variationDataStorage","VariationData","offlineTrackingStorage","OfflineTracking","campaignConfiguration","CampaignConfiguration","storage","targetingCleanupInterval","targetingDataCleanupInterval","useCache","result","throw","variationConfiguration","VariationConfiguration","experiments","isOfflineModeOn","ok","addData","visitorCode","Utilities","validateVisitorCode","KameleoonError","KameleoonException","Initialization","data","Array","addTargetingData","concat","shouldAddData","getVisitorData","visitorData","parseVisitorData","_createForOfIteratorHelper","dataItem","isPersistentCustomData","triggerExperiment","experimentId","experiment","find","item","id","ExperimentConfigurationNotFound","targetingData","storedTargetingData","variationId","UNALLOCATED_VARIATION_ID","targetingResult","checkTargeting","segment","getAssociatedVariationId","else","error","NotAllocated","trackExperiment","isUnallocated","NotTargeted","updateCache","cacheManager","trackConversion","goalId","revenue","Conversion","flush","trackData","unsentDataVisitors","sendOfflineTracking","visitorCodeKey","flushData","getExperiments","map","getVisitorExperiments","isActive","experimentVariations","getAssignedVariations","experimentVariation","variationResult","getExperimentVariation","getExperimentVariationData","variation","variations","JSON","parse","customJson","err","JSONParse","VariationNotFound","getFeatureFlags","featureFlags","featureKey","getVisitorFeatureFlags","resultFeatureFlags","featureFlag","variationData","getFeatureFlagVariation","variationKey","OFF_VARIATION_KEY","featureFlagId","getFeatureFlagVariationKey","_getFeatureFlagVariation","getFeatureFlagVariable","variableKey","FeatureFlagConfigurationNotFound","variable","variables","FeatureFlagVariableNotFound","featureVariable","parseFeatureVariable","isFeatureFlagActive","getRemoteData","remoteData","onConfigurationUpdate","callback","getEngineTrackingCode","getTrackingCode","Err","withAssignment","trackRule","featureFlagVariation","Ok","exports"],"sources":["../src/kameleoonClient.ts"],"sourcesContent":["import { Err, Ok, Result } from 'ts-res';\nimport { CacheManager } from './cacheManager';\nimport { CampaignConfiguration, JSONType } from './campaignConfiguration';\nimport { ClientSettings } from './clientSettings';\nimport {\n CACHE_CLEANUP_TIMEOUT,\n OFF_VARIATION_KEY,\n UNALLOCATED_VARIATION_ID,\n} from './constants';\nimport { Conversion, KameleoonDataType } from './kameleoonData';\nimport { KameleoonError, KameleoonException } from './kameleoonError';\nimport { Requester } from './requester';\nimport {\n ClientDataType,\n KameleoonStorageKey,\n VariationDataType,\n} from './storage';\nimport { ExternalStorage } from './storage/externalStorage';\nimport {\n TrackConversionParamsType,\n ExperimentType,\n FeatureFlagType,\n GetFeatureFlagVariableParamsType,\n FeatureVariableResultType,\n SDKCoreParameters,\n TrackingCacheItemType,\n ExternalPackageInfoType,\n} from './types';\nimport { Utilities } from './utilities';\nimport {\n FeatureFlagVariationType,\n VariationConfiguration,\n} from './variationConfiguration';\nimport { OfflineTracking } from './storage/types';\n\n/**\n * @interface an interface of KameleoonClient instance\n */\nexport interface IKameleoonClient {\n /**\n * @method initialize - 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 * @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 * @returns {Promise<boolean>} Promise resolved into boolean field indicating success or fail\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(useCache?: boolean): Promise<boolean>;\n initialize(): Promise<boolean>;\n /**\n * @method addData - method for adding 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 * @param {string} visitorCode - unique visitor identification string, can't exceed 255 characters length\n * @param {KameleoonDataType[]} kameleoonData - number of instances of any type of `KameleoonData`, can be added solely in array or as a sequential arguments\n * @returns {void}\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 * @method getRemoteVisitorData - an asynchronous method for retrieving custom data for the latest visit of `visitorCode` from Kameleoon Data API and optionally adding it to the storage so that other methods could decide whether the current visitor is targeted or not.\n * @param {string} visitorCode - unique visitor identification string, can't exceed 255 characters length\n * @param {boolean | undefined} shouldAddData - optional parameter for adding retrieved data to the storage like `addData` method does, default value is `true`\n * @returns {KameleoonDataType[]} promise resolved to an array of `KameleoonData` instances, only includes custom data\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.RemoteData` - Couldn't retrieve data from Kameleoon server\n */\n getRemoteVisitorData: (\n visitorCode: string,\n shouldAddData?: boolean,\n ) => Promise<KameleoonDataType[]>;\n /**\n * @method triggerExperiment - triggers experiment by assigning the variation to the user with `visitorCode`, if the variation is already assigned just returns it's id. Note: returned id `0` indicates default variation. At the same time sends tracking request.\n * @param {string} visitorCode - unique visitor identification string, can't exceed 255 characters length\n * @param {number} experimentId - id of experiment running for the current visitor\n * @returns {number} associated variationId which is successfully searched/assigned\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.ExperimentConfigurationNotFound` No configuration found for provided `experimentId`\n * - `KameleoonException.VisitorCodeMaxLength` The visitor code length was exceeded\n * - `KameleoonException.VisitorCodeEmpty` The visitor code is empty\n * - `KameleoonException.StorageRead` Couldn't find associated experiment by provided `experimentId` and `visitorCode` inside the storage\n * - `KameleoonException.NotTargeted` Current visitor is not targeted\n * - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`\n */\n triggerExperiment: (visitorCode: string, experimentId: number) => number;\n /**\n * @method trackConversion - creates and adds `Conversion` data to the visitor with specified parameters and executes `flush`. Note: it's a helper method for the quick and convenient conversion tracking, however creating and adding `Conversion` manually allows more flexible `Conversion` with `negative` parameter\n * @param {TrackConversionParamsType} conversionParameters - `visitorCode`, `goalId` and `revenue` parameters for data tracking\n * @returns {void}\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 */\n trackConversion: ({\n visitorCode,\n goalId,\n revenue,\n }: TrackConversionParamsType) => void;\n /**\n * @method flush - takes visitor associated kameleoon data and sends the data tracking request with collected data,\n * sent data is removed from `KameleoonClient` instance but not from the storage for correct targeting checks. If no visitor is passed,\n * then data for all visitors is sent and removed from `KameleoonClient` instance. Moreover, regardless of visitor code input\n * the method first attemps to send all previously failed tracking requests which were stored locally during the offline mode.\n * @param {string | undefined} visitorCode - unique visitor identification string, can't exceed 255 characters length\n * @returns {void}\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 * @deprecated Use flush method instead.\n */\n flushData: (visitorCode: string) => void;\n /**\n * @method getExperiments - returns a list of experiments stored in the client configuration\n * @returns {ExperimentType[]} a list of all experiments items with `id` and `name` 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 getExperiments: () => ExperimentType[];\n /**\n * @method getVisitorExperiments - returns a list of experiments that the visitor with `visitorCode` is targeted by and that are *active* for the visitor (visitor will have one of the variations allocated if the experiment will be triggered).\n * @param {string} visitorCode - unique visitor identification string, can't exceed 255 characters length\n * @param {boolean | undefined} isAllocated - boolean value indicating that only experiments *allocated* for visitor will be returned. Default value is `true`\n * @returns {ExperimentType[]} a list of all experiments items with `id` and `name` fields\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 getVisitorExperiments: (\n visitorCode: string,\n isAllocated?: boolean,\n ) => ExperimentType[];\n /**\n * @method getExperimentVariationData - returns variation data in JSON format for the variation with `variationId`\n * @param {number} variationId - id of variation\n * @returns {JSONType} variation data in JSON format\n * @throws `KameleoonError` with one of the following `type` s:\n * - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`\n * - `KameleoonException.JSONParse` - Couldn't pass JSON value\n * - `KameleoonException.VariationNotFound` - No variation found for provided `variationId`\n */\n getExperimentVariationData: (variationId: number) => JSONType | null;\n /**\n * @method getFeatureFlags - returns a list of feature flags stored in the client configuration\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 * @method getVisitorFeatureFlags - returns a list of feature flags that the visitor with `visitorCode` that is targeted by and that are *active* for the visitor (visitor will have one of the variations allocated).\n * @param {string} visitorCode - unique visitor identification string, can't exceed 255 characters length\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.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.NotTargeted` - Current visitor is not targeted\n */\n getVisitorFeatureFlags: (visitorCode: string) => FeatureFlagType[];\n /**\n * @method isFeatureFlagActive - returns a boolean indicating 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 * @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 * @method getFeatureFlagVariationKey - 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 * @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 * @method getFeatureFlagVariable - 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 * @param {GetFeatureFlagVariableParamsType} parameters - an object with parameters of a type `GetFeatureFlagVariableParamsType`, see the type for details.\n * @returns {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 visitorCode,\n featureKey,\n variableKey,\n }: GetFeatureFlagVariableParamsType) => FeatureVariableResultType;\n /**\n * @method getRemoteData - returns a data which is stored for specified siteCode on a remote Kameleoon server.\n * @param {string} key - unique key that the data you try to get is associated with.\n * @returns {JSONType} - promise with retrieving data for specific key.\n * @throws `KameleoonError` with one of the following `type` s:\n *\n * - `KameleoonException.RemoteData` - Couldn't retrieve data from Kameleoon server\n */\n getRemoteData: (key: string) => Promise<JSONType>;\n /**\n * @method getEngineTrackingCode - 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 * @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 getEngineTrackingCode: (visitorCode: string) => string;\n /**\n * @method onConfigurationUpdate - fires a callback on client configuration update. Note: this method only works for server sent events of real time update.\n * @param {() => void} callback - callback function with no parameters that will be called upon configuration update\n * @returns {void}\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 * @class\n * KameleoonClient - a class for creating kameleoon client instance\n * for communicating with Kameleoon JavaScript SDK Core, when new instance is created\n */\nexport class KameleoonClient implements IKameleoonClient {\n private variationConfiguration?: VariationConfiguration;\n private campaignConfiguration: CampaignConfiguration;\n private variationDataStorage: ExternalStorage<VariationDataType>;\n private offlineTrackingStorage: ExternalStorage<OfflineTracking>;\n private trackingCache: CacheManager<TrackingCacheItemType>;\n private requester: Requester;\n private externalPackageInfo: ExternalPackageInfoType;\n private isOfflineModeOn?: boolean;\n\n /**\n * @param {SDKCoreParameters} sdkCoreParameters - parameters for initializing sdk core\n */\n constructor({\n siteCode,\n configuration,\n internalConfiguration,\n }: SDKCoreParameters) {\n const { settings: clientSettings } = new ClientSettings(\n siteCode,\n configuration,\n );\n const {\n externalStorage,\n externalEventSource,\n externalPackageInfo,\n externalRequestDispatcher,\n externalClientConfiguration,\n } = internalConfiguration;\n const requester = new Requester({\n siteCode,\n environment: clientSettings.environment,\n packageInfo: externalPackageInfo,\n requestDispatcher: externalRequestDispatcher,\n });\n const trackingCache = new CacheManager<TrackingCacheItemType>(\n CACHE_CLEANUP_TIMEOUT,\n );\n const clientDataStorage = new ExternalStorage<ClientDataType>(\n externalStorage.initialize(KameleoonStorageKey.ClientData),\n );\n const variationDataStorage = new ExternalStorage<VariationDataType>(\n externalStorage.initialize(KameleoonStorageKey.VariationData),\n );\n const offlineTrackingStorage = new ExternalStorage<OfflineTracking>(\n externalStorage.initialize(KameleoonStorageKey.OfflineTracking),\n );\n const campaignConfiguration = new CampaignConfiguration({\n settings: clientSettings,\n storage: clientDataStorage,\n requester,\n externalClientConfiguration,\n targetingCleanupInterval: configuration?.targetingDataCleanupInterval,\n offlineTrackingStorage,\n externalEventSource,\n });\n\n this.requester = requester;\n this.trackingCache = trackingCache;\n this.campaignConfiguration = campaignConfiguration;\n this.variationDataStorage = variationDataStorage;\n this.externalPackageInfo = externalPackageInfo;\n this.offlineTrackingStorage = offlineTrackingStorage;\n }\n\n public async initialize(useCache?: boolean): Promise<boolean> {\n const result = await this.campaignConfiguration.initialize(useCache);\n result.throw();\n\n const variationConfiguration = new VariationConfiguration(\n this.campaignConfiguration.experiments,\n this.variationDataStorage,\n );\n\n this.variationConfiguration = variationConfiguration;\n\n this.isOfflineModeOn = useCache;\n\n return result.ok;\n }\n\n public addData(visitorCode: string, ...data: KameleoonDataType[]): void {\n Utilities.validateVisitorCode(visitorCode).throw();\n\n if (!this.campaignConfiguration) {\n throw new KameleoonError(KameleoonException.Initialization);\n }\n\n this.campaignConfiguration.addTargetingData(visitorCode, ...data).throw();\n }\n\n public async getRemoteVisitorData(\n visitorCode: string,\n shouldAddData = true,\n ): Promise<KameleoonDataType[]> {\n const result = await this.requester.getVisitorData(visitorCode);\n const data = result.throw();\n\n const visitorData = Utilities.parseVisitorData(data);\n\n for (const dataItem of visitorData) {\n if (\n shouldAddData ||\n this.campaignConfiguration.isPersistentCustomData(dataItem)\n ) {\n this.addData(visitorCode, dataItem);\n }\n }\n\n return visitorData;\n }\n\n public triggerExperiment(visitorCode: string, experimentId: number): number {\n Utilities.validateVisitorCode(visitorCode).throw();\n\n if (!this.campaignConfiguration || !this.variationConfiguration) {\n throw new KameleoonError(KameleoonException.Initialization);\n }\n\n const experiment = this.campaignConfiguration.experiments.find(\n (item) => item.id === String(experimentId),\n );\n\n if (!experiment) {\n throw new KameleoonError(\n KameleoonException.ExperimentConfigurationNotFound,\n experimentId,\n visitorCode,\n );\n }\n\n const targetingData =\n this.campaignConfiguration.storedTargetingData[visitorCode];\n\n let variationId = UNALLOCATED_VARIATION_ID;\n\n const targetingResult = Utilities.checkTargeting({\n visitorCode,\n experimentId,\n targetingData,\n segment: experiment.segment,\n campaignConfiguration: this.campaignConfiguration,\n variationConfiguration: this.variationConfiguration,\n packageInfo: this.externalPackageInfo,\n }).throw();\n\n variationId = this.variationConfiguration\n .getAssociatedVariationId(visitorCode, experimentId)\n .else((error) => {\n if (error.type === KameleoonException.NotAllocated) {\n Utilities.trackExperiment({\n requester: this.requester,\n campaignConfiguration: this.campaignConfiguration,\n isUnallocated: true,\n variationId,\n visitorCode,\n experimentId,\n isOfflineModeOn: this.isOfflineModeOn,\n offlineTrackingStorage: this.offlineTrackingStorage,\n });\n\n return UNALLOCATED_VARIATION_ID;\n }\n\n throw error;\n });\n\n Utilities.trackExperiment({\n requester: this.requester,\n campaignConfiguration: this.campaignConfiguration,\n isUnallocated: false,\n variationId,\n visitorCode,\n experimentId,\n isOfflineModeOn: this.isOfflineModeOn,\n offlineTrackingStorage: this.offlineTrackingStorage,\n });\n\n if (!targetingResult) {\n throw new KameleoonError(KameleoonException.NotTargeted, visitorCode);\n }\n\n Utilities.updateCache({\n cacheManager: this.trackingCache,\n visitorCode,\n experimentId,\n variationId,\n });\n\n return variationId;\n }\n\n public trackConversion({\n visitorCode,\n goalId,\n revenue,\n }: TrackConversionParamsType): void {\n this.addData(visitorCode, new Conversion({ goalId, revenue }));\n this.flush(visitorCode);\n }\n\n public flush(visitorCode?: string): void {\n if (!this.campaignConfiguration) {\n throw new KameleoonError(KameleoonException.Initialization);\n }\n\n if (typeof visitorCode === 'string') {\n Utilities.validateVisitorCode(visitorCode).throw();\n }\n\n if (visitorCode) {\n Utilities.trackData({\n visitorCode,\n campaignConfiguration: this.campaignConfiguration,\n requester: this.requester,\n isOfflineModeOn: this.isOfflineModeOn,\n offlineTrackingStorage: this.offlineTrackingStorage,\n });\n return;\n }\n\n // --- Note ---\n // `Utilities.trackData` executes `Utilities.sendOfflineTracking` asynchronously at first, but\n // we need to execute `Utilities.sendOfflineTracking` even if calling `Utilities.trackData` is skipped\n // due to lack of unsent data\n if (!this.campaignConfiguration.unsentDataVisitors.length) {\n Utilities.sendOfflineTracking({\n requester: this.requester,\n storage: this.offlineTrackingStorage,\n });\n return;\n }\n\n for (const visitorCodeKey of this.campaignConfiguration\n .unsentDataVisitors) {\n Utilities.trackData({\n visitorCode: visitorCodeKey,\n campaignConfiguration: this.campaignConfiguration,\n requester: this.requester,\n isOfflineModeOn: this.isOfflineModeOn,\n offlineTrackingStorage: this.offlineTrackingStorage,\n });\n }\n }\n\n public flushData(visitorCode?: string): void {\n this.flush(visitorCode);\n }\n\n public getExperiments(): ExperimentType[] {\n if (!this.campaignConfiguration) {\n throw new KameleoonError(KameleoonException.Initialization);\n }\n\n return this.campaignConfiguration.experiments.map(({ id, name }) => ({\n id: Number(id),\n name,\n }));\n }\n\n public getVisitorExperiments(\n visitorCode: string,\n isActive = true,\n ): ExperimentType[] {\n if (!this.variationConfiguration || !this.campaignConfiguration) {\n throw new KameleoonError(KameleoonException.Initialization);\n }\n\n Utilities.validateVisitorCode(visitorCode).throw();\n\n const experiments = this.campaignConfiguration.experiments;\n const result: ExperimentType[] = [];\n\n const targetingData =\n this.campaignConfiguration.storedTargetingData[visitorCode];\n\n for (const experiment of experiments) {\n const { id, name, segment } = experiment;\n\n const targetingResult = Utilities.checkTargeting({\n targetingData,\n visitorCode,\n segment,\n variationConfiguration: this.variationConfiguration,\n campaignConfiguration: this.campaignConfiguration,\n experimentId: Number(id),\n packageInfo: this.externalPackageInfo,\n }).throw();\n\n if (!targetingResult) {\n continue;\n }\n\n // -- If `isActive=false` then return every experiment\n if (!isActive) {\n result.push({ id: Number(id), name });\n continue;\n }\n\n // -- Else first check if there are saved variations for the experiment\n // if there is at least one than it's active\n const experimentVariations =\n this.variationConfiguration.getAssignedVariations(visitorCode);\n\n if (experimentVariations.ok) {\n const experimentVariation = experimentVariations.data[experiment.id];\n\n if (experimentVariation) {\n result.push({ id: Number(id), name });\n continue;\n }\n }\n\n // -- Second check if the experiment will have an allocated variation upon triggering\n // if yes than it's active\n const variationResult =\n this.variationConfiguration.getExperimentVariation(\n visitorCode,\n experiment,\n );\n\n if (variationResult.ok) {\n result.push({ id: Number(id), name });\n }\n }\n\n return result;\n }\n\n public getExperimentVariationData(variationId: number): JSONType {\n if (!this.campaignConfiguration) {\n throw new KameleoonError(KameleoonException.Initialization);\n }\n\n const experiments = this.campaignConfiguration.experiments;\n\n for (const experiment of experiments) {\n const variation = experiment.variations.find(\n (item) => item.id === String(variationId),\n );\n\n if (variation) {\n try {\n return JSON.parse(variation.customJson);\n } catch (err) {\n throw new KameleoonError(KameleoonException.JSONParse, err);\n }\n }\n }\n\n throw new KameleoonError(KameleoonException.VariationNotFound);\n }\n\n public getFeatureFlags(): FeatureFlagType[] {\n if (!this.campaignConfiguration) {\n throw new KameleoonError(KameleoonException.Initialization);\n }\n\n return this.campaignConfiguration.featureFlags.map(\n ({ id, featureKey }) => ({ id, key: featureKey }),\n );\n }\n\n public getVisitorFeatureFlags(visitorCode: string): FeatureFlagType[] {\n if (!this.variationConfiguration || !this.campaignConfiguration) {\n throw new KameleoonError(KameleoonException.Initialization);\n }\n\n const featureFlags = this.campaignConfiguration.featureFlags;\n const resultFeatureFlags: FeatureFlagType[] = [];\n\n const targetingData =\n this.campaignConfiguration.storedTargetingData[visitorCode];\n\n for (const featureFlag of featureFlags) {\n const variationData = this.variationConfiguration\n .getFeatureFlagVariation({\n visitorCode,\n targetingData,\n featureFlag,\n campaignConfiguration: this.campaignConfiguration,\n packageInfo: this.externalPackageInfo,\n })\n .throw();\n\n if (variationData.variationKey !== OFF_VARIATION_KEY) {\n const { featureFlagId, featureKey } = variationData;\n\n resultFeatureFlags.push({ id: featureFlagId, key: featureKey });\n }\n }\n\n return resultFeatureFlags;\n }\n\n public getFeatureFlagVariationKey(\n visitorCode: string,\n featureKey: string,\n ): string {\n Utilities.validateVisitorCode(visitorCode).throw();\n\n const { variationKey } = this._getFeatureFlagVariation(\n visitorCode,\n featureKey,\n ).throw();\n\n return variationKey;\n }\n\n public getFeatureFlagVariable({\n visitorCode,\n featureKey,\n variableKey,\n }: GetFeatureFlagVariableParamsType): FeatureVariableResultType {\n Utilities.validateVisitorCode(visitorCode).throw();\n\n const { variationKey } = this._getFeatureFlagVariation(\n visitorCode,\n featureKey,\n ).throw();\n\n // --- Note ---\n // `_getFeatureFlagVariation` already checks `campaignConfiguration` initialization\n const featureFlags = (this.campaignConfiguration as CampaignConfiguration)\n .featureFlags;\n\n const featureFlag = featureFlags.find(\n (item) => item.featureKey === featureKey,\n );\n\n if (!featureFlag) {\n throw new KameleoonError(\n KameleoonException.FeatureFlagConfigurationNotFound,\n featureKey,\n visitorCode,\n );\n }\n\n const variable = featureFlag.variations\n .find((item) => item.key === variationKey)\n ?.variables.find((item) => item.key === variableKey);\n\n if (!variable) {\n throw new KameleoonError(\n KameleoonException.FeatureFlagVariableNotFound,\n variableKey,\n visitorCode,\n );\n }\n\n const featureVariable = Utilities.parseFeatureVariable(variable).throw();\n\n return featureVariable;\n }\n\n public isFeatureFlagActive(visitorCode: string, featureKey: string): boolean {\n const variationKey = this.getFeatureFlagVariationKey(\n visitorCode,\n featureKey,\n );\n\n return variationKey !== OFF_VARIATION_KEY;\n }\n\n public async getRemoteData(key: string): Promise<JSONType> {\n const remoteData = await this.requester.getRemoteData(key);\n\n return remoteData.throw();\n }\n\n public onConfigurationUpdate(callback: () => void): void {\n if (!this.campaignConfiguration) {\n throw new KameleoonError(KameleoonException.Initialization);\n }\n\n this.campaignConfiguration.onConfigurationUpdate(callback);\n }\n\n public getEngineTrackingCode(visitorCode: string): string {\n Utilities.validateVisitorCode(visitorCode).throw();\n\n return Utilities.getTrackingCode(this.trackingCache, visitorCode);\n }\n\n private _getFeatureFlagVariation(\n visitorCode: string,\n featureKey: string,\n ): Result<FeatureFlagVariationType, KameleoonError> {\n if (!this.variationConfiguration || !this.campaignConfiguration) {\n return Err(new KameleoonError(KameleoonException.Initialization));\n }\n\n const featureFlags = this.campaignConfiguration.featureFlags;\n const featureFlag = featureFlags.find(\n (item) => item.featureKey === featureKey,\n );\n\n if (!featureFlag) {\n return Err(\n new KameleoonError(\n KameleoonException.FeatureFlagConfigurationNotFound,\n featureKey,\n visitorCode,\n ),\n );\n }\n\n const targetingData =\n this.campaignConfiguration.storedTargetingData[visitorCode];\n\n const variationData = this.variationConfiguration\n .getFeatureFlagVariation({\n visitorCode,\n featureFlag,\n targetingData,\n withAssignment: true,\n campaignConfiguration: this.campaignConfiguration,\n packageInfo: this.externalPackageInfo,\n })\n .throw();\n\n const { experimentId, variationId } = variationData;\n\n if (typeof variationId === 'number' && typeof experimentId === 'number') {\n Utilities.updateCache({\n cacheManager: this.trackingCache,\n visitorCode,\n experimentId,\n variationId,\n });\n }\n\n Utilities.trackRule({\n visitorCode,\n requester: this.requester,\n featureFlagVariation: variationData,\n campaignConfiguration: this.campaignConfiguration,\n isOfflineModeOn: this.isOfflineModeOn,\n offlineTrackingStorage: this.offlineTrackingStorage,\n });\n\n return Ok(variationData);\n }\n}\n"],"mappings":"uiEACA,6JAAAA,GAAA,CAAAC,CAAA,CAAAC,CAAA,SAAAC,MAAA,CAAAC,cAAA,CAAAJ,CAAA,CAAAC,CAAA,EAAAI,KAAA,CAAAH,CAAA,CAAAI,UAAA,IAAAC,YAAA,IAAAC,QAAA,MAAAR,CAAA,CAAAC,CAAA,WAAAA,EAAAD,CAAA,CAAAC,CAAA,CAAAC,CAAA,CAAAO,CAAA,MAAAC,CAAA,CAAAT,CAAA,EAAAA,CAAA,CAAAU,SAAA,YAAAC,CAAA,CAAAX,CAAA,CAAAW,CAAA,CAAAC,CAAA,CAAAV,MAAA,CAAAW,MAAA,CAAAJ,CAAA,CAAAC,SAAA,EAAAI,CAAA,KAAAC,CAAA,CAAAP,CAAA,aAAAQ,CAAA,CAAAJ,CAAA,YAAAR,KAAA,CAAAa,CAAA,CAAAlB,CAAA,CAAAE,CAAA,CAAAa,CAAA,IAAAF,CAAA,UAAAX,EAAAF,CAAA,CAAAC,CAAA,CAAAC,CAAA,aAAAiB,IAAA,UAAAC,GAAA,CAAApB,CAAA,CAAAqB,IAAA,CAAApB,CAAA,CAAAC,CAAA,SAAAF,CAAA,SAAAmB,IAAA,SAAAC,GAAA,CAAApB,CAAA,YAAAY,EAAA,YAAAH,EAAA,YAAAC,EAAA,YAAAG,EAAAZ,CAAA,4BAAAqB,OAAA,UAAApB,CAAA,EAAAF,CAAA,CAAAC,CAAA,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CAAW,CAAC,CAEvD0E,CAAa,CAAG,IAAI,CAAChF,sBAAsB,CAC9CiF,uBAAuB,CAAC,CACvB3E,WAAW,CAAXA,CAAW,CACXyE,WAAW,CAAXA,CAAW,CACXjD,aAAa,CAAbA,CAAa,CACbyE,cAAc,GAAM,CACpB/G,qBAAqB,CAAE,IAAI,CAACA,qBAAqB,CACjDd,WAAW,CAAE,IAAI,CAACN,mBACpB,CAAC,CAAC,CACD2B,KAAK,EAAE,CAEFyB,CAAY,CAAkBwD,CAAa,CAA3CxD,YAAY,CAAEQ,CAAW,CAAKgD,CAAa,CAA7BhD,WAAW,CAoBjC,MAlB2B,QAAQ,EAA/B,MAAO,CAAAA,CAAwB,EAA4B,QAAQ,EAAhC,MAAO,CAAAR,CAAyB,EACrEjB,oBAAS,CAACqC,WAAW,CAAC,CACpBC,YAAY,CAAE,IAAI,CAACjE,aAAa,CAChC0B,WAAW,CAAXA,CAAW,CACXkB,YAAY,CAAZA,CAAY,CACZQ,WAAW,CAAXA,CACF,CAAC,CAAC,CAGJzB,oBAAS,CAACiG,SAAS,CAAC,CAClBlG,WAAW,CAAXA,CAAW,CACX/B,SAAS,CAAE,IAAI,CAACA,SAAS,CACzBkI,oBAAoB,CAAEzB,CAAa,CACnCxF,qBAAqB,CAAE,IAAI,CAACA,qBAAqB,CACjDW,eAAe,CAAE,IAAI,CAACA,eAAe,CACrCb,sBAAsB,CAAE,IAAI,CAACA,sBAC/B,CAAC,CAAC,CAEK,GAAAoH,SAAE,EAAC1B,CAAa,CACzB,CAAC,IAAAxO,CAAA,IAAAmQ,OAAA,CAAAhJ,eAAA,CAAAA,eAAA"}
1
+ {"version":3,"file":"kameleoonClient.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","_classCallCheck","_defineProperties","_toPropertyKey","key","_createClass","_defineProperty","_toPrimitive","toPrimitive","String","Number","KameleoonClient","siteCode","configuration","internalConfiguration","ClientSettings","clientSettings","settings","externalStorage","externalEventSource","externalPackageInfo","externalRequestDispatcher","externalClientConfiguration","requester","Requester","environment","packageInfo","requestDispatcher","trackingCache","CacheManager","CACHE_CLEANUP_TIMEOUT","clientDataStorage","initialize","KameleoonStorageKey","ClientData","variationDataStorage","VariationData","offlineTrackingStorage","OfflineTracking","campaignConfiguration","CampaignConfiguration","storage","targetingCleanupInterval","targetingDataCleanupInterval","useCache","result","throw","variationConfiguration","VariationConfiguration","experiments","isOfflineModeOn","ok","addData","visitorCode","Utilities","validateVisitorCode","KameleoonError","KameleoonException","Initialization","data","Array","addTargetingData","concat","shouldAddData","getVisitorData","visitorData","parseVisitorData","_createForOfIteratorHelper","dataItem","isPersistentCustomData","triggerExperiment","experimentId","experiment","find","item","id","ExperimentConfigurationNotFound","targetingData","storedTargetingData","variationId","UNALLOCATED_VARIATION_ID","targetingResult","checkTargeting","segment","getAssociatedVariationId","else","error","NotAllocated","trackExperiment","isUnallocated","NotTargeted","updateCache","cacheManager","trackConversion","goalId","revenue","Conversion","flush","trackData","unsentDataVisitors","sendOfflineTracking","visitorCodeKey","flushData","getExperiments","map","getVisitorExperiments","isActive","experimentVariations","getAssignedVariations","experimentVariation","variationResult","getExperimentVariation","getExperimentVariationData","variation","variations","JSON","parse","customJson","err","JSONParse","VariationNotFound","getFeatureFlags","featureFlags","featureKey","getVisitorFeatureFlags","resultFeatureFlags","featureFlag","variationData","getFeatureFlagVariation","variationKey","OFF_VARIATION_KEY","featureFlagId","getFeatureFlagVariationKey","_getFeatureFlagVariation","getFeatureFlagVariable","variableKey","FeatureFlagConfigurationNotFound","variable","variables","FeatureFlagVariableNotFound","featureVariable","parseFeatureVariable","isFeatureFlagActive","getRemoteData","remoteData","onConfigurationUpdate","callback","getEngineTrackingCode","getTrackingCode","Err","withAssignment","trackRule","featureFlagVariation","Ok","exports"],"sources":["../src/kameleoonClient.ts"],"sourcesContent":["import { Err, Ok, Result } from 'ts-res';\nimport { CacheManager } from './cacheManager';\nimport { CampaignConfiguration, JSONType } from './campaignConfiguration';\nimport { ClientSettings } from './clientSettings';\nimport {\n CACHE_CLEANUP_TIMEOUT,\n OFF_VARIATION_KEY,\n UNALLOCATED_VARIATION_ID,\n} from './constants';\nimport { Conversion, KameleoonDataType } from './kameleoonData';\nimport { KameleoonError, KameleoonException } from './kameleoonError';\nimport { Requester } from './requester';\nimport {\n ClientDataType,\n KameleoonStorageKey,\n VariationDataType,\n} from './storage';\nimport {\n TrackConversionParamsType,\n ExperimentType,\n FeatureFlagType,\n GetFeatureFlagVariableParamsType,\n FeatureVariableResultType,\n SDKCoreParameters,\n TrackingCacheItemType,\n ExternalPackageInfoType,\n} from './types';\nimport { Utilities } from './utilities';\nimport {\n FeatureFlagVariationType,\n VariationConfiguration,\n} from './variationConfiguration';\nimport { IExternalStorage, OfflineTracking } from './storage/types';\n\n/**\n * @interface an interface of KameleoonClient instance\n */\nexport interface IKameleoonClient {\n /**\n * @method initialize - 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 * @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 * @returns {Promise<boolean>} Promise resolved into boolean field indicating success or fail\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(useCache?: boolean): Promise<boolean>;\n initialize(): Promise<boolean>;\n /**\n * @method addData - method for adding 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 * @param {string} visitorCode - unique visitor identification string, can't exceed 255 characters length\n * @param {KameleoonDataType[]} kameleoonData - number of instances of any type of `KameleoonData`, can be added solely in array or as a sequential arguments\n * @returns {void}\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 * @method getRemoteVisitorData - an asynchronous method for retrieving custom data for the latest visit of `visitorCode` from Kameleoon Data API and optionally adding it to the storage so that other methods could decide whether the current visitor is targeted or not.\n * @param {string} visitorCode - unique visitor identification string, can't exceed 255 characters length\n * @param {boolean | undefined} shouldAddData - optional parameter for adding retrieved data to the storage like `addData` method does, default value is `true`\n * @returns {KameleoonDataType[]} promise resolved to an array of `KameleoonData` instances, only includes custom data\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.RemoteData` - Couldn't retrieve data from Kameleoon server\n */\n getRemoteVisitorData: (\n visitorCode: string,\n shouldAddData?: boolean,\n ) => Promise<KameleoonDataType[]>;\n /**\n * @method triggerExperiment - triggers experiment by assigning the variation to the user with `visitorCode`, if the variation is already assigned just returns it's id. Note: returned id `0` indicates default variation. At the same time sends tracking request.\n * @param {string} visitorCode - unique visitor identification string, can't exceed 255 characters length\n * @param {number} experimentId - id of experiment running for the current visitor\n * @returns {number} associated variationId which is successfully searched/assigned\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.ExperimentConfigurationNotFound` No configuration found for provided `experimentId`\n * - `KameleoonException.VisitorCodeMaxLength` The visitor code length was exceeded\n * - `KameleoonException.VisitorCodeEmpty` The visitor code is empty\n * - `KameleoonException.StorageRead` Couldn't find associated experiment by provided `experimentId` and `visitorCode` inside the storage\n * - `KameleoonException.NotTargeted` Current visitor is not targeted\n * - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`\n */\n triggerExperiment: (visitorCode: string, experimentId: number) => number;\n /**\n * @method trackConversion - creates and adds `Conversion` data to the visitor with specified parameters and executes `flush`. Note: it's a helper method for the quick and convenient conversion tracking, however creating and adding `Conversion` manually allows more flexible `Conversion` with `negative` parameter\n * @param {TrackConversionParamsType} conversionParameters - `visitorCode`, `goalId` and `revenue` parameters for data tracking\n * @returns {void}\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 */\n trackConversion: ({\n visitorCode,\n goalId,\n revenue,\n }: TrackConversionParamsType) => void;\n /**\n * @method flush - takes visitor associated kameleoon data and sends the data tracking request with collected data,\n * sent data is removed from `KameleoonClient` instance but not from the storage for correct targeting checks. If no visitor is passed,\n * then data for all visitors is sent and removed from `KameleoonClient` instance. Moreover, regardless of visitor code input\n * the method first attemps to send all previously failed tracking requests which were stored locally during the offline mode.\n * @param {string | undefined} visitorCode - unique visitor identification string, can't exceed 255 characters length\n * @returns {void}\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 * @deprecated Use flush method instead.\n */\n flushData: (visitorCode: string) => void;\n /**\n * @method getExperiments - returns a list of experiments stored in the client configuration\n * @returns {ExperimentType[]} a list of all experiments items with `id` and `name` 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 getExperiments: () => ExperimentType[];\n /**\n * @method getVisitorExperiments - returns a list of experiments that the visitor with `visitorCode` is targeted by and that are *active* for the visitor (visitor will have one of the variations allocated if the experiment will be triggered).\n * @param {string} visitorCode - unique visitor identification string, can't exceed 255 characters length\n * @param {boolean | undefined} isAllocated - boolean value indicating that only experiments *allocated* for visitor will be returned. Default value is `true`\n * @returns {ExperimentType[]} a list of all experiments items with `id` and `name` fields\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 getVisitorExperiments: (\n visitorCode: string,\n isAllocated?: boolean,\n ) => ExperimentType[];\n /**\n * @method getExperimentVariationData - returns variation data in JSON format for the variation with `variationId`\n * @param {number} variationId - id of variation\n * @returns {JSONType} variation data in JSON format\n * @throws `KameleoonError` with one of the following `type` s:\n * - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`\n * - `KameleoonException.JSONParse` - Couldn't pass JSON value\n * - `KameleoonException.VariationNotFound` - No variation found for provided `variationId`\n */\n getExperimentVariationData: (variationId: number) => JSONType | null;\n /**\n * @method getFeatureFlags - returns a list of feature flags stored in the client configuration\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 * @method getVisitorFeatureFlags - returns a list of feature flags that the visitor with `visitorCode` that is targeted by and that are *active* for the visitor (visitor will have one of the variations allocated).\n * @param {string} visitorCode - unique visitor identification string, can't exceed 255 characters length\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.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.NotTargeted` - Current visitor is not targeted\n */\n getVisitorFeatureFlags: (visitorCode: string) => FeatureFlagType[];\n /**\n * @method isFeatureFlagActive - returns a boolean indicating 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 * @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 * @method getFeatureFlagVariationKey - 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 * @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 * @method getFeatureFlagVariable - 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 * @param {GetFeatureFlagVariableParamsType} parameters - an object with parameters of a type `GetFeatureFlagVariableParamsType`, see the type for details.\n * @returns {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 visitorCode,\n featureKey,\n variableKey,\n }: GetFeatureFlagVariableParamsType) => FeatureVariableResultType;\n /**\n * @method getRemoteData - returns a data which is stored for specified siteCode on a remote Kameleoon server.\n * @param {string} key - unique key that the data you try to get is associated with.\n * @returns {JSONType} - promise with retrieving data for specific key.\n * @throws `KameleoonError` with one of the following `type` s:\n *\n * - `KameleoonException.RemoteData` - Couldn't retrieve data from Kameleoon server\n */\n getRemoteData: (key: string) => Promise<JSONType>;\n /**\n * @method getEngineTrackingCode - 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 * @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 getEngineTrackingCode: (visitorCode: string) => string;\n /**\n * @method onConfigurationUpdate - fires a callback on client configuration update. Note: this method only works for server sent events of real time update.\n * @param {() => void} callback - callback function with no parameters that will be called upon configuration update\n * @returns {void}\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 * @class\n * KameleoonClient - a class for creating kameleoon client instance\n * for communicating with Kameleoon JavaScript SDK Core, when new instance is created\n */\nexport class KameleoonClient implements IKameleoonClient {\n private variationConfiguration?: VariationConfiguration;\n private campaignConfiguration: CampaignConfiguration;\n private variationDataStorage: IExternalStorage<VariationDataType>;\n private offlineTrackingStorage: IExternalStorage<OfflineTracking>;\n private trackingCache: CacheManager<TrackingCacheItemType>;\n private requester: Requester;\n private externalPackageInfo: ExternalPackageInfoType;\n private isOfflineModeOn?: boolean;\n\n /**\n * @param {SDKCoreParameters} sdkCoreParameters - parameters for initializing sdk core\n */\n constructor({\n siteCode,\n configuration,\n internalConfiguration,\n }: SDKCoreParameters) {\n const { settings: clientSettings } = new ClientSettings(\n siteCode,\n configuration,\n );\n const {\n externalStorage,\n externalEventSource,\n externalPackageInfo,\n externalRequestDispatcher,\n externalClientConfiguration,\n } = internalConfiguration;\n const requester = new Requester({\n siteCode,\n environment: clientSettings.environment,\n packageInfo: externalPackageInfo,\n requestDispatcher: externalRequestDispatcher,\n });\n const trackingCache = new CacheManager<TrackingCacheItemType>(\n CACHE_CLEANUP_TIMEOUT,\n );\n\n const clientDataStorage = externalStorage.initialize<ClientDataType>(\n KameleoonStorageKey.ClientData,\n );\n const variationDataStorage = externalStorage.initialize<VariationDataType>(\n KameleoonStorageKey.VariationData,\n );\n const offlineTrackingStorage = externalStorage.initialize<OfflineTracking>(\n KameleoonStorageKey.OfflineTracking,\n );\n\n const campaignConfiguration = new CampaignConfiguration({\n settings: clientSettings,\n storage: clientDataStorage,\n requester,\n externalClientConfiguration,\n targetingCleanupInterval: configuration?.targetingDataCleanupInterval,\n offlineTrackingStorage,\n externalEventSource,\n });\n\n this.requester = requester;\n this.trackingCache = trackingCache;\n this.campaignConfiguration = campaignConfiguration;\n this.variationDataStorage = variationDataStorage;\n this.externalPackageInfo = externalPackageInfo;\n this.offlineTrackingStorage = offlineTrackingStorage;\n }\n\n public async initialize(useCache?: boolean): Promise<boolean> {\n const result = await this.campaignConfiguration.initialize(useCache);\n result.throw();\n\n const variationConfiguration = new VariationConfiguration(\n this.campaignConfiguration.experiments,\n this.variationDataStorage,\n );\n\n this.variationConfiguration = variationConfiguration;\n\n this.isOfflineModeOn = useCache;\n\n return result.ok;\n }\n\n public addData(visitorCode: string, ...data: KameleoonDataType[]): void {\n Utilities.validateVisitorCode(visitorCode).throw();\n\n if (!this.campaignConfiguration) {\n throw new KameleoonError(KameleoonException.Initialization);\n }\n\n this.campaignConfiguration.addTargetingData(visitorCode, ...data).throw();\n }\n\n public async getRemoteVisitorData(\n visitorCode: string,\n shouldAddData = true,\n ): Promise<KameleoonDataType[]> {\n const result = await this.requester.getVisitorData(visitorCode);\n const data = result.throw();\n\n const visitorData = Utilities.parseVisitorData(data);\n\n for (const dataItem of visitorData) {\n if (\n shouldAddData ||\n this.campaignConfiguration.isPersistentCustomData(dataItem)\n ) {\n this.addData(visitorCode, dataItem);\n }\n }\n\n return visitorData;\n }\n\n public triggerExperiment(visitorCode: string, experimentId: number): number {\n Utilities.validateVisitorCode(visitorCode).throw();\n\n if (!this.campaignConfiguration || !this.variationConfiguration) {\n throw new KameleoonError(KameleoonException.Initialization);\n }\n\n const experiment = this.campaignConfiguration.experiments.find(\n (item) => item.id === String(experimentId),\n );\n\n if (!experiment) {\n throw new KameleoonError(\n KameleoonException.ExperimentConfigurationNotFound,\n experimentId,\n visitorCode,\n );\n }\n\n const targetingData =\n this.campaignConfiguration.storedTargetingData[visitorCode];\n\n let variationId = UNALLOCATED_VARIATION_ID;\n\n const targetingResult = Utilities.checkTargeting({\n visitorCode,\n experimentId,\n targetingData,\n segment: experiment.segment,\n campaignConfiguration: this.campaignConfiguration,\n variationConfiguration: this.variationConfiguration,\n packageInfo: this.externalPackageInfo,\n }).throw();\n\n variationId = this.variationConfiguration\n .getAssociatedVariationId(visitorCode, experimentId)\n .else((error) => {\n if (error.type === KameleoonException.NotAllocated) {\n Utilities.trackExperiment({\n requester: this.requester,\n campaignConfiguration: this.campaignConfiguration,\n isUnallocated: true,\n variationId,\n visitorCode,\n experimentId,\n isOfflineModeOn: this.isOfflineModeOn,\n offlineTrackingStorage: this.offlineTrackingStorage,\n });\n\n return UNALLOCATED_VARIATION_ID;\n }\n\n throw error;\n });\n\n Utilities.trackExperiment({\n requester: this.requester,\n campaignConfiguration: this.campaignConfiguration,\n isUnallocated: false,\n variationId,\n visitorCode,\n experimentId,\n isOfflineModeOn: this.isOfflineModeOn,\n offlineTrackingStorage: this.offlineTrackingStorage,\n });\n\n if (!targetingResult) {\n throw new KameleoonError(KameleoonException.NotTargeted, visitorCode);\n }\n\n Utilities.updateCache({\n cacheManager: this.trackingCache,\n visitorCode,\n experimentId,\n variationId,\n });\n\n return variationId;\n }\n\n public trackConversion({\n visitorCode,\n goalId,\n revenue,\n }: TrackConversionParamsType): void {\n this.addData(visitorCode, new Conversion({ goalId, revenue }));\n this.flush(visitorCode);\n }\n\n public flush(visitorCode?: string): void {\n if (!this.campaignConfiguration) {\n throw new KameleoonError(KameleoonException.Initialization);\n }\n\n if (typeof visitorCode === 'string') {\n Utilities.validateVisitorCode(visitorCode).throw();\n }\n\n if (visitorCode) {\n Utilities.trackData({\n visitorCode,\n campaignConfiguration: this.campaignConfiguration,\n requester: this.requester,\n isOfflineModeOn: this.isOfflineModeOn,\n offlineTrackingStorage: this.offlineTrackingStorage,\n });\n return;\n }\n\n // --- Note ---\n // `Utilities.trackData` executes `Utilities.sendOfflineTracking` asynchronously at first, but\n // we need to execute `Utilities.sendOfflineTracking` even if calling `Utilities.trackData` is skipped\n // due to lack of unsent data\n if (!this.campaignConfiguration.unsentDataVisitors.length) {\n Utilities.sendOfflineTracking({\n requester: this.requester,\n storage: this.offlineTrackingStorage,\n });\n return;\n }\n\n for (const visitorCodeKey of this.campaignConfiguration\n .unsentDataVisitors) {\n Utilities.trackData({\n visitorCode: visitorCodeKey,\n campaignConfiguration: this.campaignConfiguration,\n requester: this.requester,\n isOfflineModeOn: this.isOfflineModeOn,\n offlineTrackingStorage: this.offlineTrackingStorage,\n });\n }\n }\n\n public flushData(visitorCode?: string): void {\n this.flush(visitorCode);\n }\n\n public getExperiments(): ExperimentType[] {\n if (!this.campaignConfiguration) {\n throw new KameleoonError(KameleoonException.Initialization);\n }\n\n return this.campaignConfiguration.experiments.map(({ id, name }) => ({\n id: Number(id),\n name,\n }));\n }\n\n public getVisitorExperiments(\n visitorCode: string,\n isActive = true,\n ): ExperimentType[] {\n if (!this.variationConfiguration || !this.campaignConfiguration) {\n throw new KameleoonError(KameleoonException.Initialization);\n }\n\n Utilities.validateVisitorCode(visitorCode).throw();\n\n const experiments = this.campaignConfiguration.experiments;\n const result: ExperimentType[] = [];\n\n const targetingData =\n this.campaignConfiguration.storedTargetingData[visitorCode];\n\n for (const experiment of experiments) {\n const { id, name, segment } = experiment;\n\n const targetingResult = Utilities.checkTargeting({\n targetingData,\n visitorCode,\n segment,\n variationConfiguration: this.variationConfiguration,\n campaignConfiguration: this.campaignConfiguration,\n experimentId: Number(id),\n packageInfo: this.externalPackageInfo,\n }).throw();\n\n if (!targetingResult) {\n continue;\n }\n\n // -- If `isActive=false` then return every experiment\n if (!isActive) {\n result.push({ id: Number(id), name });\n continue;\n }\n\n // -- Else first check if there are saved variations for the experiment\n // if there is at least one than it's active\n const experimentVariations =\n this.variationConfiguration.getAssignedVariations(visitorCode);\n\n if (experimentVariations.ok) {\n const experimentVariation = experimentVariations.data[experiment.id];\n\n if (experimentVariation) {\n result.push({ id: Number(id), name });\n continue;\n }\n }\n\n // -- Second check if the experiment will have an allocated variation upon triggering\n // if yes than it's active\n const variationResult =\n this.variationConfiguration.getExperimentVariation(\n visitorCode,\n experiment,\n );\n\n if (variationResult.ok) {\n result.push({ id: Number(id), name });\n }\n }\n\n return result;\n }\n\n public getExperimentVariationData(variationId: number): JSONType {\n if (!this.campaignConfiguration) {\n throw new KameleoonError(KameleoonException.Initialization);\n }\n\n const experiments = this.campaignConfiguration.experiments;\n\n for (const experiment of experiments) {\n const variation = experiment.variations.find(\n (item) => item.id === String(variationId),\n );\n\n if (variation) {\n try {\n return JSON.parse(variation.customJson);\n } catch (err) {\n throw new KameleoonError(KameleoonException.JSONParse, err);\n }\n }\n }\n\n throw new KameleoonError(KameleoonException.VariationNotFound);\n }\n\n public getFeatureFlags(): FeatureFlagType[] {\n if (!this.campaignConfiguration) {\n throw new KameleoonError(KameleoonException.Initialization);\n }\n\n return this.campaignConfiguration.featureFlags.map(\n ({ id, featureKey }) => ({ id, key: featureKey }),\n );\n }\n\n public getVisitorFeatureFlags(visitorCode: string): FeatureFlagType[] {\n if (!this.variationConfiguration || !this.campaignConfiguration) {\n throw new KameleoonError(KameleoonException.Initialization);\n }\n\n const featureFlags = this.campaignConfiguration.featureFlags;\n const resultFeatureFlags: FeatureFlagType[] = [];\n\n const targetingData =\n this.campaignConfiguration.storedTargetingData[visitorCode];\n\n for (const featureFlag of featureFlags) {\n const variationData = this.variationConfiguration\n .getFeatureFlagVariation({\n visitorCode,\n targetingData,\n featureFlag,\n campaignConfiguration: this.campaignConfiguration,\n packageInfo: this.externalPackageInfo,\n })\n .throw();\n\n if (variationData.variationKey !== OFF_VARIATION_KEY) {\n const { featureFlagId, featureKey } = variationData;\n\n resultFeatureFlags.push({ id: featureFlagId, key: featureKey });\n }\n }\n\n return resultFeatureFlags;\n }\n\n public getFeatureFlagVariationKey(\n visitorCode: string,\n featureKey: string,\n ): string {\n Utilities.validateVisitorCode(visitorCode).throw();\n\n const { variationKey } = this._getFeatureFlagVariation(\n visitorCode,\n featureKey,\n ).throw();\n\n return variationKey;\n }\n\n public getFeatureFlagVariable({\n visitorCode,\n featureKey,\n variableKey,\n }: GetFeatureFlagVariableParamsType): FeatureVariableResultType {\n Utilities.validateVisitorCode(visitorCode).throw();\n\n const { variationKey } = this._getFeatureFlagVariation(\n visitorCode,\n featureKey,\n ).throw();\n\n // --- Note ---\n // `_getFeatureFlagVariation` already checks `campaignConfiguration` initialization\n const featureFlags = (this.campaignConfiguration as CampaignConfiguration)\n .featureFlags;\n\n const featureFlag = featureFlags.find(\n (item) => item.featureKey === featureKey,\n );\n\n if (!featureFlag) {\n throw new KameleoonError(\n KameleoonException.FeatureFlagConfigurationNotFound,\n featureKey,\n visitorCode,\n );\n }\n\n const variable = featureFlag.variations\n .find((item) => item.key === variationKey)\n ?.variables.find((item) => item.key === variableKey);\n\n if (!variable) {\n throw new KameleoonError(\n KameleoonException.FeatureFlagVariableNotFound,\n variableKey,\n visitorCode,\n );\n }\n\n const featureVariable = Utilities.parseFeatureVariable(variable).throw();\n\n return featureVariable;\n }\n\n public isFeatureFlagActive(visitorCode: string, featureKey: string): boolean {\n const variationKey = this.getFeatureFlagVariationKey(\n visitorCode,\n featureKey,\n );\n\n return variationKey !== OFF_VARIATION_KEY;\n }\n\n public async getRemoteData(key: string): Promise<JSONType> {\n const remoteData = await this.requester.getRemoteData(key);\n\n return remoteData.throw();\n }\n\n public onConfigurationUpdate(callback: () => void): void {\n if (!this.campaignConfiguration) {\n throw new KameleoonError(KameleoonException.Initialization);\n }\n\n this.campaignConfiguration.onConfigurationUpdate(callback);\n }\n\n public getEngineTrackingCode(visitorCode: string): string {\n Utilities.validateVisitorCode(visitorCode).throw();\n\n return Utilities.getTrackingCode(this.trackingCache, visitorCode);\n }\n\n private _getFeatureFlagVariation(\n visitorCode: string,\n featureKey: string,\n ): Result<FeatureFlagVariationType, KameleoonError> {\n if (!this.variationConfiguration || !this.campaignConfiguration) {\n return Err(new KameleoonError(KameleoonException.Initialization));\n }\n\n const featureFlags = this.campaignConfiguration.featureFlags;\n const featureFlag = featureFlags.find(\n (item) => item.featureKey === featureKey,\n );\n\n if (!featureFlag) {\n return Err(\n new KameleoonError(\n KameleoonException.FeatureFlagConfigurationNotFound,\n featureKey,\n visitorCode,\n ),\n );\n }\n\n const targetingData =\n this.campaignConfiguration.storedTargetingData[visitorCode];\n\n const variationData = this.variationConfiguration\n .getFeatureFlagVariation({\n visitorCode,\n featureFlag,\n targetingData,\n withAssignment: true,\n campaignConfiguration: this.campaignConfiguration,\n packageInfo: this.externalPackageInfo,\n })\n .throw();\n\n const { experimentId, variationId } = variationData;\n\n if (typeof variationId === 'number' && typeof experimentId === 'number') {\n Utilities.updateCache({\n cacheManager: this.trackingCache,\n visitorCode,\n experimentId,\n variationId,\n });\n }\n\n Utilities.trackRule({\n visitorCode,\n requester: this.requester,\n featureFlagVariation: variationData,\n campaignConfiguration: this.campaignConfiguration,\n isOfflineModeOn: this.isOfflineModeOn,\n offlineTrackingStorage: this.offlineTrackingStorage,\n });\n\n return Ok(variationData);\n }\n}\n"],"mappings":"i/DACA,6JAAAA,GAAA,CAAAC,CAAA,CAA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C,WAAW,CAAC,CACpBC,YAAY,CAAE,IAAI,CAAChE,aAAa,CAChCyB,WAAW,CAAXA,CAAW,CACXkB,YAAY,CAAZA,CAAY,CACZQ,WAAW,CAAXA,CACF,CAAC,CAAC,CAGJzB,oBAAS,CAACiG,SAAS,CAAC,CAClBlG,WAAW,CAAXA,CAAW,CACX9B,SAAS,CAAE,IAAI,CAACA,SAAS,CACzBiI,oBAAoB,CAAEzB,CAAa,CACnCxF,qBAAqB,CAAE,IAAI,CAACA,qBAAqB,CACjDW,eAAe,CAAE,IAAI,CAACA,eAAe,CACrCb,sBAAsB,CAAE,IAAI,CAACA,sBAC/B,CAAC,CAAC,CAEK,GAAAoH,SAAE,EAAC1B,CAAa,CACzB,CAAC,IAAAvO,CAAA,IAAAkQ,OAAA,CAAA/I,eAAA,CAAAA,eAAA"}
@@ -9,4 +9,5 @@ export declare abstract class KameleoonUtils {
9
9
  protected generateRandomString(length: number): string;
10
10
  protected getCookieVisitorCode(cookie: string): Result<string, void>;
11
11
  protected getResultCookie({ domain, visitorCode, }: GetResultCookieParametersType): string;
12
+ protected getClientConfigurationUrl(siteCode: string): string;
12
13
  }
@@ -1,5 +1,5 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.KameleoonUtils=void 0;var _tsRes=require("ts-res"),_constants=require("./constants");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 _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}function _iterableToArrayLimit(a,b){var c=null==a?null:"undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(null!=c){var d,e,f,g,h=[],i=!0,j=!1;try{if(f=(c=c.call(a)).next,0===b){if(Object(c)!==c)return;i=!1}else for(;!(i=(d=f.call(c)).done)&&(h.push(d.value),h.length!==b);i=!0);}catch(a){j=!0,e=a}finally{try{if(!i&&null!=c.return&&(g=c.return(),Object(g)!==g))return}finally{if(j)throw e}}return h}}function _arrayWithHoles(a){if(Array.isArray(a))return 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)}/**
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.KameleoonUtils=void 0;var _tsRes=require("ts-res"),_requester=require("./requester"),_constants=require("./constants");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 _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}function _iterableToArrayLimit(a,b){var c=null==a?null:"undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(null!=c){var d,e,f,g,h=[],i=!0,j=!1;try{if(f=(c=c.call(a)).next,0===b){if(Object(c)!==c)return;i=!1}else for(;!(i=(d=f.call(c)).done)&&(h.push(d.value),h.length!==b);i=!0);}catch(a){j=!0,e=a}finally{try{if(!i&&null!=c.return&&(g=c.return(),Object(g)!==g))return}finally{if(j)throw e}}return h}}function _arrayWithHoles(a){if(Array.isArray(a))return 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)}/**
2
2
  * @abstract
3
3
  * KameleoonUtils - an abstract class for extending kameleoon utils with pre-defined method signatures
4
- * */var KameleoonUtils=/*#__PURE__*/function(){function a(){_classCallCheck(this,a)}return _createClass(a,[{key:"generateRandomString",value:function generateRandomString(a){var b="";if(0>a)return b;for(var c=0;c<a;c++)b+="abcdefghijklmnopqrstuvwxyz0123456789"[Math.floor(36*Math.random())];return b}},{key:"getCookieVisitorCode",value:function getCookieVisitorCode(a){var b=a.split(_constants.Cookie.PairsDelimiter),c=b.find(function(a){var b=a.split(_constants.Cookie.KeyValueDelimiter),c=_slicedToArray(b,2),d=c[0],e=c[1];return d===_constants.KAMELEOON_COOKIE_KEY});if(c){var d=c.split(_constants.Cookie.KeyValueDelimiter),e=_slicedToArray(d,2),f=e[0],g=e[1];return(0,_tsRes.Ok)(g)}return(0,_tsRes.Err)()}},{key:"getResultCookie",value:function getResultCookie(a){var b=a.domain,c=a.visitorCode,d=[_constants.KAMELEOON_COOKIE_KEY+_constants.Cookie.KeyValueDelimiter+c,_constants.Cookie.MaxAge+_constants.Cookie.KeyValueDelimiter+31536000,_constants.Cookie.Path+_constants.Cookie.KeyValueDelimiter+"/",_constants.Cookie.Domain+_constants.Cookie.KeyValueDelimiter+b];return d.join(_constants.Cookie.PairsDelimiter)}}]),a}();exports.KameleoonUtils=KameleoonUtils;
4
+ * */var KameleoonUtils=/*#__PURE__*/function(){function a(){_classCallCheck(this,a)}return _createClass(a,[{key:"generateRandomString",value:function generateRandomString(a){var b="";if(0>a)return b;for(var c=0;c<a;c++)b+="abcdefghijklmnopqrstuvwxyz0123456789"[Math.floor(36*Math.random())];return b}},{key:"getCookieVisitorCode",value:function getCookieVisitorCode(a){var b=a.split(_constants.Cookie.PairsDelimiter),c=b.find(function(a){var b=a.split(_constants.Cookie.KeyValueDelimiter),c=_slicedToArray(b,2),d=c[0],e=c[1];return d===_constants.KAMELEOON_COOKIE_KEY});if(c){var d=c.split(_constants.Cookie.KeyValueDelimiter),e=_slicedToArray(d,2),f=e[0],g=e[1];return(0,_tsRes.Ok)(g)}return(0,_tsRes.Err)()}},{key:"getResultCookie",value:function getResultCookie(a){var b=a.domain,c=a.visitorCode,d=[_constants.KAMELEOON_COOKIE_KEY+_constants.Cookie.KeyValueDelimiter+c,_constants.Cookie.MaxAge+_constants.Cookie.KeyValueDelimiter+31536000,_constants.Cookie.Path+_constants.Cookie.KeyValueDelimiter+"/",_constants.Cookie.Domain+_constants.Cookie.KeyValueDelimiter+b];return d.join(_constants.Cookie.PairsDelimiter)}},{key:"getClientConfigurationUrl",value:function getClientConfigurationUrl(a){return _requester.URL.CLIENT_CONFIGURATION+_requester.UrlQuery.Mobile+a}}]),a}();exports.KameleoonUtils=KameleoonUtils;
5
5
  //# sourceMappingURL=kameleoonUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"kameleoonUtils.js","names":["KameleoonUtils","a","_classCallCheck","_createClass","key","value","generateRandomString","length","randomString","i","Math","floor","random","getCookieVisitorCode","cookie","pairs","split","Cookie","PairsDelimiter","pair","find","b","KeyValueDelimiter","c","_slicedToArray","_","KAMELEOON_COOKIE_KEY","d","e","Ok","Err","getResultCookie","domain","visitorCode","cookieArray","MaxAge","Path","Domain","join","exports"],"sources":["../src/kameleoonUtils.ts"],"sourcesContent":["import { Err, Ok, Result } from 'ts-res';\nimport { Cookie, KAMELEOON_COOKIE_KEY } from './constants';\nimport {\n GetResultCookieParametersType,\n ClientGetVisitorCodeParametersType,\n ServerGetVisitorCodeParametersType,\n MobileGetVisitorCodeParametersType,\n} from './types';\n\n/**\n * @abstract\n * KameleoonUtils - an abstract class for extending kameleoon utils with pre-defined method signatures\n * */\nexport abstract class KameleoonUtils {\n abstract getVisitorCode(\n param:\n | ClientGetVisitorCodeParametersType\n | ServerGetVisitorCodeParametersType\n | MobileGetVisitorCodeParametersType,\n ): string;\n\n protected generateRandomString(length: number): string {\n const characters = 'abcdefghijklmnopqrstuvwxyz0123456789';\n let randomString = '';\n\n if (length < 0) {\n return randomString;\n }\n\n for (let i = 0; i < length; i++) {\n randomString += characters[Math.floor(Math.random() * characters.length)];\n }\n\n return randomString;\n }\n\n protected getCookieVisitorCode(cookie: string): Result<string, void> {\n const pairs = cookie.split(Cookie.PairsDelimiter);\n const pair = pairs.find((pair) => {\n const [key, _] = pair.split(Cookie.KeyValueDelimiter) as [string, string];\n\n return key === KAMELEOON_COOKIE_KEY;\n });\n\n if (pair) {\n const [_, value] = pair.split(Cookie.KeyValueDelimiter);\n\n return Ok(value);\n }\n\n return Err();\n }\n\n protected getResultCookie({\n domain,\n visitorCode,\n }: GetResultCookieParametersType): string {\n const yearSeconds = 60 * 60 * 24 * 365;\n const cookieArray = [\n KAMELEOON_COOKIE_KEY + Cookie.KeyValueDelimiter + visitorCode,\n Cookie.MaxAge + Cookie.KeyValueDelimiter + yearSeconds,\n Cookie.Path + Cookie.KeyValueDelimiter + '/',\n Cookie.Domain + Cookie.KeyValueDelimiter + domain,\n ];\n\n return cookieArray.join(Cookie.PairsDelimiter);\n }\n}\n"],"mappings":"69EASA;AACA;AACA;AACA,KAHA,GAIsB,CAAAA,cAAc,kCAAAC,EAAA,EAAAC,eAAA,MAAAD,CAAA,SAAAE,YAAA,CAAAF,CAAA,GAAAG,GAAA,wBAAAC,KAAA,CAQlC,SAAAC,qBAA+BC,CAAc,CAAU,IAEjD,CAAAC,CAAY,CAAG,EAAE,CAErB,GAAa,CAAC,CAAVD,CAAU,CACZ,MAAO,CAAAC,CAAY,CAGrB,IAAK,GAAI,CAAAC,CAAC,CAAG,CAAC,CAAEA,CAAC,CAAGF,CAAM,CAAEE,CAAC,EAAE,CAC7BD,CAAY,EAAI,uCAAWE,IAAI,CAACC,KAAK,CAAC,GAAAD,IAAI,CAACE,MAAM,EAAsB,CAAC,C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AACI,IAAI,CAACrB,iBAAM,CAACC,cAAc,CAC/C,CAAC,IAAAjB,CAAA,IAAAsC,OAAA,CAAAvC,cAAA,CAAAA,cAAA"}
1
+ {"version":3,"file":"kameleoonUtils.js","names":["KameleoonUtils","a","_classCallCheck","_createClass","key","value","generateRandomString","length","randomString","i","Math","floor","random","getCookieVisitorCode","cookie","pairs","split","Cookie","PairsDelimiter","pair","find","b","KeyValueDelimiter","c","_slicedToArray","_","KAMELEOON_COOKIE_KEY","d","e","Ok","Err","getResultCookie","domain","visitorCode","cookieArray","MaxAge","Path","Domain","join","getClientConfigurationUrl","siteCode","URL","CLIENT_CONFIGURATION","UrlQuery","Mobile","exports"],"sources":["../src/kameleoonUtils.ts"],"sourcesContent":["import { Err, Ok, Result } from 'ts-res';\nimport { URL, UrlQuery } from './requester';\nimport { Cookie, KAMELEOON_COOKIE_KEY } from './constants';\nimport {\n GetResultCookieParametersType,\n ClientGetVisitorCodeParametersType,\n ServerGetVisitorCodeParametersType,\n MobileGetVisitorCodeParametersType,\n} from './types';\n\n/**\n * @abstract\n * KameleoonUtils - an abstract class for extending kameleoon utils with pre-defined method signatures\n * */\nexport abstract class KameleoonUtils {\n abstract getVisitorCode(\n param:\n | ClientGetVisitorCodeParametersType\n | ServerGetVisitorCodeParametersType\n | MobileGetVisitorCodeParametersType,\n ): string;\n\n protected generateRandomString(length: number): string {\n const characters = 'abcdefghijklmnopqrstuvwxyz0123456789';\n let randomString = '';\n\n if (length < 0) {\n return randomString;\n }\n\n for (let i = 0; i < length; i++) {\n randomString += characters[Math.floor(Math.random() * characters.length)];\n }\n\n return randomString;\n }\n\n protected getCookieVisitorCode(cookie: string): Result<string, void> {\n const pairs = cookie.split(Cookie.PairsDelimiter);\n const pair = pairs.find((pair) => {\n const [key, _] = pair.split(Cookie.KeyValueDelimiter) as [string, string];\n\n return key === KAMELEOON_COOKIE_KEY;\n });\n\n if (pair) {\n const [_, value] = pair.split(Cookie.KeyValueDelimiter);\n\n return Ok(value);\n }\n\n return Err();\n }\n\n protected getResultCookie({\n domain,\n visitorCode,\n }: GetResultCookieParametersType): string {\n const yearSeconds = 60 * 60 * 24 * 365;\n const cookieArray = [\n KAMELEOON_COOKIE_KEY + Cookie.KeyValueDelimiter + visitorCode,\n Cookie.MaxAge + Cookie.KeyValueDelimiter + yearSeconds,\n Cookie.Path + Cookie.KeyValueDelimiter + '/',\n Cookie.Domain + Cookie.KeyValueDelimiter + domain,\n ];\n\n return cookieArray.join(Cookie.PairsDelimiter);\n }\n\n protected getClientConfigurationUrl(siteCode: string): string {\n return URL.CLIENT_CONFIGURATION + UrlQuery.Mobile + siteCode;\n }\n}\n"],"mappings":"+/EAUA;AACA;AACA;AACA,KAHA,GAIsB,CAAAA,cAAc,kCAAAC,EAAA,EAAAC,eAAA,MAAAD,CAAA,SAAAE,YAAA,CAAAF,CAAA,GAAAG,GAAA,wBAAAC,KAAA,CAQlC,SAAAC,qBAA+BC,CAAc,CAAU,IAEjD,CAAAC,CAAY,CAAG,EAAE,CAErB,GAAa,CAAC,CAAVD,CAAU,CACZ,MAAO,CAAAC,CAAY,CAGrB,IAAK,GAAI,CAAAC,CAAC,CAAG,CAAC,CAAEA,CAAC,CAAGF,CAAM,CAAEE,CAAC,EAAE,CAC7BD,CAAY,EAAI,uCAAWE,IAAI,CAACC,KAAK,CAAC,GAAAD,IAAI,CAACE,MAAM,EAAsB,CAAC,CAAC,CAG3E,MAAO,CAAAJ,CACT,CAAC,GAAAJ,GAAA,wBAAAC,KAAA,CAED,SAAAQ,qBAA+BC,CAAc,CAAwB,IAC7D,CAAAC,CAAK,CAAGD,CAAM,CAACE,KAAK,CAACC,iBAAM,CAACC,cAAc,CAAC,CAC3CC,CAAI,CAAGJ,CAAK,CAACK,IAAI,CAAC,SAACD,CAAI,CAAK,CAChC,IAAAE,CAAA,CAAiBF,CAAI,CAACH,KAAK,CAACC,iBAAM,CAACK,iBAAiB,CAAC,CAAAC,CAAA,CAAAC,cAAA,CAAAH,CAAA,IAA9CjB,CAAG,CAAAmB,CAAA,IAAEE,CAAC,CAAAF,CAAA,IAEb,MAAO,CAAAnB,CAAG,GAAKsB,+BACjB,CAAC,CAAC,CAEF,GAAIP,CAAI,CAAE,CACR,IAAAQ,CAAA,CAAmBR,CAAI,CAACH,KAAK,CAACC,iBAAM,CAACK,iBAAiB,CAAC,CAAAM,CAAA,CAAAJ,cAAA,CAAAG,CAAA,IAAhDF,CAAC,CAAAG,CAAA,IAAEvB,CAAK,CAAAuB,CAAA,IAEf,MAAO,GAAAC,SAAE,EAACxB,CAAK,CACjB,CAEA,MAAO,GAAAyB,UAAG,GACZ,CAAC,GAAA1B,GAAA,mBAAAC,KAAA,CAED,SAAA0B,gBAAA9B,CAAA,CAG0C,IAFxC,CAAA+B,CAAM,CAAA/B,CAAA,CAAN+B,MAAM,CACNC,CAAW,CAAAhC,CAAA,CAAXgC,WAAW,CAGLC,CAAW,CAAG,CAClBR,+BAAoB,CAAGT,iBAAM,CAACK,iBAAiB,CAAGW,CAAW,CAC7DhB,iBAAM,CAACkB,MAAM,CAAGlB,iBAAM,CAACK,iBAAiB,SAAc,CACtDL,iBAAM,CAACmB,IAAI,CAAGnB,iBAAM,CAACK,iBAAiB,CAAG,GAAG,CAC5CL,iBAAM,CAACoB,MAAM,CAAGpB,iBAAM,CAACK,iBAAiB,CAAGU,CAAM,CAClD,CAED,MAAO,CAAAE,CAAW,CAACI,IAAI,CAACrB,iBAAM,CAACC,cAAc,CAC/C,CAAC,GAAAd,GAAA,6BAAAC,KAAA,CAED,SAAAkC,0BAAoCC,CAAgB,CAAU,CAC5D,MAAO,CAAAC,cAAG,CAACC,oBAAoB,CAAGC,mBAAQ,CAACC,MAAM,CAAGJ,CACtD,CAAC,IAAAvC,CAAA,IAAA4C,OAAA,CAAA7C,cAAA,CAAAA,cAAA"}
@@ -1,3 +1,2 @@
1
1
  export { KameleoonStorageKey } from './constants';
2
- export { ExternalStorage } from './externalStorage';
3
- export { IStorage, ClientDataType, IExternalStorage, VariationDataType, ExperimentVariationsType, IExternalStorageConstructor, } from './types';
2
+ export { ClientDataType, IExternalStorage, VariationDataType, StorageDataType, ExperimentVariationsType, IExternalStorageConstructor, } from './types';
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"ClientDataType",{enumerable:!0,get:function get(){return _types.ClientDataType}}),Object.defineProperty(exports,"ExperimentVariationsType",{enumerable:!0,get:function get(){return _types.ExperimentVariationsType}}),Object.defineProperty(exports,"ExternalStorage",{enumerable:!0,get:function get(){return _externalStorage.ExternalStorage}}),Object.defineProperty(exports,"IExternalStorage",{enumerable:!0,get:function get(){return _types.IExternalStorage}}),Object.defineProperty(exports,"IExternalStorageConstructor",{enumerable:!0,get:function get(){return _types.IExternalStorageConstructor}}),Object.defineProperty(exports,"IStorage",{enumerable:!0,get:function get(){return _types.IStorage}}),Object.defineProperty(exports,"KameleoonStorageKey",{enumerable:!0,get:function get(){return _constants.KameleoonStorageKey}}),Object.defineProperty(exports,"VariationDataType",{enumerable:!0,get:function get(){return _types.VariationDataType}});var _constants=require("./constants"),_externalStorage=require("./externalStorage"),_types=require("./types");
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"ClientDataType",{enumerable:!0,get:function get(){return _types.ClientDataType}}),Object.defineProperty(exports,"ExperimentVariationsType",{enumerable:!0,get:function get(){return _types.ExperimentVariationsType}}),Object.defineProperty(exports,"IExternalStorage",{enumerable:!0,get:function get(){return _types.IExternalStorage}}),Object.defineProperty(exports,"IExternalStorageConstructor",{enumerable:!0,get:function get(){return _types.IExternalStorageConstructor}}),Object.defineProperty(exports,"KameleoonStorageKey",{enumerable:!0,get:function get(){return _constants.KameleoonStorageKey}}),Object.defineProperty(exports,"StorageDataType",{enumerable:!0,get:function get(){return _types.StorageDataType}}),Object.defineProperty(exports,"VariationDataType",{enumerable:!0,get:function get(){return _types.VariationDataType}});var _constants=require("./constants"),_types=require("./types");
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/storage/index.ts"],"sourcesContent":["export { KameleoonStorageKey } from './constants';\nexport { ExternalStorage } from './externalStorage';\nexport {\n IStorage,\n ClientDataType,\n IExternalStorage,\n VariationDataType,\n ExperimentVariationsType,\n IExternalStorageConstructor,\n} from './types';\n"],"mappings":""}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/storage/index.ts"],"sourcesContent":["export { KameleoonStorageKey } from './constants';\nexport {\n ClientDataType,\n IExternalStorage,\n VariationDataType,\n StorageDataType,\n ExperimentVariationsType,\n IExternalStorageConstructor,\n} from './types';\n"],"mappings":""}
@@ -23,41 +23,46 @@ export type OfflineTracking = {
23
23
  isExperiment: boolean;
24
24
  }>;
25
25
  };
26
- export type StorageDataType = ClientDataType | VariationDataType | OfflineTracking;
27
- export interface IStorage<T> {
28
- read: () => Result<T, KameleoonError>;
29
- write: (data: T) => Result<void, KameleoonError>;
30
- }
26
+ /**
27
+ * @type StorageDataType - an enumeration type which represents a data stored on SDK storage
28
+ *
29
+ * `string` represents visitor code storage with only one string value
30
+ * */
31
+ export type StorageDataType = ClientDataType | VariationDataType | OfflineTracking | string;
31
32
  /**
32
33
  * @interface an interface of External Constructor for Storage which must be implemented by the wrapper constructor to initialize new `IExternalStorage` in order to be able to pass necessary initialization parameters
33
34
  * */
34
35
  export interface IExternalStorageConstructor {
35
36
  /**
36
- * @method initialize - creates and instance of `IExternalStorage` and returns it
37
+ * @method initialize - creates and instance of `IExternalStorage<StorageDataType>` and returns it
38
+ *
39
+ * Generic needs to be specified with a type for TypeScript to be able to infer concrete type based on enum variant
37
40
  * @param {KameleoonStorageKey} key - an enum variant containing keys for Kameleoon SDK related data stored on storage
38
- * @returns {IExternalEventSource} an initialized instance of `IExternalEventSource`
41
+ * @returns {IExternalStorage<StorageDataType>} an initialized instance of `IExternalStorage<StorageDataType>`
39
42
  * */
40
- initialize: (key: KameleoonStorageKey) => IExternalStorage;
43
+ initialize: <T extends StorageDataType>(key: KameleoonStorageKey) => IExternalStorage<T>;
41
44
  }
42
45
  /**
43
46
  * @interface an interface of External Storage which must be implemented to be used as external storage for initialized JS SDK Core.
44
- * Note: Only React Native SDK supports external storage for the moment
47
+ *
48
+ * Generic `StorageDataType` needs to be specified with a type for TypeScript to be able to infer concrete type based on enum variant
49
+ * However it's not constrained strictly by `StorageDataType` to let implementer use storage as a generic for other types
45
50
  * */
46
- export interface IExternalStorage {
51
+ export interface IExternalStorage<T> {
47
52
  /**
48
53
  * @property key - an Enum `KameleoonStorageKey` variant containing a key for Kameleoon SDK related data stored on storage
49
54
  * */
50
55
  readonly key: KameleoonStorageKey;
51
56
  /**
52
57
  * @method read - reads data from the storage
53
- * @returns {Result<string, KameleoonError>} result with an `ok` boolean field indicated success or error. If result is ok contains `data` field with a type `string`, if not contains `error` field with a type of `KameleoonError`
58
+ * @returns {Result<T, KameleoonError>} result with an `ok` boolean field indicated success or error. If result is ok contains `data` field with a type `T`, if not contains `error` field with a type of `KameleoonError`
54
59
  * */
55
- read: () => Result<string, KameleoonError>;
60
+ read: () => Result<T, KameleoonError>;
56
61
  /**
57
62
  * @method write - writes data to storage
58
- * @param {string} data - string representation of data
63
+ * @param {T} data - representation of any generic data type
59
64
  * @returns {Result<void, KameleoonError>} result with an `ok` boolean field indicated success or error. If result is ok contains an empty `data`, if not contains `error` field with a type of `KameleoonError`
60
65
  * */
61
- write: (data: string) => Result<void, KameleoonError>;
66
+ write: (data: T) => Result<void, KameleoonError>;
62
67
  }
63
68
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/storage/types.ts"],"sourcesContent":["import { Result } from 'ts-res';\nimport { ConfigurationDataType } from 'src/campaignConfiguration';\nimport { KameleoonError } from 'src/kameleoonError';\nimport { VariationType } from 'src/variationConfiguration';\nimport { KameleoonStorageKey } from './constants';\nimport { TargetingDataType } from 'src/targeting';\nimport {\n TrackDataParamsType,\n TrackExperimentParamsType,\n} from 'src/requester/types';\n\nexport type ClientDataType = {\n kameleoonTargetingData: TargetingDataType;\n kameleoonConfiguration: ConfigurationDataType;\n lastUpdate: string;\n};\n\nexport type ExperimentVariationsType = {\n [experimentId: string]: VariationType;\n};\n\nexport type VariationDataType = {\n [visitorCode: string]: ExperimentVariationsType;\n};\n\ntype OfflineTrackingParameters =\n | TrackDataParamsType\n | TrackExperimentParamsType;\n\nexport type OfflineTracking = {\n requestParameters?: Array<\n OfflineTrackingParameters & { timestamp: number; isExperiment: boolean }\n >;\n};\n\nexport type StorageDataType =\n | ClientDataType\n | VariationDataType\n | OfflineTracking;\n\nexport interface IStorage<T> {\n read: () => Result<T, KameleoonError>;\n write: (data: T) => Result<void, KameleoonError>;\n}\n\n/**\n * @interface an interface of External Constructor for Storage which must be implemented by the wrapper constructor to initialize new `IExternalStorage` in order to be able to pass necessary initialization parameters\n * */\nexport interface IExternalStorageConstructor {\n /**\n * @method initialize - creates and instance of `IExternalStorage` and returns it\n * @param {KameleoonStorageKey} key - an enum variant containing keys for Kameleoon SDK related data stored on storage\n * @returns {IExternalEventSource} an initialized instance of `IExternalEventSource`\n * */\n initialize: (key: KameleoonStorageKey) => IExternalStorage;\n}\n\n/**\n * @interface an interface of External Storage which must be implemented to be used as external storage for initialized JS SDK Core.\n * Note: Only React Native SDK supports external storage for the moment\n * */\nexport interface IExternalStorage {\n /**\n * @property key - an Enum `KameleoonStorageKey` variant containing a key for Kameleoon SDK related data stored on storage\n * */\n readonly key: KameleoonStorageKey;\n /**\n * @method read - reads data from the storage\n * @returns {Result<string, KameleoonError>} result with an `ok` boolean field indicated success or error. If result is ok contains `data` field with a type `string`, if not contains `error` field with a type of `KameleoonError`\n * */\n read: () => Result<string, KameleoonError>;\n /**\n * @method write - writes data to storage\n * @param {string} data - string representation of data\n * @returns {Result<void, KameleoonError>} result with an `ok` boolean field indicated success or error. If result is ok contains an empty `data`, if not contains `error` field with a type of `KameleoonError`\n * */\n write: (data: string) => Result<void, KameleoonError>;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/storage/types.ts"],"sourcesContent":["import { Result } from 'ts-res';\nimport { ConfigurationDataType } from 'src/campaignConfiguration';\nimport { KameleoonError } from 'src/kameleoonError';\nimport { VariationType } from 'src/variationConfiguration';\nimport { KameleoonStorageKey } from './constants';\nimport { TargetingDataType } from 'src/targeting';\nimport {\n TrackDataParamsType,\n TrackExperimentParamsType,\n} from 'src/requester/types';\n\nexport type ClientDataType = {\n kameleoonTargetingData: TargetingDataType;\n kameleoonConfiguration: ConfigurationDataType;\n lastUpdate: string;\n};\n\nexport type ExperimentVariationsType = {\n [experimentId: string]: VariationType;\n};\n\nexport type VariationDataType = {\n [visitorCode: string]: ExperimentVariationsType;\n};\n\ntype OfflineTrackingParameters =\n | TrackDataParamsType\n | TrackExperimentParamsType;\n\nexport type OfflineTracking = {\n requestParameters?: Array<\n OfflineTrackingParameters & { timestamp: number; isExperiment: boolean }\n >;\n};\n\n/**\n * @type StorageDataType - an enumeration type which represents a data stored on SDK storage\n *\n * `string` represents visitor code storage with only one string value\n * */\nexport type StorageDataType =\n | ClientDataType\n | VariationDataType\n | OfflineTracking\n | string;\n\n/**\n * @interface an interface of External Constructor for Storage which must be implemented by the wrapper constructor to initialize new `IExternalStorage` in order to be able to pass necessary initialization parameters\n * */\nexport interface IExternalStorageConstructor {\n /**\n * @method initialize - creates and instance of `IExternalStorage<StorageDataType>` and returns it\n *\n * Generic needs to be specified with a type for TypeScript to be able to infer concrete type based on enum variant\n * @param {KameleoonStorageKey} key - an enum variant containing keys for Kameleoon SDK related data stored on storage\n * @returns {IExternalStorage<StorageDataType>} an initialized instance of `IExternalStorage<StorageDataType>`\n * */\n initialize: <T extends StorageDataType>(\n key: KameleoonStorageKey,\n ) => IExternalStorage<T>;\n}\n\n/**\n * @interface an interface of External Storage which must be implemented to be used as external storage for initialized JS SDK Core.\n *\n * Generic `StorageDataType` needs to be specified with a type for TypeScript to be able to infer concrete type based on enum variant\n * However it's not constrained strictly by `StorageDataType` to let implementer use storage as a generic for other types\n * */\nexport interface IExternalStorage<T> {\n /**\n * @property key - an Enum `KameleoonStorageKey` variant containing a key for Kameleoon SDK related data stored on storage\n * */\n readonly key: KameleoonStorageKey;\n /**\n * @method read - reads data from the storage\n * @returns {Result<T, KameleoonError>} result with an `ok` boolean field indicated success or error. If result is ok contains `data` field with a type `T`, if not contains `error` field with a type of `KameleoonError`\n * */\n read: () => Result<T, KameleoonError>;\n /**\n * @method write - writes data to storage\n * @param {T} data - representation of any generic data type\n * @returns {Result<void, KameleoonError>} result with an `ok` boolean field indicated success or error. If result is ok contains an empty `data`, if not contains `error` field with a type of `KameleoonError`\n * */\n write: (data: T) => Result<void, KameleoonError>;\n}\n"],"mappings":""}
@@ -3,7 +3,7 @@ import { CampaignConfiguration } from '../campaignConfiguration';
3
3
  import { KameleoonVisitorDataType } from '../kameleoonData/types';
4
4
  import { Requester } from '../requester';
5
5
  import { TrackDataParamsType, TrackExperimentParamsType } from '../requester/types';
6
- import { IStorage, OfflineTracking } from '../storage/types';
6
+ import { IExternalStorage, OfflineTracking } from '../storage/types';
7
7
  import { SegmentType } from '../targeting';
8
8
  import { ExternalPackageInfoType, TrackingCacheItemType } from '../types';
9
9
  import { VariationConfiguration, FeatureFlagVariationType } from '../variationConfiguration';
@@ -23,7 +23,7 @@ export type TrackRuleParametersType = {
23
23
  requester: Requester;
24
24
  userAgent?: string;
25
25
  isOfflineModeOn?: boolean;
26
- offlineTrackingStorage: IStorage<OfflineTracking>;
26
+ offlineTrackingStorage: IExternalStorage<OfflineTracking>;
27
27
  };
28
28
  export type ManageCacheParametersType = {
29
29
  cacheManager: CacheManager<TrackingCacheItemType>;
@@ -36,7 +36,7 @@ export type TrackDataParametersType = {
36
36
  campaignConfiguration: CampaignConfiguration;
37
37
  requester: Requester;
38
38
  isOfflineModeOn?: boolean;
39
- offlineTrackingStorage: IStorage<OfflineTracking>;
39
+ offlineTrackingStorage: IExternalStorage<OfflineTracking>;
40
40
  };
41
41
  export type TrackExperimentParametersType = {
42
42
  campaignConfiguration: CampaignConfiguration;
@@ -46,19 +46,19 @@ export type TrackExperimentParametersType = {
46
46
  experimentId: number;
47
47
  isUnallocated: boolean;
48
48
  isOfflineModeOn?: boolean;
49
- offlineTrackingStorage: IStorage<OfflineTracking>;
49
+ offlineTrackingStorage: IExternalStorage<OfflineTracking>;
50
50
  };
51
51
  export type AddToOfflineTrackingParametersType = {
52
52
  item: TrackExperimentParamsType | TrackDataParamsType;
53
53
  isExperiment: boolean;
54
- storage: IStorage<OfflineTracking>;
54
+ storage: IExternalStorage<OfflineTracking>;
55
55
  onSuccess?: () => void;
56
56
  };
57
57
  export type SendOfflineTrackingParametersType = {
58
- storage: IStorage<OfflineTracking>;
58
+ storage: IExternalStorage<OfflineTracking>;
59
59
  requester: Requester;
60
60
  };
61
61
  export type DeleteFromOfflineTrackingParametersType = {
62
62
  timestamps: number[];
63
- storage: IStorage<OfflineTracking>;
63
+ storage: IExternalStorage<OfflineTracking>;
64
64
  };
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/utilities/types.ts"],"sourcesContent":["import { CacheManager } from 'src/cacheManager';\nimport { CampaignConfiguration } from 'src/campaignConfiguration';\nimport { KameleoonVisitorDataType } from 'src/kameleoonData/types';\nimport { Requester } from 'src/requester';\nimport {\n TrackDataParamsType,\n TrackExperimentParamsType,\n} from 'src/requester/types';\nimport { IStorage, OfflineTracking } from 'src/storage/types';\nimport { SegmentType } from 'src/targeting';\nimport { ExternalPackageInfoType, TrackingCacheItemType } from 'src/types';\nimport {\n VariationConfiguration,\n FeatureFlagVariationType,\n} from 'src/variationConfiguration';\n\nexport type CheckTargetingParametersType = {\n segment: SegmentType | null;\n experimentId: number | null;\n visitorCode: string;\n packageInfo: ExternalPackageInfoType;\n targetingData: KameleoonVisitorDataType;\n campaignConfiguration: CampaignConfiguration;\n variationConfiguration?: VariationConfiguration;\n};\n\nexport type TrackRuleParametersType = {\n featureFlagVariation: FeatureFlagVariationType;\n campaignConfiguration: CampaignConfiguration;\n visitorCode: string;\n requester: Requester;\n userAgent?: string;\n isOfflineModeOn?: boolean;\n offlineTrackingStorage: IStorage<OfflineTracking>;\n};\n\nexport type ManageCacheParametersType = {\n cacheManager: CacheManager<TrackingCacheItemType>;\n visitorCode: string;\n experimentId: number;\n variationId: number;\n};\n\nexport type TrackDataParametersType = {\n visitorCode: string;\n campaignConfiguration: CampaignConfiguration;\n requester: Requester;\n isOfflineModeOn?: boolean;\n offlineTrackingStorage: IStorage<OfflineTracking>;\n};\n\nexport type TrackExperimentParametersType = {\n campaignConfiguration: CampaignConfiguration;\n visitorCode: string;\n requester: Requester;\n variationId: number;\n experimentId: number;\n isUnallocated: boolean;\n isOfflineModeOn?: boolean;\n offlineTrackingStorage: IStorage<OfflineTracking>;\n};\n\nexport type AddToOfflineTrackingParametersType = {\n item: TrackExperimentParamsType | TrackDataParamsType;\n isExperiment: boolean;\n storage: IStorage<OfflineTracking>;\n onSuccess?: () => void;\n};\n\nexport type SendOfflineTrackingParametersType = {\n storage: IStorage<OfflineTracking>;\n requester: Requester;\n};\n\nexport type DeleteFromOfflineTrackingParametersType = {\n timestamps: number[];\n storage: IStorage<OfflineTracking>;\n};\n"],"mappings":""}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/utilities/types.ts"],"sourcesContent":["import { CacheManager } from 'src/cacheManager';\nimport { CampaignConfiguration } from 'src/campaignConfiguration';\nimport { KameleoonVisitorDataType } from 'src/kameleoonData/types';\nimport { Requester } from 'src/requester';\nimport {\n TrackDataParamsType,\n TrackExperimentParamsType,\n} from 'src/requester/types';\nimport { IExternalStorage, OfflineTracking } from 'src/storage/types';\nimport { SegmentType } from 'src/targeting';\nimport { ExternalPackageInfoType, TrackingCacheItemType } from 'src/types';\nimport {\n VariationConfiguration,\n FeatureFlagVariationType,\n} from 'src/variationConfiguration';\n\nexport type CheckTargetingParametersType = {\n segment: SegmentType | null;\n experimentId: number | null;\n visitorCode: string;\n packageInfo: ExternalPackageInfoType;\n targetingData: KameleoonVisitorDataType;\n campaignConfiguration: CampaignConfiguration;\n variationConfiguration?: VariationConfiguration;\n};\n\nexport type TrackRuleParametersType = {\n featureFlagVariation: FeatureFlagVariationType;\n campaignConfiguration: CampaignConfiguration;\n visitorCode: string;\n requester: Requester;\n userAgent?: string;\n isOfflineModeOn?: boolean;\n offlineTrackingStorage: IExternalStorage<OfflineTracking>;\n};\n\nexport type ManageCacheParametersType = {\n cacheManager: CacheManager<TrackingCacheItemType>;\n visitorCode: string;\n experimentId: number;\n variationId: number;\n};\n\nexport type TrackDataParametersType = {\n visitorCode: string;\n campaignConfiguration: CampaignConfiguration;\n requester: Requester;\n isOfflineModeOn?: boolean;\n offlineTrackingStorage: IExternalStorage<OfflineTracking>;\n};\n\nexport type TrackExperimentParametersType = {\n campaignConfiguration: CampaignConfiguration;\n visitorCode: string;\n requester: Requester;\n variationId: number;\n experimentId: number;\n isUnallocated: boolean;\n isOfflineModeOn?: boolean;\n offlineTrackingStorage: IExternalStorage<OfflineTracking>;\n};\n\nexport type AddToOfflineTrackingParametersType = {\n item: TrackExperimentParamsType | TrackDataParamsType;\n isExperiment: boolean;\n storage: IExternalStorage<OfflineTracking>;\n onSuccess?: () => void;\n};\n\nexport type SendOfflineTrackingParametersType = {\n storage: IExternalStorage<OfflineTracking>;\n requester: Requester;\n};\n\nexport type DeleteFromOfflineTrackingParametersType = {\n timestamps: number[];\n storage: IExternalStorage<OfflineTracking>;\n};\n"],"mappings":""}
@@ -1,7 +1,7 @@
1
1
  import { Result } from 'ts-res';
2
2
  import { ExperimentItemType } from '../campaignConfiguration';
3
3
  import { KameleoonError } from '../kameleoonError';
4
- import { IStorage, VariationDataType, ExperimentVariationsType } from '../storage';
4
+ import { IExternalStorage, VariationDataType, ExperimentVariationsType } from '../storage';
5
5
  import { FeatureFlagVariationType, GetFeatureFlagVariationParametersType } from './types';
6
6
  interface IVariationConfiguration {
7
7
  /**
@@ -24,7 +24,7 @@ interface IVariationConfiguration {
24
24
  export declare class VariationConfiguration implements IVariationConfiguration {
25
25
  private experiments;
26
26
  private storage;
27
- constructor(experiments: ExperimentItemType[], externalStorage: IStorage<VariationDataType>);
27
+ constructor(experiments: ExperimentItemType[], externalStorage: IExternalStorage<VariationDataType>);
28
28
  getAssociatedVariationId: (visitorCode: string, experimentId: number) => Result<number, KameleoonError>;
29
29
  getAssignedVariations(visitorCode: string): Result<ExperimentVariationsType, KameleoonError>;
30
30
  getFeatureFlagVariation({ visitorCode, featureFlag, targetingData, packageInfo, campaignConfiguration, withAssignment, }: GetFeatureFlagVariationParametersType): Result<FeatureFlagVariationType, KameleoonError>;