@kameleoon/javascript-sdk-core 2.9.1 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/dist/cacheManager/cacheManager.d.ts +0 -38
- package/dist/cacheManager/cacheManager.js +0 -12
- package/dist/cacheManager/cacheManager.js.map +0 -1
- package/dist/cacheManager/index.d.ts +0 -2
- package/dist/cacheManager/index.js +0 -2
- package/dist/cacheManager/index.js.map +0 -1
- package/dist/cacheManager/types.d.ts +0 -14
- package/dist/cacheManager/types.js +0 -2
- package/dist/cacheManager/types.js.map +0 -1
- package/dist/campaignConfiguration/campaignConfiguration.d.ts +0 -71
- package/dist/campaignConfiguration/campaignConfiguration.js +0 -24
- package/dist/campaignConfiguration/campaignConfiguration.js.map +0 -1
- package/dist/campaignConfiguration/constants.d.ts +0 -6
- package/dist/campaignConfiguration/constants.js +0 -4
- package/dist/campaignConfiguration/constants.js.map +0 -1
- package/dist/campaignConfiguration/index.d.ts +0 -3
- package/dist/campaignConfiguration/index.js +0 -2
- package/dist/campaignConfiguration/index.js.map +0 -1
- package/dist/campaignConfiguration/types.d.ts +0 -155
- package/dist/campaignConfiguration/types.js +0 -2
- package/dist/campaignConfiguration/types.js.map +0 -1
- package/dist/clientSettings/clientSettings.d.ts +0 -12
- package/dist/clientSettings/clientSettings.js +0 -2
- package/dist/clientSettings/clientSettings.js.map +0 -1
- package/dist/clientSettings/index.d.ts +0 -2
- package/dist/clientSettings/index.js +0 -2
- package/dist/clientSettings/index.js.map +0 -1
- package/dist/clientSettings/types.d.ts +0 -6
- package/dist/clientSettings/types.js +0 -2
- package/dist/clientSettings/types.js.map +0 -1
- package/dist/constants.d.ts +0 -32
- package/dist/constants.js +0 -5
- package/dist/constants.js.map +0 -1
- package/dist/eventSource/constants.d.ts +0 -1
- package/dist/eventSource/constants.js +0 -2
- package/dist/eventSource/constants.js.map +0 -1
- package/dist/eventSource/externalEventSource.d.ts +0 -12
- package/dist/eventSource/externalEventSource.js +0 -2
- package/dist/eventSource/externalEventSource.js.map +0 -1
- package/dist/eventSource/index.d.ts +0 -3
- package/dist/eventSource/index.js +0 -2
- package/dist/eventSource/index.js.map +0 -1
- package/dist/eventSource/types.d.ts +0 -47
- package/dist/eventSource/types.js +0 -2
- package/dist/eventSource/types.js.map +0 -1
- package/dist/hasher/hasher.d.ts +0 -6
- package/dist/hasher/hasher.js +0 -7
- package/dist/hasher/hasher.js.map +0 -1
- package/dist/hasher/index.d.ts +0 -1
- package/dist/hasher/index.js +0 -2
- package/dist/hasher/index.js.map +0 -1
- package/dist/hasher/types.d.ts +0 -12
- package/dist/hasher/types.js +0 -2
- package/dist/hasher/types.js.map +0 -1
- package/dist/index.d.ts +0 -12
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -1
- package/dist/kameleoonClient.d.ts +0 -253
- package/dist/kameleoonClient.js +0 -19
- package/dist/kameleoonClient.js.map +0 -1
- package/dist/kameleoonData/browser.d.ts +0 -26
- package/dist/kameleoonData/browser.js +0 -18
- package/dist/kameleoonData/browser.js.map +0 -1
- package/dist/kameleoonData/conversion.d.ts +0 -23
- package/dist/kameleoonData/conversion.js +0 -14
- package/dist/kameleoonData/conversion.js.map +0 -1
- package/dist/kameleoonData/customData.d.ts +0 -33
- package/dist/kameleoonData/customData.js +0 -25
- package/dist/kameleoonData/customData.js.map +0 -1
- package/dist/kameleoonData/device.d.ts +0 -21
- package/dist/kameleoonData/device.js +0 -14
- package/dist/kameleoonData/device.js.map +0 -1
- package/dist/kameleoonData/index.d.ts +0 -7
- package/dist/kameleoonData/index.js +0 -2
- package/dist/kameleoonData/index.js.map +0 -1
- package/dist/kameleoonData/pageView.d.ts +0 -23
- package/dist/kameleoonData/pageView.js +0 -14
- package/dist/kameleoonData/pageView.js.map +0 -1
- package/dist/kameleoonData/types.d.ts +0 -117
- package/dist/kameleoonData/types.js +0 -15
- package/dist/kameleoonData/types.js.map +0 -1
- package/dist/kameleoonData/userAgent.d.ts +0 -18
- package/dist/kameleoonData/userAgent.js +0 -9
- package/dist/kameleoonData/userAgent.js.map +0 -1
- package/dist/kameleoonError/constants.d.ts +0 -27
- package/dist/kameleoonError/constants.js +0 -2
- package/dist/kameleoonError/constants.js.map +0 -1
- package/dist/kameleoonError/helpers.d.ts +0 -1
- package/dist/kameleoonError/helpers.js +0 -2
- package/dist/kameleoonError/helpers.js.map +0 -1
- package/dist/kameleoonError/index.d.ts +0 -3
- package/dist/kameleoonError/index.js +0 -2
- package/dist/kameleoonError/index.js.map +0 -1
- package/dist/kameleoonError/kameleoonError.d.ts +0 -25
- package/dist/kameleoonError/kameleoonError.js +0 -5
- package/dist/kameleoonError/kameleoonError.js.map +0 -1
- package/dist/kameleoonError/types.d.ts +0 -25
- package/dist/kameleoonError/types.js +0 -2
- package/dist/kameleoonError/types.js.map +0 -1
- package/dist/kameleoonUtils.d.ts +0 -13
- package/dist/kameleoonUtils.js +0 -5
- package/dist/kameleoonUtils.js.map +0 -1
- package/dist/requester/constants.d.ts +0 -17
- package/dist/requester/constants.js +0 -2
- package/dist/requester/constants.js.map +0 -1
- package/dist/requester/index.d.ts +0 -3
- package/dist/requester/index.js +0 -2
- package/dist/requester/index.js.map +0 -1
- package/dist/requester/requester.d.ts +0 -23
- package/dist/requester/requester.js +0 -2
- package/dist/requester/requester.js.map +0 -1
- package/dist/requester/types.d.ts +0 -100
- package/dist/requester/types.js +0 -2
- package/dist/requester/types.js.map +0 -1
- package/dist/storage/constants.d.ts +0 -10
- package/dist/storage/constants.js +0 -5
- package/dist/storage/constants.js.map +0 -1
- package/dist/storage/index.d.ts +0 -2
- package/dist/storage/index.js +0 -2
- package/dist/storage/index.js.map +0 -1
- package/dist/storage/types.d.ts +0 -68
- package/dist/storage/types.js +0 -2
- package/dist/storage/types.js.map +0 -1
- package/dist/targeting/conditions/browserCondition.d.ts +0 -13
- package/dist/targeting/conditions/browserCondition.js +0 -2
- package/dist/targeting/conditions/browserCondition.js.map +0 -1
- package/dist/targeting/conditions/conditionFactory.d.ts +0 -6
- package/dist/targeting/conditions/conditionFactory.js +0 -2
- package/dist/targeting/conditions/conditionFactory.js.map +0 -1
- package/dist/targeting/conditions/conversionCondition.d.ts +0 -10
- package/dist/targeting/conditions/conversionCondition.js +0 -4
- package/dist/targeting/conditions/conversionCondition.js.map +0 -1
- package/dist/targeting/conditions/customDataCondition.d.ts +0 -14
- package/dist/targeting/conditions/customDataCondition.js +0 -8
- package/dist/targeting/conditions/customDataCondition.js.map +0 -1
- package/dist/targeting/conditions/deviceCondition.d.ts +0 -9
- package/dist/targeting/conditions/deviceCondition.js +0 -2
- package/dist/targeting/conditions/deviceCondition.js.map +0 -1
- package/dist/targeting/conditions/exclusiveExperimentCondition.d.ts +0 -7
- package/dist/targeting/conditions/exclusiveExperimentCondition.js +0 -2
- package/dist/targeting/conditions/exclusiveExperimentCondition.js.map +0 -1
- package/dist/targeting/conditions/index.d.ts +0 -12
- package/dist/targeting/conditions/index.js +0 -2
- package/dist/targeting/conditions/index.js.map +0 -1
- package/dist/targeting/conditions/pageTitleCondition.d.ts +0 -11
- package/dist/targeting/conditions/pageTitleCondition.js +0 -2
- package/dist/targeting/conditions/pageTitleCondition.js.map +0 -1
- package/dist/targeting/conditions/pageUrlCondition.d.ts +0 -11
- package/dist/targeting/conditions/pageUrlCondition.js +0 -2
- package/dist/targeting/conditions/pageUrlCondition.js.map +0 -1
- package/dist/targeting/conditions/sdkLanguageCondition.d.ts +0 -15
- package/dist/targeting/conditions/sdkLanguageCondition.js +0 -2
- package/dist/targeting/conditions/sdkLanguageCondition.js.map +0 -1
- package/dist/targeting/conditions/targetExperimentCondition.d.ts +0 -12
- package/dist/targeting/conditions/targetExperimentCondition.js +0 -2
- package/dist/targeting/conditions/targetExperimentCondition.js.map +0 -1
- package/dist/targeting/conditions/types.d.ts +0 -42
- package/dist/targeting/conditions/types.js +0 -2
- package/dist/targeting/conditions/types.js.map +0 -1
- package/dist/targeting/conditions/visitorCodeCondition.d.ts +0 -11
- package/dist/targeting/conditions/visitorCodeCondition.js +0 -2
- package/dist/targeting/conditions/visitorCodeCondition.js.map +0 -1
- package/dist/targeting/index.d.ts +0 -3
- package/dist/targeting/index.js +0 -2
- package/dist/targeting/index.js.map +0 -1
- package/dist/targeting/targetingNode.d.ts +0 -23
- package/dist/targeting/targetingNode.js +0 -2
- package/dist/targeting/targetingNode.js.map +0 -1
- package/dist/targeting/targetingTree.d.ts +0 -19
- package/dist/targeting/targetingTree.js +0 -35
- package/dist/targeting/targetingTree.js.map +0 -1
- package/dist/targeting/types.d.ts +0 -142
- package/dist/targeting/types.js +0 -2
- package/dist/targeting/types.js.map +0 -1
- package/dist/types.d.ts +0 -175
- package/dist/types.js +0 -42
- package/dist/types.js.map +0 -1
- package/dist/utilities/constants.d.ts +0 -2
- package/dist/utilities/constants.js +0 -2
- package/dist/utilities/constants.js.map +0 -1
- package/dist/utilities/index.d.ts +0 -2
- package/dist/utilities/index.js +0 -2
- package/dist/utilities/index.js.map +0 -1
- package/dist/utilities/types.d.ts +0 -64
- package/dist/utilities/types.js +0 -2
- package/dist/utilities/types.js.map +0 -1
- package/dist/utilities/utilities.d.ts +0 -27
- package/dist/utilities/utilities.js +0 -2
- package/dist/utilities/utilities.js.map +0 -1
- package/dist/variationConfiguration/index.d.ts +0 -2
- package/dist/variationConfiguration/index.js +0 -2
- package/dist/variationConfiguration/index.js.map +0 -1
- package/dist/variationConfiguration/types.d.ts +0 -28
- package/dist/variationConfiguration/types.js +0 -2
- package/dist/variationConfiguration/types.js.map +0 -1
- package/dist/variationConfiguration/variation.d.ts +0 -13
- package/dist/variationConfiguration/variation.js +0 -7
- package/dist/variationConfiguration/variation.js.map +0 -1
- package/dist/variationConfiguration/variationConfiguration.d.ts +0 -35
- package/dist/variationConfiguration/variationConfiguration.js +0 -66
- package/dist/variationConfiguration/variationConfiguration.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"variation.js","names":["_types","require","Object","defineProperty","exports","value","Variation","_typeof","a","Symbol","iterator","constructor","prototype","_classCallCheck","b","TypeError","_defineProperties","c","d","length","enumerable","configurable","writable","_toPropertyKey","key","_createClass","_defineProperty","_toPrimitive","toPrimitive","call","String","Number","variationData","get","Error","variationId","isValid","respoolTime","variation","assignmentTime","Date","parse","assignmentDate","getTime","Milliseconds","Second","variationRespoolTime","find","respool"],"sources":["../../src/variationConfiguration/variation.ts"],"sourcesContent":["import { RespoolTimeType } from 'src/campaignConfiguration/types';\nimport { Milliseconds } from 'src/types';\nimport { VariationType } from './types';\n\ninterface IVariation {\n readonly id: number;\n isValid: (respoolTime?: RespoolTimeType[]) => boolean;\n}\n\nexport class Variation implements IVariation {\n variationData?: VariationType;\n\n constructor(variationData?: VariationType) {\n this.variationData = variationData;\n }\n\n get id(): number {\n if (!this.variationData) {\n throw new Error(\n \"Internal usage error: Check if the variation `isValid`, before getting it's `id`\",\n );\n }\n\n return this.variationData.variationId;\n }\n\n public isValid(respoolTime?: RespoolTimeType[]): boolean {\n const variation = this.variationData;\n\n if (!variation) {\n return false;\n }\n\n // --- Note ---\n // - Respool is a kind of shuffle parameter\n // it's presence indicates that variations assigned to\n // user has changed at certain time (time is the value of `respoolTime` in seconds)\n // - So the variation is valid unless it has been shuffled after it's assignment\n if (respoolTime?.length) {\n const assignmentTime =\n new Date(Date.parse(variation.assignmentDate)).getTime() /\n Milliseconds.Second;\n const variationRespoolTime = respoolTime.find(\n (respool) => respool.variationId === String(variation.variationId),\n );\n\n if (!variationRespoolTime) {\n return true;\n }\n\n return assignmentTime > variationRespoolTime.value;\n }\n\n return true;\n }\n}\n"],"mappings":"aACA,IAAAA,MAAA,CAAAC,OAAA,aAAyCC,MAAA,CAAAC,cAAA,CAAAC,OAAA,eAAAC,KAAA,MAAAD,OAAA,CAAAE,SAAA,iBAAAC,QAAAC,CAAA,mCAAAD,OAAA,oBAAAE,MAAA,mBAAAA,MAAA,CAAAC,QAAA,UAAAF,CAAA,gBAAAA,CAAA,W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IlBP,CAAc,CAAGO,CAAoB,CAACzC,KAC/C,CAEA,QACF,CAAC,IAAAG,CAAA,IAAAJ,OAAA,CAAAE,SAAA,CAAAA,SAAA"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Result } from 'ts-res';
|
|
2
|
-
import { ExperimentItemType } from '../campaignConfiguration';
|
|
3
|
-
import { KameleoonError } from '../kameleoonError';
|
|
4
|
-
import { IExternalStorage, VariationDataType, ExperimentVariationsType } from '../storage';
|
|
5
|
-
import { FeatureFlagVariationType, GetFeatureFlagVariationParametersType } from './types';
|
|
6
|
-
interface IVariationConfiguration {
|
|
7
|
-
/**
|
|
8
|
-
* @method getAssociatedVariationId - gets the id of a variation assigned to a visitor with `visitorCode` from the storage. If the visitor doesn't have associated variation yet, assigns a new one, stores it and returns it's id.
|
|
9
|
-
*/
|
|
10
|
-
getAssociatedVariationId: (visitorCode: string, experimentId: number) => Result<number, KameleoonError>;
|
|
11
|
-
/**
|
|
12
|
-
* @method getAssignedVariations - obtains experiments with according variations that are *already assigned* and *stored* in the `variationStorage`. If `getAssociatedVariationId` had not been called before, there will be no variations to get.
|
|
13
|
-
*/
|
|
14
|
-
getAssignedVariations(visitorCode: string): Result<ExperimentVariationsType, KameleoonError>;
|
|
15
|
-
/**
|
|
16
|
-
* @method getFeatureFlagVariation - obtains variation for the rule of the feature flag which is both targeted and has a variation, if no such rule was found, returns empty rule with default `variationKey`, given an option `withAssignment` of `true` will also assign a new variation and save it in the storage
|
|
17
|
-
*/
|
|
18
|
-
getFeatureFlagVariation: (params: GetFeatureFlagVariationParametersType) => Result<FeatureFlagVariationType, KameleoonError>;
|
|
19
|
-
/**
|
|
20
|
-
* @method getExperimentVariation - obtains variation for the experiment by calculating the variation for the visitor *without assigning* it to a visitor
|
|
21
|
-
*/
|
|
22
|
-
getExperimentVariation: (visitorCode: string, experiment: ExperimentItemType) => Result<number, KameleoonError>;
|
|
23
|
-
}
|
|
24
|
-
export declare class VariationConfiguration implements IVariationConfiguration {
|
|
25
|
-
private experiments;
|
|
26
|
-
private storage;
|
|
27
|
-
constructor(experiments: ExperimentItemType[], externalStorage: IExternalStorage<VariationDataType>);
|
|
28
|
-
getAssociatedVariationId: (visitorCode: string, experimentId: number) => Result<number, KameleoonError>;
|
|
29
|
-
getAssignedVariations(visitorCode: string): Result<ExperimentVariationsType, KameleoonError>;
|
|
30
|
-
getFeatureFlagVariation({ visitorCode, featureFlag, targetingData, packageInfo, campaignConfiguration, withAssignment, }: GetFeatureFlagVariationParametersType): Result<FeatureFlagVariationType, KameleoonError>;
|
|
31
|
-
getExperimentVariation(visitorCode: string, experiment: ExperimentItemType): Result<number, KameleoonError>;
|
|
32
|
-
private assignVariation;
|
|
33
|
-
private updateStorageData;
|
|
34
|
-
}
|
|
35
|
-
export {};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.VariationConfiguration=void 0;var _tsRes=require("ts-res"),_hasher=require("../hasher"),_kameleoonError=require("../kameleoonError"),_utilities=require("../utilities"),_types=require("../campaignConfiguration/types"),_excluded=["exposition"];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 ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _objectWithoutProperties(a,b){if(null==a)return{};var c,d,e=_objectWithoutPropertiesLoose(a,b);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);for(d=0;d<f.length;d++)c=f[d],0<=b.indexOf(c)||Object.prototype.propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}return e}function _objectWithoutPropertiesLoose(a,b){if(null==a)return{};var c,d,e={},f=Object.keys(a);for(d=0;d<f.length;d++)c=f[d],0<=b.indexOf(c)||(e[c]=a[c]);return e}function _createForOfIteratorHelper(a,b){var c="undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(!c){if(Array.isArray(a)||(c=_unsupportedIterableToArray(a))||b&&a&&"number"==typeof a.length){c&&(a=c);var d=0,e=function(){};return{s:e,n:function n(){return d>=a.length?{done:!0}:{done:!1,value:a[d++]}},e:function e(a){throw a},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var f,g=!0,h=!1;return{s:function s(){c=c.call(a)},n:function n(){var a=c.next();return g=a.done,a},e:function e(a){h=!0,f=a},f:function f(){try{g||null==c.return||c.return()}finally{if(h)throw f}}}}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 _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 _defineProperty(a,b,c){return b=_toPropertyKey(b),b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"===_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!==_typeof(a)||null===a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var d=c.call(a,b||"default");if("object"!==_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}var VariationConfiguration=/*#__PURE__*/function(){function a(b,c){var d=this;_classCallCheck(this,a),_defineProperty(this,"experiments",void 0),_defineProperty(this,"storage",void 0),_defineProperty(this,"getAssociatedVariationId",function(a,b){// TODO:
|
|
2
|
-
// --- Variation from storage is not checked anymore
|
|
3
|
-
// --- If nothing changes the commented code should be deleted
|
|
4
|
-
// along with the `Variation` class and according tests/types
|
|
5
|
-
// --- Mind `todo` in `getAssociatedVariationId.spec.ts`
|
|
6
|
-
//
|
|
7
|
-
// let associatedVariation: VariationType | undefined;
|
|
8
|
-
// this.storage.read().and((data) => {
|
|
9
|
-
// associatedVariation = data?.[visitorCode]?.[experimentId];
|
|
10
|
-
// });
|
|
11
|
-
var c=d.experiments.find(function(a){return a.id===b+""});return c?d.assignVariation(a,c):(0,_tsRes.Err)(new _kameleoonError.KameleoonError(_kameleoonError.KameleoonException.ExperimentConfigurationNotFound,b,a));// const variation = new Variation(associatedVariation);
|
|
12
|
-
// if (variation.isValid(experiment?.respoolTime)) {
|
|
13
|
-
// return Ok(variation.id);
|
|
14
|
-
// }
|
|
15
|
-
}),this.experiments=b,this.storage=c}return _createClass(a,[{key:"getAssignedVariations",value:function getAssignedVariations(a){var b=this.storage.read();if(!b.ok)return b;var c=b.data[a];return c?(0,_tsRes.Ok)(c):(0,_tsRes.Err)(new _kameleoonError.KameleoonError(_kameleoonError.KameleoonException.StorageRead,a))}},{key:"getFeatureFlagVariation",value:function getFeatureFlagVariation(a){var b=a.visitorCode,c=a.featureFlag,d=a.targetingData,e=a.packageInfo,f=a.campaignConfiguration,g=a.withAssignment,h=_utilities.Utilities.validateVisitorCode(b);if(!h.ok)return(0,_tsRes.Err)(h.error);var i,j=c.rules,k=c.featureKey,l=c.id,m=c.defaultVariationKey,n=_createForOfIteratorHelper(j);try{for(n.s();!(i=n.n()).done;){var o=i.value,p=o.segment,q=o.experimentId,r=o.id,s=o.exposition,t=o.respoolTime,u=o.variationByExposition,v=_utilities.Utilities.checkTargeting({segment:p,visitorCode:b,experimentId:q,targetingData:d,packageInfo:e,campaignConfiguration:f,variationConfiguration:this});if(!v.ok)return v;if(v.data){// --- Note ---
|
|
16
|
-
// Calculate new variation (and assign it if `withAssignment` is `true`)
|
|
17
|
-
// First the the exposed rule is calculated and then the variation inside of it
|
|
18
|
-
var w=_hasher.Hasher.obtainFeatureFlagHashDouble({visitorCode:b,respoolTime:t,campaignId:r+""});if(w<=s){var x,y=0,z=_hasher.Hasher.obtainFeatureFlagHashDouble({visitorCode:b,respoolTime:t,campaignId:q+""}),A=_createForOfIteratorHelper(u);try{for(A.s();!(x=A.n()).done;){var B=x.value;if(y+=B.exposition,z<=y){o.type===_types.RuleType.EXPERIMENTATION&&void 0!==g&&g&&this.updateStorageData({visitorCode:b,experimentId:q+"",// --- Note ---
|
|
19
|
-
// For `RuleType.EXPERIMENTATION` `variationId` can not be null
|
|
20
|
-
variationId:B.variationId});var C=B.exposition,D=_objectWithoutProperties(B,_excluded);return(0,_tsRes.Ok)(_objectSpread(_objectSpread({},D),{},{rule:o,featureFlagId:l,featureKey:k,experimentId:q}))}}}catch(a){A.e(a)}finally{A.f()}}if(o.type===_types.RuleType.TARGETED_DELIVERY)break}}}catch(a){n.e(a)}finally{n.f()}return(0,_tsRes.Ok)({featureKey:k,featureFlagId:l,experimentId:null,variationKey:m,variationId:null,rule:null})}},{key:"getExperimentVariation",value:function getExperimentVariation(a,b){var c,d=b.id,e=b.respoolTime,f=b.deviations,g=_hasher.Hasher.obtainExperimentHashDouble({visitorCode:a,campaignId:d,respoolTime:e}),h=!0,i=0,j=0,k=_createForOfIteratorHelper(f);try{for(k.s();!(c=k.n()).done;){var l=c.value;if(i+=l.value,i>=g){h=!1,"origin"!==l.variationId&&(j=+l.variationId);break}}}catch(a){k.e(a)}finally{k.f()}return h?(0,_tsRes.Err)(new _kameleoonError.KameleoonError(_kameleoonError.KameleoonException.NotAllocated,a)):(0,_tsRes.Ok)(j)}},{key:"assignVariation",value:function assignVariation(a,b){var c=this.getExperimentVariation(a,b);if(!c.ok)return c;var d=this.updateStorageData({visitorCode:a,experimentId:b.id,variationId:c.data});return d.ok?(0,_tsRes.Ok)(c.data):d}},{key:"updateStorageData",value:function updateStorageData(a){var b=a.visitorCode,c=a.experimentId,d=a.variationId,e=this.storage.read();if(!e.ok&&e.error.type===_kameleoonError.KameleoonException.StorageParse)// --- Note ---
|
|
21
|
-
// If there is a parsing error we return error
|
|
22
|
-
// But if there is `LocalStorageRead` error it means that
|
|
23
|
-
// data was read successfully and it's empty, which is not problem
|
|
24
|
-
// cause that might be initial `read`
|
|
25
|
-
return e;var f=e.ok?e.data:{},g={variationId:d,assignmentDate:new Date().toString()};return f[b]?f[b][c]=g:f[b]=_defineProperty({},c,g),this.storage.write(f)}// --- TODO: commented out in case of future logic rework ---
|
|
26
|
-
// --- Mind: `variationId` could cause the `undefined` issue ---
|
|
27
|
-
// --- Reference: https://development.kameleoon.net/sdk/javascript-sdk-packages/-/merge_requests/89 ---
|
|
28
|
-
// private getAssignedRuleVariation(
|
|
29
|
-
// visitorCode: string,
|
|
30
|
-
// rule: RuleItemType,
|
|
31
|
-
// ): Result<GetAssignedRuleVariationResultType, KameleoonError> {
|
|
32
|
-
// const emptyVariation: Omit<VariationByExpositionType, 'exposition'> = {
|
|
33
|
-
// variationId: null,
|
|
34
|
-
// variationKey: '',
|
|
35
|
-
// };
|
|
36
|
-
// const { experimentId, variationByExposition } = rule;
|
|
37
|
-
// const variationsResult = this.getAssignedVariations(visitorCode);
|
|
38
|
-
// // --- Note ---
|
|
39
|
-
// // If there is an error, we just want to skip seeking
|
|
40
|
-
// // for variation in the storage, not throw an error
|
|
41
|
-
// if (!variationsResult.ok) {
|
|
42
|
-
// return Ok(emptyVariation);
|
|
43
|
-
// }
|
|
44
|
-
// const variations = variationsResult.data;
|
|
45
|
-
// if (
|
|
46
|
-
// experimentId &&
|
|
47
|
-
// typeof variations[experimentId].variationId !== undefined
|
|
48
|
-
// ) {
|
|
49
|
-
// const id = variations[experimentId].variationId;
|
|
50
|
-
// const featureFlagVariation = variationByExposition.find(
|
|
51
|
-
// (item) => item.variationId == id,
|
|
52
|
-
// );
|
|
53
|
-
// if (!featureFlagVariation) {
|
|
54
|
-
// // --- Note ---
|
|
55
|
-
// // This error is not described for public methods as
|
|
56
|
-
// // it serves internal purpose of checking whether
|
|
57
|
-
// // the persistent variation has been updated and should be re-allocated
|
|
58
|
-
// return Err(new KameleoonError(KameleoonException.DataInconsistency));
|
|
59
|
-
// }
|
|
60
|
-
// const { exposition, ...restParameters } = featureFlagVariation;
|
|
61
|
-
// return Ok({ ...restParameters });
|
|
62
|
-
// }
|
|
63
|
-
// return Ok(emptyVariation);
|
|
64
|
-
// }
|
|
65
|
-
}]),a}();exports.VariationConfiguration=VariationConfiguration;
|
|
66
|
-
//# sourceMappingURL=variationConfiguration.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"variationConfiguration.js","names":["VariationConfiguration","a","experiments","externalStorage","d","_classCallCheck","_defineProperty","visitorCode","experimentId","experiment","find","id","assignVariation","Err","KameleoonError","KameleoonException","ExperimentConfigurationNotFound","storage","_createClass","key","value","getAssignedVariations","result","read","ok","data","Ok","StorageRead","getFeatureFlagVariation","featureFlag","targetingData","packageInfo","campaignConfiguration","g","withAssignment","validateResult","Utilities","validateVisitorCode","error","i","rules","featureKey","featureFlagId","defaultVariationKey","n","_createForOfIteratorHelper","s","done","rule","segment","exposition","respoolTime","variationByExposition","targetingResult","checkTargeting","variationConfiguration","ruleHash","Hasher","obtainFeatureFlagHashDouble","campaignId","x","totalDeviation","variationHash","A","variation","type","RuleType","EXPERIMENTATION","updateStorageData","variationId","restParameters","_objectWithoutProperties","_excluded","_objectSpread","e","f","TARGETED_DELIVERY","variationKey","getExperimentVariation","c","deviations","hashDouble","obtainExperimentHashDouble","isUnallocated","resultVariationId","k","deviation","NotAllocated","variationResult","StorageParse","updatedVariationData","updatedVariation","assignmentDate","Date","toString","write","exports"],"sources":["../../src/variationConfiguration/variationConfiguration.ts"],"sourcesContent":["import { Err, Ok, Result } from 'ts-res';\nimport { ExperimentItemType } from 'src/campaignConfiguration';\nimport { Hasher } from 'src/hasher';\nimport { KameleoonError, KameleoonException } from 'src/kameleoonError';\nimport {\n IExternalStorage,\n VariationDataType,\n ExperimentVariationsType,\n} from 'src/storage';\nimport { Utilities } from 'src/utilities';\nimport { RuleType } from 'src/campaignConfiguration/types';\nimport {\n FeatureFlagVariationType,\n GetFeatureFlagVariationParametersType,\n UpdateStorageParamsType,\n} from './types';\n\ninterface IVariationConfiguration {\n /**\n * @method getAssociatedVariationId - gets the id of a variation assigned to a visitor with `visitorCode` from the storage. If the visitor doesn't have associated variation yet, assigns a new one, stores it and returns it's id.\n */\n getAssociatedVariationId: (\n visitorCode: string,\n experimentId: number,\n ) => Result<number, KameleoonError>;\n /**\n * @method getAssignedVariations - obtains experiments with according variations that are *already assigned* and *stored* in the `variationStorage`. If `getAssociatedVariationId` had not been called before, there will be no variations to get.\n */\n getAssignedVariations(\n visitorCode: string,\n ): Result<ExperimentVariationsType, KameleoonError>;\n /**\n * @method getFeatureFlagVariation - obtains variation for the rule of the feature flag which is both targeted and has a variation, if no such rule was found, returns empty rule with default `variationKey`, given an option `withAssignment` of `true` will also assign a new variation and save it in the storage\n */\n getFeatureFlagVariation: (\n params: GetFeatureFlagVariationParametersType,\n ) => Result<FeatureFlagVariationType, KameleoonError>;\n /**\n * @method getExperimentVariation - obtains variation for the experiment by calculating the variation for the visitor *without assigning* it to a visitor\n */\n getExperimentVariation: (\n visitorCode: string,\n experiment: ExperimentItemType,\n ) => Result<number, KameleoonError>;\n}\n\nexport class VariationConfiguration implements IVariationConfiguration {\n private experiments: ExperimentItemType[];\n private storage: IExternalStorage<VariationDataType>;\n\n constructor(\n experiments: ExperimentItemType[],\n externalStorage: IExternalStorage<VariationDataType>,\n ) {\n this.experiments = experiments;\n this.storage = externalStorage;\n }\n\n public getAssociatedVariationId = (\n visitorCode: string,\n experimentId: number,\n ): Result<number, KameleoonError> => {\n // TODO:\n // --- Variation from storage is not checked anymore\n // --- If nothing changes the commented code should be deleted\n // along with the `Variation` class and according tests/types\n // --- Mind `todo` in `getAssociatedVariationId.spec.ts`\n //\n // let associatedVariation: VariationType | undefined;\n\n // this.storage.read().and((data) => {\n // associatedVariation = data?.[visitorCode]?.[experimentId];\n // });\n\n const experiment = this.experiments.find(\n (experiment) => experiment.id === String(experimentId),\n );\n\n if (!experiment) {\n return Err(\n new KameleoonError(\n KameleoonException.ExperimentConfigurationNotFound,\n experimentId,\n visitorCode,\n ),\n );\n }\n\n // const variation = new Variation(associatedVariation);\n\n // if (variation.isValid(experiment?.respoolTime)) {\n // return Ok(variation.id);\n // }\n\n return this.assignVariation(visitorCode, experiment);\n };\n\n public getAssignedVariations(\n visitorCode: string,\n ): Result<ExperimentVariationsType, KameleoonError> {\n const result = this.storage.read();\n\n if (!result.ok) {\n return result;\n }\n\n const experiments = result.data[visitorCode];\n\n if (!experiments) {\n return Err(\n new KameleoonError(KameleoonException.StorageRead, visitorCode),\n );\n }\n\n return Ok(experiments);\n }\n\n public getFeatureFlagVariation({\n visitorCode,\n featureFlag,\n targetingData,\n packageInfo,\n campaignConfiguration,\n withAssignment = false,\n }: GetFeatureFlagVariationParametersType): Result<\n FeatureFlagVariationType,\n KameleoonError\n > {\n const validateResult = Utilities.validateVisitorCode(visitorCode);\n\n if (!validateResult.ok) {\n return Err(validateResult.error);\n }\n\n const {\n rules,\n featureKey,\n id: featureFlagId,\n defaultVariationKey,\n } = featureFlag;\n\n for (const rule of rules) {\n const {\n segment,\n experimentId,\n id,\n exposition,\n respoolTime,\n variationByExposition,\n } = rule;\n\n // --- Check targeting ---\n const targetingResult = Utilities.checkTargeting({\n segment,\n visitorCode,\n experimentId,\n targetingData,\n packageInfo,\n campaignConfiguration,\n variationConfiguration: this,\n });\n\n if (!targetingResult.ok) {\n return targetingResult;\n }\n\n if (!targetingResult.data) {\n continue;\n }\n\n // --- Note ---\n // Calculate new variation (and assign it if `withAssignment` is `true`)\n // First the the exposed rule is calculated and then the variation inside of it\n const ruleHash = Hasher.obtainFeatureFlagHashDouble({\n visitorCode,\n respoolTime,\n campaignId: String(id),\n });\n\n if (ruleHash <= exposition) {\n let totalDeviation = 0;\n\n const variationHash = Hasher.obtainFeatureFlagHashDouble({\n visitorCode,\n respoolTime,\n campaignId: String(experimentId),\n });\n\n for (const variation of variationByExposition) {\n totalDeviation += variation.exposition;\n\n if (variationHash <= totalDeviation) {\n // --- Note ---\n // For the `RuleType.EXPERIMENTATION` variation assignment must happen without\n // calculating experiment deviation\n if (rule.type === RuleType.EXPERIMENTATION && withAssignment) {\n this.updateStorageData({\n visitorCode,\n experimentId: String(experimentId),\n // --- Note ---\n // For `RuleType.EXPERIMENTATION` `variationId` can not be null\n variationId: variation.variationId as number,\n });\n }\n\n const { exposition, ...restParameters } = variation;\n\n return Ok({\n ...restParameters,\n rule,\n featureFlagId,\n featureKey,\n experimentId,\n });\n }\n }\n }\n\n if (rule.type === RuleType.TARGETED_DELIVERY) {\n break;\n }\n }\n\n return Ok({\n featureKey,\n featureFlagId,\n experimentId: null,\n variationKey: defaultVariationKey,\n variationId: null,\n rule: null,\n });\n }\n\n public getExperimentVariation(\n visitorCode: string,\n experiment: ExperimentItemType,\n ): Result<number, KameleoonError> {\n const { id, respoolTime, deviations } = experiment;\n\n const hashDouble = Hasher.obtainExperimentHashDouble({\n visitorCode,\n campaignId: id,\n respoolTime,\n });\n\n let isUnallocated = true;\n let totalDeviation = 0;\n let resultVariationId = 0;\n\n for (const deviation of deviations) {\n totalDeviation += deviation.value;\n\n if (totalDeviation >= hashDouble) {\n // --- Note ---\n // If sum of all variations is less than 1 (100%), then there is a chance\n // user will end up outside of any variation\n isUnallocated = false;\n // --- Note ---\n // 'origin' is the default `variationId`, it must return id of 0\n if (deviation.variationId !== 'origin') {\n resultVariationId = Number(deviation.variationId);\n }\n\n break;\n }\n }\n\n if (isUnallocated) {\n return Err(\n new KameleoonError(KameleoonException.NotAllocated, visitorCode),\n );\n }\n\n return Ok(resultVariationId);\n }\n\n private assignVariation(\n visitorCode: string,\n experiment: ExperimentItemType,\n ): Result<number, KameleoonError> {\n const variationResult = this.getExperimentVariation(\n visitorCode,\n experiment,\n );\n\n if (!variationResult.ok) {\n return variationResult;\n }\n\n const result = this.updateStorageData({\n visitorCode,\n experimentId: experiment.id,\n variationId: variationResult.data,\n });\n\n if (!result.ok) {\n return result;\n }\n\n return Ok(variationResult.data);\n }\n\n private updateStorageData({\n visitorCode,\n experimentId,\n variationId,\n }: UpdateStorageParamsType): Result<void, KameleoonError> {\n const result = this.storage.read();\n\n if (!result.ok) {\n // --- Note ---\n // If there is a parsing error we return error\n // But if there is `LocalStorageRead` error it means that\n // data was read successfully and it's empty, which is not problem\n // cause that might be initial `read`\n if (result.error.type === KameleoonException.StorageParse) {\n return result;\n }\n }\n\n const updatedVariationData: VariationDataType = result.ok\n ? result.data\n : {};\n\n const updatedVariation = {\n variationId,\n assignmentDate: new Date().toString(),\n };\n\n if (updatedVariationData[visitorCode]) {\n updatedVariationData[visitorCode][experimentId] = updatedVariation;\n } else {\n updatedVariationData[visitorCode] = {\n [experimentId]: updatedVariation,\n };\n }\n\n return this.storage.write(updatedVariationData);\n }\n\n // --- TODO: commented out in case of future logic rework ---\n // --- Mind: `variationId` could cause the `undefined` issue ---\n // --- Reference: https://development.kameleoon.net/sdk/javascript-sdk-packages/-/merge_requests/89 ---\n // private getAssignedRuleVariation(\n // visitorCode: string,\n // rule: RuleItemType,\n // ): Result<GetAssignedRuleVariationResultType, KameleoonError> {\n // const emptyVariation: Omit<VariationByExpositionType, 'exposition'> = {\n // variationId: null,\n // variationKey: '',\n // };\n // const { experimentId, variationByExposition } = rule;\n\n // const variationsResult = this.getAssignedVariations(visitorCode);\n\n // // --- Note ---\n // // If there is an error, we just want to skip seeking\n // // for variation in the storage, not throw an error\n // if (!variationsResult.ok) {\n // return Ok(emptyVariation);\n // }\n\n // const variations = variationsResult.data;\n\n // if (\n // experimentId &&\n // typeof variations[experimentId].variationId !== undefined\n // ) {\n // const id = variations[experimentId].variationId;\n // const featureFlagVariation = variationByExposition.find(\n // (item) => item.variationId == id,\n // );\n\n // if (!featureFlagVariation) {\n // // --- Note ---\n // // This error is not described for public methods as\n // // it serves internal purpose of checking whether\n // // the persistent variation has been updated and should be re-allocated\n // return Err(new KameleoonError(KameleoonException.DataInconsistency));\n // }\n\n // const { exposition, ...restParameters } = featureFlagVariation;\n\n // return Ok({ ...restParameters });\n // }\n\n // return Ok(emptyVariation);\n // }\n}\n"],"mappings":"iuHA8Ca,CAAAA,sBAAsB,yBAIjC,SAAAC,EACEC,CAAiC,CACjCC,CAAoD,CACpD,KAAAC,CAAA,MAAAC,eAAA,MAAAJ,CAAA,EAAAK,eAAA,4BAAAA,eAAA,wBAAAA,eAAA,iCAKgC,SAChCC,CAAmB,CACnBC,CAAoB,CACe,CACnC;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA,GAAM,CAAAC,CAAU,CAAGL,CAAI,CAACF,WAAW,CAACQ,IAAI,CACtC,SAACD,CAAU,QAAK,CAAAA,CAAU,CAACE,EAAE,GAAYH,CAAY,GAAC,EACvD,CAAC,MAEG,CAAAC,CAAU,CAgBRL,CAAI,CAACQ,eAAe,CAACL,CAAW,CAAEE,CAAU,CAAC,CAf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