expf-sigma-node.js 3.2.5 → 3.2.6
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/public/sigma.js +32 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expf-sigma-node.js",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.6",
|
|
4
4
|
"description": "expf-sigma-node.js lets you manage features flags and remote config across web, server side applications. Deliver true Continuous Integration. Get builds out faster. Control who has access to new features.",
|
|
5
5
|
"main": "public/sigma.js",
|
|
6
6
|
"keywords": [
|
package/public/sigma.js
CHANGED
|
@@ -808,6 +808,11 @@ var errorMessages = {
|
|
|
808
808
|
};
|
|
809
809
|
var signsForHash = ["equal", "not equal", "any of", "none of"];
|
|
810
810
|
var prefixGroup = "sigma_group";
|
|
811
|
+
var errorTypesInConfig = {
|
|
812
|
+
invalidJson: 'Sigma warning. Invalid type json "%value%" in config.',
|
|
813
|
+
invalidType: 'Sigma warning. Invalid type "%type%" in config.'
|
|
814
|
+
};
|
|
815
|
+
var sdkName = "node.js";
|
|
811
816
|
|
|
812
817
|
// src/modules/sigmaCache.js
|
|
813
818
|
var sigmaCache = new import_node_cache.default({
|
|
@@ -1020,14 +1025,24 @@ function digestHash(string) {
|
|
|
1020
1025
|
|
|
1021
1026
|
// src/helpers/doTypeConversion.js
|
|
1022
1027
|
function doTypeConversion(type, value) {
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1028
|
+
switch (type) {
|
|
1029
|
+
case "string":
|
|
1030
|
+
return value;
|
|
1031
|
+
case "bool":
|
|
1032
|
+
return value === "true" ? true : false;
|
|
1033
|
+
case "integer":
|
|
1034
|
+
case "number":
|
|
1035
|
+
return parseFloat(value);
|
|
1036
|
+
case "json":
|
|
1037
|
+
try {
|
|
1038
|
+
return JSON.parse(value);
|
|
1039
|
+
} catch (e) {
|
|
1040
|
+
console.error(errorTypesInConfig.invalidJson.replace("%value%", value), e);
|
|
1041
|
+
return null;
|
|
1042
|
+
}
|
|
1043
|
+
default:
|
|
1044
|
+
return value;
|
|
1045
|
+
}
|
|
1031
1046
|
}
|
|
1032
1047
|
|
|
1033
1048
|
// src/helpers/generateRandomId.js
|
|
@@ -1092,6 +1107,12 @@ function generateFilteredList(array, name) {
|
|
|
1092
1107
|
return array;
|
|
1093
1108
|
}
|
|
1094
1109
|
|
|
1110
|
+
// package.json
|
|
1111
|
+
var version = "3.2.6";
|
|
1112
|
+
|
|
1113
|
+
// src/helpers/sdkVersion.js
|
|
1114
|
+
var sdkVersion = version;
|
|
1115
|
+
|
|
1095
1116
|
// src/sigma.js
|
|
1096
1117
|
if (typeof import_node_fetch.default.default !== "undefined")
|
|
1097
1118
|
import_node_fetch.default.default;
|
|
@@ -1185,7 +1206,9 @@ var Sigma = class {
|
|
|
1185
1206
|
"ip": this.userData.ip,
|
|
1186
1207
|
"X-Real-IP": this.userData.ip,
|
|
1187
1208
|
token: this.token,
|
|
1188
|
-
"user-id": this.cache.get(sigmaPrivateId)
|
|
1209
|
+
"user-id": this.cache.get(sigmaPrivateId),
|
|
1210
|
+
"sdk-name": sdkName,
|
|
1211
|
+
"sdk-version": sdkVersion
|
|
1189
1212
|
}
|
|
1190
1213
|
};
|
|
1191
1214
|
const data = await this.retryFetch(
|