expf-sigma-node.js 3.3.1 → 3.3.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/public/sigma.js +28 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expf-sigma-node.js",
3
- "version": "3.3.1",
3
+ "version": "3.3.3",
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
@@ -33,7 +33,7 @@ var import_node_fetch = __toESM(require("node-fetch"));
33
33
  // src/modules/sigmaUserData.js
34
34
  var import_ua_parser_js = __toESM(require("ua-parser-js"));
35
35
  var SigmaUserData = class {
36
- platform = "all";
36
+ platform = ["all", "web", "spliturl", "android", "ios"];
37
37
  constructor() {
38
38
  this.user = {
39
39
  userId: null,
@@ -1249,17 +1249,23 @@ function generateFilteredList(array, name) {
1249
1249
  return array;
1250
1250
  array = array.filter((item) => {
1251
1251
  for (let index in listName) {
1252
- if (!item.platform || item.platform === "all")
1253
- return item;
1254
- if (item.platform === listName[index])
1252
+ if (!item.platform)
1255
1253
  return item;
1254
+ if (item.platforms && item.platforms.length) {
1255
+ if (listName.some((userPlatform) => item.platforms.includes(userPlatform))) {
1256
+ return item;
1257
+ }
1258
+ } else {
1259
+ if (item.platform === listName[index])
1260
+ return item;
1261
+ }
1256
1262
  }
1257
1263
  });
1258
1264
  return array;
1259
1265
  }
1260
1266
 
1261
1267
  // package.json
1262
- var version = "3.3.1";
1268
+ var version = "3.3.3";
1263
1269
 
1264
1270
  // src/helpers/sdkVersion.js
1265
1271
  var sdkVersion = version;
@@ -1508,6 +1514,23 @@ var Sigma = class {
1508
1514
  return null;
1509
1515
  return this.findingSpotCondition(flag, this.sigmaUserData);
1510
1516
  }
1517
+ async getUserFeatureFlagsDetails() {
1518
+ const featureFlags = [];
1519
+ await this.updateCache();
1520
+ const sigmaDataLs = await this.cache.parse(sigmaDataFile);
1521
+ this.sigmaUserData.setGeo(this.geoCache.parse(sigmaGeoData));
1522
+ if (sigmaDataLs.feature_flags.length > 0) {
1523
+ for (const flag in sigmaDataLs.feature_flags) {
1524
+ const ffName = sigmaDataLs.feature_flags[flag].name;
1525
+ const ffValue = await this.checkFlag(ffName);
1526
+ featureFlags.push({
1527
+ name: ffName,
1528
+ value: ffValue
1529
+ });
1530
+ }
1531
+ }
1532
+ return featureFlags;
1533
+ }
1511
1534
  getExperimentByFeatureFlag(cache, flagName) {
1512
1535
  for (let i = 0; i < cache.experiments.length; i++) {
1513
1536
  if (cache.experiments[i].feature_flags.length) {