kameleoon-client-javascript
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -45,8 +45,8 @@ import { DataInterface } from './interfaces/interfaces'; | ||
browsers: { | ||
CHROME: number; | ||
INTERNET_EXPLORER: number; | ||
FIREFOX: number; | ||
SAFARI: number; | ||
OPERA: number; | ||
OTHER: number; | ||
"CHROME": number; | ||
"INTERNET_EXPLORER": number; | ||
"FIREFOX": number; | ||
"SAFARI": number; | ||
"OPERA": number; | ||
"OTHER": number; | ||
}; | ||
@@ -53,0 +53,0 @@ Conversion: typeof Conversion; |
@@ -6,3 +6,2 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Conversion = exports.Interest = exports.PageView = exports.Browser = exports.CustomData = void 0; | ||
var nonce_1 = __importDefault(require("./nonce")); | ||
@@ -9,0 +8,0 @@ var CustomData = /** @class */ (function () { |
@@ -6,3 +6,3 @@ "use strict"; | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
@@ -9,0 +9,0 @@ }; |
@@ -6,3 +6,3 @@ "use strict"; | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
@@ -9,0 +9,0 @@ }; |
@@ -6,3 +6,3 @@ "use strict"; | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
@@ -9,0 +9,0 @@ }; |
@@ -6,3 +6,3 @@ "use strict"; | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
@@ -9,0 +9,0 @@ }; |
@@ -6,3 +6,3 @@ "use strict"; | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
@@ -9,0 +9,0 @@ }; |
@@ -6,3 +6,3 @@ "use strict"; | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
@@ -9,0 +9,0 @@ }; |
export declare class VisitorCodeNotValid extends Error { | ||
message: string; | ||
type: string; | ||
constructor(message: string); | ||
} |
@@ -6,3 +6,3 @@ "use strict"; | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
@@ -17,3 +17,2 @@ }; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.VisitorCodeNotValid = void 0; | ||
var VisitorCodeNotValid = /** @class */ (function (_super) { | ||
@@ -23,2 +22,3 @@ __extends(VisitorCodeNotValid, _super); | ||
var _this = _super.call(this) || this; | ||
_this.type = "VisitorCodeNotValid"; | ||
_this.message = message; | ||
@@ -25,0 +25,0 @@ return _this; |
@@ -41,3 +41,3 @@ import Configuration from './configurations/configuration'; | ||
triggerExperiment: (visitorCode: string, experimentId: number, timeout?: any) => number; | ||
activateFeature: (visitorCode: string, featureIdOrName: number | string) => boolean; | ||
activateFeature: (visitorCode: string, featureIdOrName: string | number) => boolean; | ||
generateRandomString: () => string; | ||
@@ -59,3 +59,3 @@ obtainVisitorCode: (domain: string, defaultVisitorCode?: string | undefined) => string; | ||
obtainVariationAssociatedData: (variationId: number) => any; | ||
obtainFeatureVariable: (featureIdOrName: number | string, variable: string) => any; | ||
obtainFeatureVariable: (featureIdOrName: string | number, variable: string) => any; | ||
save: () => void; | ||
@@ -62,0 +62,0 @@ private validateVisitorCode; |
@@ -6,3 +6,2 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.KameleoonException = exports.KameleoonData = exports.KameleoonClient = void 0; | ||
var configuration_1 = __importDefault(require("./configurations/configuration")); | ||
@@ -188,3 +187,3 @@ var data_1 = __importDefault(require("./data")); | ||
this.activateFeature = function (visitorCode, featureIdOrName) { | ||
var _a, _b; | ||
var _a, _b, _c; | ||
_this.validateVisitorCode(visitorCode); | ||
@@ -195,3 +194,3 @@ var featureFlag = null; | ||
var ff = (_b = _this.configurations) === null || _b === void 0 ? void 0 : _b.featureFlags[key_1]; | ||
if (key_1 == featureIdOrName || (ff === null || ff === void 0 ? void 0 : ff.identificationKey) == featureIdOrName) { | ||
if (key_1 == featureIdOrName || ((_c = ff) === null || _c === void 0 ? void 0 : _c.identificationKey) == featureIdOrName) { | ||
featureId = parseInt(key_1); | ||
@@ -331,3 +330,3 @@ featureFlag = ff; | ||
listData.push(d); | ||
if (targetingDataList.length > _this.targetingDataNumberEntriesAuthorized) { | ||
if (targetingDataList.length < _this.targetingDataNumberEntriesAuthorized) { | ||
targetingDataList.push(new targetingData_1.default(new Date().getTime(), d)); | ||
@@ -491,7 +490,7 @@ } | ||
this.obtainVariationAssociatedData = function (variationId) { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
for (var vid in (_a = _this.configurations) === null || _a === void 0 ? void 0 : _a.experiments) { | ||
var experiment = (_b = _this.configurations) === null || _b === void 0 ? void 0 : _b.experiments[vid]; | ||
if (experiment === null || experiment === void 0 ? void 0 : experiment.variationConfigurations[variationId]) { | ||
return experiment === null || experiment === void 0 ? void 0 : experiment.variationConfigurations[variationId].customJson; | ||
if ((_c = experiment) === null || _c === void 0 ? void 0 : _c.variationConfigurations[variationId]) { | ||
return (_d = experiment) === null || _d === void 0 ? void 0 : _d.variationConfigurations[variationId].customJson; | ||
} | ||
@@ -502,9 +501,9 @@ } | ||
this.obtainFeatureVariable = function (featureIdOrName, variable) { | ||
var _a, _b, _c, _d; | ||
var _a, _b, _c, _d, _e, _f, _g; | ||
for (var ffid in (_a = _this.configurations) === null || _a === void 0 ? void 0 : _a.featureFlags) { | ||
var ff = (_b = _this.configurations) === null || _b === void 0 ? void 0 : _b.featureFlags[ffid]; | ||
if (ffid == featureIdOrName || (ff === null || ff === void 0 ? void 0 : ff.identificationKey) == featureIdOrName) { | ||
for (var vid in ff === null || ff === void 0 ? void 0 : ff.variationConfigurations) { | ||
if (ffid == featureIdOrName || ((_c = ff) === null || _c === void 0 ? void 0 : _c.identificationKey) == featureIdOrName) { | ||
for (var vid in (_d = ff) === null || _d === void 0 ? void 0 : _d.variationConfigurations) { | ||
if (vid != "0") { | ||
return (_d = (_c = ff === null || ff === void 0 ? void 0 : ff.variationConfigurations[vid]) === null || _c === void 0 ? void 0 : _c.customJson[variable]) === null || _d === void 0 ? void 0 : _d.value; | ||
return (_g = (_f = (_e = ff) === null || _e === void 0 ? void 0 : _e.variationConfigurations[vid]) === null || _f === void 0 ? void 0 : _f.customJson[variable]) === null || _g === void 0 ? void 0 : _g.value; | ||
} | ||
@@ -511,0 +510,0 @@ } |
@@ -6,3 +6,3 @@ "use strict"; | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
@@ -9,0 +9,0 @@ }; |
{ | ||
"name": "kameleoon-client-javascript", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "JavaScript SDK client", | ||
@@ -15,3 +15,2 @@ "main": "dist/kameleoonClient.js", | ||
"license": "ISC", | ||
"dependencies": {}, | ||
"devDependencies": { | ||
@@ -18,0 +17,0 @@ "@types/node": "^14.17.5", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
79414
48
1774