@kameleoon/javascript-sdk-core 0.0.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.
- package/README.md +8 -0
- package/dist/configurations/configuration.d.ts +15 -0
- package/dist/configurations/configuration.js +31 -0
- package/dist/configurations/configuration.js.map +1 -0
- package/dist/configurations/experiment.d.ts +13 -0
- package/dist/configurations/experiment.js +54 -0
- package/dist/configurations/experiment.js.map +1 -0
- package/dist/configurations/featureFlag.d.ts +23 -0
- package/dist/configurations/featureFlag.js +105 -0
- package/dist/configurations/featureFlag.js.map +1 -0
- package/dist/configurations/variation.d.ts +15 -0
- package/dist/configurations/variation.js +14 -0
- package/dist/configurations/variation.js.map +1 -0
- package/dist/constants.d.ts +17 -0
- package/dist/constants.js +23 -0
- package/dist/constants.js.map +1 -0
- package/dist/data.d.ts +67 -0
- package/dist/data.js +127 -0
- package/dist/data.js.map +1 -0
- package/dist/exceptions/credentialsNotFound.d.ts +6 -0
- package/dist/exceptions/credentialsNotFound.js +29 -0
- package/dist/exceptions/credentialsNotFound.js.map +1 -0
- package/dist/exceptions/experimentConfigurationNotFound.d.ts +6 -0
- package/dist/exceptions/experimentConfigurationNotFound.js +29 -0
- package/dist/exceptions/experimentConfigurationNotFound.js.map +1 -0
- package/dist/exceptions/featureConfigurationNotFound.d.ts +6 -0
- package/dist/exceptions/featureConfigurationNotFound.js +29 -0
- package/dist/exceptions/featureConfigurationNotFound.js.map +1 -0
- package/dist/exceptions/notActivated.d.ts +6 -0
- package/dist/exceptions/notActivated.js +29 -0
- package/dist/exceptions/notActivated.js.map +1 -0
- package/dist/exceptions/notTargeted.d.ts +6 -0
- package/dist/exceptions/notTargeted.js +29 -0
- package/dist/exceptions/notTargeted.js.map +1 -0
- package/dist/exceptions/siteCodeDisabled.d.ts +5 -0
- package/dist/exceptions/siteCodeDisabled.js +30 -0
- package/dist/exceptions/siteCodeDisabled.js.map +1 -0
- package/dist/exceptions/variationConfigurationNotFound.d.ts +6 -0
- package/dist/exceptions/variationConfigurationNotFound.js +29 -0
- package/dist/exceptions/variationConfigurationNotFound.js.map +1 -0
- package/dist/exceptions/visitorCodeNotValid.d.ts +5 -0
- package/dist/exceptions/visitorCodeNotValid.js +30 -0
- package/dist/exceptions/visitorCodeNotValid.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/interfaces.d.ts +81 -0
- package/dist/interfaces/interfaces.js +3 -0
- package/dist/interfaces/interfaces.js.map +1 -0
- package/dist/kameleoonClient.d.ts +102 -0
- package/dist/kameleoonClient.js +732 -0
- package/dist/kameleoonClient.js.map +1 -0
- package/dist/kameleoonUtils.d.ts +11 -0
- package/dist/kameleoonUtils.js +107 -0
- package/dist/kameleoonUtils.js.map +1 -0
- package/dist/nonce.d.ts +1 -0
- package/dist/nonce.js +16 -0
- package/dist/nonce.js.map +1 -0
- package/dist/realTimeConfigurationService.d.ts +12 -0
- package/dist/realTimeConfigurationService.js +24 -0
- package/dist/realTimeConfigurationService.js.map +1 -0
- package/dist/storage/types.d.ts +13 -0
- package/dist/storage/types.js +3 -0
- package/dist/storage/types.js.map +1 -0
- package/dist/storage/variationStorage.d.ts +11 -0
- package/dist/storage/variationStorage.js +159 -0
- package/dist/storage/variationStorage.js.map +1 -0
- package/dist/storage/visitorVariation.d.ts +9 -0
- package/dist/storage/visitorVariation.js +22 -0
- package/dist/storage/visitorVariation.js.map +1 -0
- package/dist/targeting/conditions/customDatum.d.ts +12 -0
- package/dist/targeting/conditions/customDatum.js +129 -0
- package/dist/targeting/conditions/customDatum.js.map +1 -0
- package/dist/targeting/conditions/exclusiveExperiment.d.ts +9 -0
- package/dist/targeting/conditions/exclusiveExperiment.js +45 -0
- package/dist/targeting/conditions/exclusiveExperiment.js.map +1 -0
- package/dist/targeting/conditions/targetExperiment.d.ts +14 -0
- package/dist/targeting/conditions/targetExperiment.js +57 -0
- package/dist/targeting/conditions/targetExperiment.js.map +1 -0
- package/dist/targeting/conditions/types.d.ts +12 -0
- package/dist/targeting/conditions/types.js +3 -0
- package/dist/targeting/conditions/types.js.map +1 -0
- package/dist/targeting/targetingCondition.d.ts +7 -0
- package/dist/targeting/targetingCondition.js +9 -0
- package/dist/targeting/targetingCondition.js.map +1 -0
- package/dist/targeting/targetingConditionsFactory.d.ts +7 -0
- package/dist/targeting/targetingConditionsFactory.js +30 -0
- package/dist/targeting/targetingConditionsFactory.js.map +1 -0
- package/dist/targeting/targetingData.d.ts +7 -0
- package/dist/targeting/targetingData.js +11 -0
- package/dist/targeting/targetingData.js.map +1 -0
- package/dist/targeting/targetingEngine.d.ts +6 -0
- package/dist/targeting/targetingEngine.js +130 -0
- package/dist/targeting/targetingEngine.js.map +1 -0
- package/dist/targeting/targetingSegment.d.ts +5 -0
- package/dist/targeting/targetingSegment.js +9 -0
- package/dist/targeting/targetingSegment.js.map +1 -0
- package/dist/targeting/targetingTree.d.ts +9 -0
- package/dist/targeting/targetingTree.js +13 -0
- package/dist/targeting/targetingTree.js.map +1 -0
- package/dist/targeting/targetingTreeBuilder.d.ts +8 -0
- package/dist/targeting/targetingTreeBuilder.js +127 -0
- package/dist/targeting/targetingTreeBuilder.js.map +1 -0
- package/dist/types.d.ts +5 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +39 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
var FeatureConfigurationNotFound = /** @class */ (function (_super) {
|
|
19
|
+
__extends(FeatureConfigurationNotFound, _super);
|
|
20
|
+
function FeatureConfigurationNotFound(message) {
|
|
21
|
+
var _this = _super.call(this) || this;
|
|
22
|
+
_this.type = 'FeatureConfigurationNotFound';
|
|
23
|
+
_this.message = message;
|
|
24
|
+
return _this;
|
|
25
|
+
}
|
|
26
|
+
return FeatureConfigurationNotFound;
|
|
27
|
+
}(Error));
|
|
28
|
+
exports.default = FeatureConfigurationNotFound;
|
|
29
|
+
//# sourceMappingURL=featureConfigurationNotFound.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"featureConfigurationNotFound.js","sourceRoot":"","sources":["../../src/exceptions/featureConfigurationNotFound.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;IAA2C,gDAAK;IAI9C,sCAAY,OAAe;QAA3B,YACE,iBAAO,SAER;QALD,UAAI,GAAG,8BAA8B,CAAC;QAIpC,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;;IACzB,CAAC;IACH,mCAAC;AAAD,CAAC,AARD,CAA2C,KAAK,GAQ/C;AAED,kBAAe,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
var NotActivated = /** @class */ (function (_super) {
|
|
19
|
+
__extends(NotActivated, _super);
|
|
20
|
+
function NotActivated(message) {
|
|
21
|
+
var _this = _super.call(this) || this;
|
|
22
|
+
_this.type = 'NotActivated';
|
|
23
|
+
_this.message = message;
|
|
24
|
+
return _this;
|
|
25
|
+
}
|
|
26
|
+
return NotActivated;
|
|
27
|
+
}(Error));
|
|
28
|
+
exports.default = NotActivated;
|
|
29
|
+
//# sourceMappingURL=notActivated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notActivated.js","sourceRoot":"","sources":["../../src/exceptions/notActivated.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;IAA2B,gCAAK;IAI9B,sBAAY,OAAe;QAA3B,YACE,iBAAO,SAER;QALD,UAAI,GAAG,cAAc,CAAC;QAIpB,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;;IACzB,CAAC;IACH,mBAAC;AAAD,CAAC,AARD,CAA2B,KAAK,GAQ/B;AAED,kBAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
var NotTargeted = /** @class */ (function (_super) {
|
|
19
|
+
__extends(NotTargeted, _super);
|
|
20
|
+
function NotTargeted(message) {
|
|
21
|
+
var _this = _super.call(this) || this;
|
|
22
|
+
_this.type = 'NotTargeted';
|
|
23
|
+
_this.message = message;
|
|
24
|
+
return _this;
|
|
25
|
+
}
|
|
26
|
+
return NotTargeted;
|
|
27
|
+
}(Error));
|
|
28
|
+
exports.default = NotTargeted;
|
|
29
|
+
//# sourceMappingURL=notTargeted.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notTargeted.js","sourceRoot":"","sources":["../../src/exceptions/notTargeted.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;IAA0B,+BAAK;IAI7B,qBAAY,OAAe;QAA3B,YACE,iBAAO,SAER;QALD,UAAI,GAAG,aAAa,CAAC;QAInB,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;;IACzB,CAAC;IACH,kBAAC;AAAD,CAAC,AARD,CAA0B,KAAK,GAQ9B;AAED,kBAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.SiteCodeDisabled = void 0;
|
|
19
|
+
var SiteCodeDisabled = /** @class */ (function (_super) {
|
|
20
|
+
__extends(SiteCodeDisabled, _super);
|
|
21
|
+
function SiteCodeDisabled(siteCode) {
|
|
22
|
+
var _this = _super.call(this) || this;
|
|
23
|
+
_this.type = 'SiteCodeDisabled';
|
|
24
|
+
_this.message = "SiteCode ".concat(siteCode, " disabled");
|
|
25
|
+
return _this;
|
|
26
|
+
}
|
|
27
|
+
return SiteCodeDisabled;
|
|
28
|
+
}(Error));
|
|
29
|
+
exports.SiteCodeDisabled = SiteCodeDisabled;
|
|
30
|
+
//# sourceMappingURL=siteCodeDisabled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"siteCodeDisabled.js","sourceRoot":"","sources":["../../src/exceptions/siteCodeDisabled.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;IAAsC,oCAAK;IAIzC,0BAAY,QAAgB;QAA5B,YACE,iBAAO,SAER;QALD,UAAI,GAAG,kBAAkB,CAAC;QAIxB,KAAI,CAAC,OAAO,GAAG,mBAAY,QAAQ,cAAW,CAAC;;IACjD,CAAC;IACH,uBAAC;AAAD,CAAC,AARD,CAAsC,KAAK,GAQ1C;AARY,4CAAgB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
var VariationConfigurationNotFound = /** @class */ (function (_super) {
|
|
19
|
+
__extends(VariationConfigurationNotFound, _super);
|
|
20
|
+
function VariationConfigurationNotFound(message) {
|
|
21
|
+
var _this = _super.call(this) || this;
|
|
22
|
+
_this.type = 'VariationConfigurationNotFound';
|
|
23
|
+
_this.message = message;
|
|
24
|
+
return _this;
|
|
25
|
+
}
|
|
26
|
+
return VariationConfigurationNotFound;
|
|
27
|
+
}(Error));
|
|
28
|
+
exports.default = VariationConfigurationNotFound;
|
|
29
|
+
//# sourceMappingURL=variationConfigurationNotFound.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variationConfigurationNotFound.js","sourceRoot":"","sources":["../../src/exceptions/variationConfigurationNotFound.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;IAA6C,kDAAK;IAIhD,wCAAY,OAAe;QAA3B,YACE,iBAAO,SAER;QALD,UAAI,GAAG,gCAAgC,CAAC;QAItC,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;;IACzB,CAAC;IACH,qCAAC;AAAD,CAAC,AARD,CAA6C,KAAK,GAQjD;AAED,kBAAe,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.VisitorCodeNotValid = void 0;
|
|
19
|
+
var VisitorCodeNotValid = /** @class */ (function (_super) {
|
|
20
|
+
__extends(VisitorCodeNotValid, _super);
|
|
21
|
+
function VisitorCodeNotValid(message) {
|
|
22
|
+
var _this = _super.call(this) || this;
|
|
23
|
+
_this.type = 'VisitorCodeNotValid';
|
|
24
|
+
_this.message = message;
|
|
25
|
+
return _this;
|
|
26
|
+
}
|
|
27
|
+
return VisitorCodeNotValid;
|
|
28
|
+
}(Error));
|
|
29
|
+
exports.VisitorCodeNotValid = VisitorCodeNotValid;
|
|
30
|
+
//# sourceMappingURL=visitorCodeNotValid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visitorCodeNotValid.js","sourceRoot":"","sources":["../../src/exceptions/visitorCodeNotValid.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;IAAyC,uCAAK;IAI5C,6BAAY,OAAe;QAA3B,YACE,iBAAO,SAER;QALD,UAAI,GAAG,qBAAqB,CAAC;QAI3B,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;;IACzB,CAAC;IACH,0BAAC;AAAD,CAAC,AARD,CAAyC,KAAK,GAQ7C;AARY,kDAAmB"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.KameleoonData = exports.KameleoonClient = void 0;
|
|
7
|
+
var data_1 = __importDefault(require("./data"));
|
|
8
|
+
exports.KameleoonData = data_1.default;
|
|
9
|
+
var kameleoonClient_1 = require("./kameleoonClient");
|
|
10
|
+
Object.defineProperty(exports, "KameleoonClient", { enumerable: true, get: function () { return kameleoonClient_1.KameleoonClient; } });
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,gDAA0B;AAGT,wBAHV,cAAI,CAGmB;AAD9B,qDAAoD;AAA3C,kHAAA,eAAe,OAAA"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import Experiment from '../configurations/experiment';
|
|
3
|
+
import FeatureFlag from '../configurations/featureFlag';
|
|
4
|
+
export interface SiteEnabledInterface {
|
|
5
|
+
siteEnabled: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface CampaignInterface extends SiteEnabledInterface {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
siteCode: string;
|
|
11
|
+
siteId: string;
|
|
12
|
+
respoolTime?: AutomationRespoolTimeInterface[];
|
|
13
|
+
segment?: AutomationSegmentInterface;
|
|
14
|
+
deviations: AutomationDeviationInterface[];
|
|
15
|
+
variations: AutomationVariationsInterface[];
|
|
16
|
+
type: 'HYBRID' | 'SERVER_SIDE';
|
|
17
|
+
}
|
|
18
|
+
export interface AutomationExperimentInterface extends CampaignInterface {
|
|
19
|
+
status: 'ACTIVE';
|
|
20
|
+
}
|
|
21
|
+
export interface AutomationFeatureFlagInterface extends CampaignInterface {
|
|
22
|
+
featureStatus: string;
|
|
23
|
+
identificationKey: string;
|
|
24
|
+
schedules: {
|
|
25
|
+
dateStart?: string;
|
|
26
|
+
dateEnd?: string;
|
|
27
|
+
}[] | null;
|
|
28
|
+
status: 'ACTIVE' | 'PAUSED';
|
|
29
|
+
}
|
|
30
|
+
export interface AutomationVariationsInterface {
|
|
31
|
+
id: string;
|
|
32
|
+
customJson: any;
|
|
33
|
+
}
|
|
34
|
+
export interface AutomationRespoolTimeInterface {
|
|
35
|
+
variationId: string;
|
|
36
|
+
value: number;
|
|
37
|
+
}
|
|
38
|
+
export interface AutomationSegmentInterface {
|
|
39
|
+
conditionsData: ConditionsInterface;
|
|
40
|
+
}
|
|
41
|
+
export interface AutomationDeviationInterface {
|
|
42
|
+
variationId: string;
|
|
43
|
+
value: number;
|
|
44
|
+
}
|
|
45
|
+
export interface SDKConfiguration {
|
|
46
|
+
visitor_data_maximum_size?: number;
|
|
47
|
+
actions_configuration_refresh_interval?: number;
|
|
48
|
+
environment?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface ConfigurationInterface {
|
|
51
|
+
settings: ConfigurationSettings;
|
|
52
|
+
updateTime: number;
|
|
53
|
+
experiments: ConfigurationExperimentsInterface;
|
|
54
|
+
featureFlags: ConfigurationFeatureFlagsInterface;
|
|
55
|
+
}
|
|
56
|
+
export interface ConfigurationExperimentsInterface {
|
|
57
|
+
[id: string]: Experiment;
|
|
58
|
+
}
|
|
59
|
+
export interface ConfigurationFeatureFlagsInterface {
|
|
60
|
+
[id: string]: FeatureFlag;
|
|
61
|
+
}
|
|
62
|
+
export interface ConfigurationSettings {
|
|
63
|
+
realTimeUpdate: boolean;
|
|
64
|
+
}
|
|
65
|
+
export interface CallbackInterface {
|
|
66
|
+
success: () => void;
|
|
67
|
+
error: () => void;
|
|
68
|
+
timeout: NodeJS.Timeout;
|
|
69
|
+
}
|
|
70
|
+
export interface DataInterface {
|
|
71
|
+
obtainFullPostTextLine: () => string;
|
|
72
|
+
}
|
|
73
|
+
export interface ConditionsInterface {
|
|
74
|
+
firstLevel: any;
|
|
75
|
+
firstLevelOrOperators: any;
|
|
76
|
+
}
|
|
77
|
+
export interface IteratorInterface {
|
|
78
|
+
next: () => any;
|
|
79
|
+
hasNext: () => boolean;
|
|
80
|
+
}
|
|
81
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/interfaces/interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import Configuration from './configurations/configuration';
|
|
2
|
+
import TargetingData from './targeting/targetingData';
|
|
3
|
+
import Experiment from './configurations/experiment';
|
|
4
|
+
import FeatureFlag from './configurations/featureFlag';
|
|
5
|
+
import ExperimentConfigurationNotFound from './exceptions/experimentConfigurationNotFound';
|
|
6
|
+
import FeatureConfigurationNotFound from './exceptions/featureConfigurationNotFound';
|
|
7
|
+
import NotActivated from './exceptions/notActivated';
|
|
8
|
+
import NotTargeted from './exceptions/notTargeted';
|
|
9
|
+
import VariationConfigurationNotFound from './exceptions/variationConfigurationNotFound';
|
|
10
|
+
import CredentialsNotFound from './exceptions/credentialsNotFound';
|
|
11
|
+
import { CallbackInterface, DataInterface, SDKConfiguration } from './interfaces/interfaces';
|
|
12
|
+
declare class KameleoonClient {
|
|
13
|
+
static readonly VISITOR_CODE_MAX_LENGTH = 255;
|
|
14
|
+
configurations?: Configuration;
|
|
15
|
+
ready: boolean;
|
|
16
|
+
readyCallbacks: CallbackInterface[];
|
|
17
|
+
minutesBetweenConfigurationUpdate: number;
|
|
18
|
+
siteCode: string;
|
|
19
|
+
targetingData: {
|
|
20
|
+
[visitorCode: string]: TargetingData[];
|
|
21
|
+
};
|
|
22
|
+
targetingDataNumberEntriesAuthorized: number;
|
|
23
|
+
unsentData: {
|
|
24
|
+
[visitorCode: string]: DataInterface[];
|
|
25
|
+
};
|
|
26
|
+
visitorDataMaximumSize: number;
|
|
27
|
+
environment: string | null;
|
|
28
|
+
private realTimeConfigurationService;
|
|
29
|
+
private handlerUpdateConfiguration;
|
|
30
|
+
private variationStorage;
|
|
31
|
+
constructor(siteCode: string, configuration?: SDKConfiguration);
|
|
32
|
+
private updateCampaignConfiguration;
|
|
33
|
+
runWhenReady: (successCallback: () => void, errorCallback: () => void, timeout: number) => void;
|
|
34
|
+
clearCallbacks: (success: boolean, errorCallback?: () => void) => void;
|
|
35
|
+
trackConversion: (visitorCode: string, goalId: number, revenue?: number) => void;
|
|
36
|
+
flush: (visitorCode?: string) => void;
|
|
37
|
+
triggerExperiment: (visitorCode: string, experimentId: number) => number;
|
|
38
|
+
activateFeature: (visitorCode: string, featureIdOrName: number | string) => boolean;
|
|
39
|
+
generateRandomString: () => string;
|
|
40
|
+
obtainAsyncVisitorCode: (domain: string, defaultVisitorCode?: string) => Promise<string>;
|
|
41
|
+
obtainVisitorCode: (domain: string, defaultVisitorCode?: string) => string;
|
|
42
|
+
obtainHashDouble: (containerId: number, visitorCode: string, xpConf: Experiment | FeatureFlag) => number;
|
|
43
|
+
private getCommonSSXParameters;
|
|
44
|
+
private getDataTrackingURL;
|
|
45
|
+
private getAPIDataRequestURL;
|
|
46
|
+
private getEventsRequestURL;
|
|
47
|
+
getExperimentRegisterURL: (visitorCode: string, experimentId: number, variationId?: number, noneVariation?: boolean) => string;
|
|
48
|
+
getUnsentUsers: () => string[];
|
|
49
|
+
getUnsentData: (visitorCode: string) => DataInterface[];
|
|
50
|
+
getTargetingData: (visitorCode: string) => TargetingData[];
|
|
51
|
+
emptyUnsentData: (visitorCode: string) => void;
|
|
52
|
+
emptyTargetingData: () => void;
|
|
53
|
+
addData: (visitorCode: string, ...data: DataInterface[]) => Promise<void>;
|
|
54
|
+
checkTargeting: (visitorCode: string, campaignId: number, isFF: boolean) => boolean | null;
|
|
55
|
+
private getConditionData;
|
|
56
|
+
obtainVariationAssociatedData: (variationId: number) => Record<string | number | symbol, string | number | boolean | {
|
|
57
|
+
[x: string]: string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | any)[])[])[])[])[])[])[])[])[])[])[];
|
|
58
|
+
} | (string | number | boolean | {
|
|
59
|
+
[x: string]: string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | any)[])[])[])[])[])[])[])[])[])[])[];
|
|
60
|
+
} | (string | number | boolean | {
|
|
61
|
+
[x: string]: string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | any)[])[])[])[])[])[])[])[])[])[])[];
|
|
62
|
+
} | (string | number | boolean | {
|
|
63
|
+
[x: string]: string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | any)[])[])[])[])[])[])[])[])[])[])[];
|
|
64
|
+
} | (string | number | boolean | {
|
|
65
|
+
[x: string]: string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | any)[])[])[])[])[])[])[])[])[])[])[];
|
|
66
|
+
} | (string | number | boolean | {
|
|
67
|
+
[x: string]: string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | any)[])[])[])[])[])[])[])[])[])[])[];
|
|
68
|
+
} | (string | number | boolean | {
|
|
69
|
+
[x: string]: string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | any)[])[])[])[])[])[])[])[])[])[])[];
|
|
70
|
+
} | (string | number | boolean | {
|
|
71
|
+
[x: string]: string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | any)[])[])[])[])[])[])[])[])[])[])[];
|
|
72
|
+
} | (string | number | boolean | {
|
|
73
|
+
[x: string]: string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | any)[])[])[])[])[])[])[])[])[])[])[];
|
|
74
|
+
} | (string | number | boolean | {
|
|
75
|
+
[x: string]: string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | any)[])[])[])[])[])[])[])[])[])[])[];
|
|
76
|
+
} | (string | number | boolean | {
|
|
77
|
+
[x: string]: string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | any)[])[])[])[])[])[])[])[])[])[])[];
|
|
78
|
+
} | (string | number | boolean | {
|
|
79
|
+
[x: string]: string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | any)[])[])[])[])[])[])[])[])[])[])[];
|
|
80
|
+
} | any)[])[])[])[])[])[])[])[])[])[])[]>;
|
|
81
|
+
obtainFeatureVariable: (featureIdOrName: number | string, variable: string) => any;
|
|
82
|
+
retrieveDataFromRemoteSource: (key: string) => Promise<any>;
|
|
83
|
+
private _parseJsonValue;
|
|
84
|
+
private saveConfiguration;
|
|
85
|
+
private validateVisitorCode;
|
|
86
|
+
private checkSiteEnabled;
|
|
87
|
+
private checkFeatureKeyOrId;
|
|
88
|
+
private getAndClearUnsentData;
|
|
89
|
+
onUpdateConfiguration: (handler: () => void) => void;
|
|
90
|
+
private manageConfiguraitonUpdate;
|
|
91
|
+
private fireUpdateConfigurationHandler;
|
|
92
|
+
}
|
|
93
|
+
declare const KameleoonException: {
|
|
94
|
+
ExperimentConfigurationNotFound: typeof ExperimentConfigurationNotFound;
|
|
95
|
+
FeatureConfigurationNotFound: typeof FeatureConfigurationNotFound;
|
|
96
|
+
VariationConfigurationNotFound: typeof VariationConfigurationNotFound;
|
|
97
|
+
NotTargeted: typeof NotTargeted;
|
|
98
|
+
NotActivated: typeof NotActivated;
|
|
99
|
+
CredentialsNotFound: typeof CredentialsNotFound;
|
|
100
|
+
};
|
|
101
|
+
export { KameleoonClient };
|
|
102
|
+
export { KameleoonException };
|