@uniformdev/insights 20.43.1-alpha.2 → 20.43.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/dist/index.esm.js CHANGED
@@ -428,7 +428,7 @@ var createInsightsCore = (options) => {
428
428
  const {
429
429
  endpoint,
430
430
  storage: customStorage,
431
- batchConfig = DEFAULT_BATCH_CONFIG,
431
+ batchConfig,
432
432
  sessionDurationSeconds = 30 * 60,
433
433
  getVisitorId = generateVisitorId,
434
434
  getSessionId = generateSessionId
@@ -633,14 +633,21 @@ var createInsightsPlugin = (options) => {
633
633
  eventQueue.push(eventFn);
634
634
  }
635
635
  };
636
- const handleSegmentUpdates = (updatedScores, compositionData) => {
636
+ const previousScores = {};
637
+ const handleScoreUpdates = (updatedScores, compositionData) => {
637
638
  if (!contextInstance) {
638
639
  return;
639
640
  }
640
641
  Object.entries(updatedScores).forEach(([scoreKey, value]) => {
642
+ var _a, _b;
643
+ if (previousScores[scoreKey] === value) {
644
+ return;
645
+ }
641
646
  const aggregateDimension = contextInstance.manifest.getAggregateDimensionByKey(scoreKey);
642
- if (aggregateDimension) {
647
+ const signalDimension = (_b = (_a = contextInstance.manifest.data.project.pz) == null ? void 0 : _a.sig) == null ? void 0 : _b[scoreKey];
648
+ if (aggregateDimension || signalDimension) {
643
649
  insights.segmentUpdated(scoreKey, value, compositionData);
650
+ previousScores[scoreKey] = value;
644
651
  }
645
652
  });
646
653
  };
@@ -729,7 +736,7 @@ var createInsightsPlugin = (options) => {
729
736
  }
730
737
  if (recalculatedScores) {
731
738
  queueEvent(() => {
732
- handleSegmentUpdates(recalculatedScores, compositionMetadata);
739
+ handleScoreUpdates(recalculatedScores, compositionMetadata);
733
740
  });
734
741
  }
735
742
  },
package/dist/index.js CHANGED
@@ -464,7 +464,7 @@ var createInsightsCore = (options) => {
464
464
  const {
465
465
  endpoint,
466
466
  storage: customStorage,
467
- batchConfig = DEFAULT_BATCH_CONFIG,
467
+ batchConfig,
468
468
  sessionDurationSeconds = 30 * 60,
469
469
  getVisitorId = generateVisitorId,
470
470
  getSessionId = generateSessionId
@@ -669,14 +669,21 @@ var createInsightsPlugin = (options) => {
669
669
  eventQueue.push(eventFn);
670
670
  }
671
671
  };
672
- const handleSegmentUpdates = (updatedScores, compositionData) => {
672
+ const previousScores = {};
673
+ const handleScoreUpdates = (updatedScores, compositionData) => {
673
674
  if (!contextInstance) {
674
675
  return;
675
676
  }
676
677
  Object.entries(updatedScores).forEach(([scoreKey, value]) => {
678
+ var _a, _b;
679
+ if (previousScores[scoreKey] === value) {
680
+ return;
681
+ }
677
682
  const aggregateDimension = contextInstance.manifest.getAggregateDimensionByKey(scoreKey);
678
- if (aggregateDimension) {
683
+ const signalDimension = (_b = (_a = contextInstance.manifest.data.project.pz) == null ? void 0 : _a.sig) == null ? void 0 : _b[scoreKey];
684
+ if (aggregateDimension || signalDimension) {
679
685
  insights.segmentUpdated(scoreKey, value, compositionData);
686
+ previousScores[scoreKey] = value;
680
687
  }
681
688
  });
682
689
  };
@@ -765,7 +772,7 @@ var createInsightsPlugin = (options) => {
765
772
  }
766
773
  if (recalculatedScores) {
767
774
  queueEvent(() => {
768
- handleSegmentUpdates(recalculatedScores, compositionMetadata);
775
+ handleScoreUpdates(recalculatedScores, compositionMetadata);
769
776
  });
770
777
  }
771
778
  },
package/dist/index.mjs CHANGED
@@ -428,7 +428,7 @@ var createInsightsCore = (options) => {
428
428
  const {
429
429
  endpoint,
430
430
  storage: customStorage,
431
- batchConfig = DEFAULT_BATCH_CONFIG,
431
+ batchConfig,
432
432
  sessionDurationSeconds = 30 * 60,
433
433
  getVisitorId = generateVisitorId,
434
434
  getSessionId = generateSessionId
@@ -633,14 +633,21 @@ var createInsightsPlugin = (options) => {
633
633
  eventQueue.push(eventFn);
634
634
  }
635
635
  };
636
- const handleSegmentUpdates = (updatedScores, compositionData) => {
636
+ const previousScores = {};
637
+ const handleScoreUpdates = (updatedScores, compositionData) => {
637
638
  if (!contextInstance) {
638
639
  return;
639
640
  }
640
641
  Object.entries(updatedScores).forEach(([scoreKey, value]) => {
642
+ var _a, _b;
643
+ if (previousScores[scoreKey] === value) {
644
+ return;
645
+ }
641
646
  const aggregateDimension = contextInstance.manifest.getAggregateDimensionByKey(scoreKey);
642
- if (aggregateDimension) {
647
+ const signalDimension = (_b = (_a = contextInstance.manifest.data.project.pz) == null ? void 0 : _a.sig) == null ? void 0 : _b[scoreKey];
648
+ if (aggregateDimension || signalDimension) {
643
649
  insights.segmentUpdated(scoreKey, value, compositionData);
650
+ previousScores[scoreKey] = value;
644
651
  }
645
652
  });
646
653
  };
@@ -729,7 +736,7 @@ var createInsightsPlugin = (options) => {
729
736
  }
730
737
  if (recalculatedScores) {
731
738
  queueEvent(() => {
732
- handleSegmentUpdates(recalculatedScores, compositionMetadata);
739
+ handleScoreUpdates(recalculatedScores, compositionMetadata);
733
740
  });
734
741
  }
735
742
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/insights",
3
- "version": "20.43.1-alpha.2+adfe3dca79",
3
+ "version": "20.43.1",
4
4
  "description": "Uniform Context Insights package",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -50,7 +50,7 @@
50
50
  "vitest": "3.2.4"
51
51
  },
52
52
  "dependencies": {
53
- "@uniformdev/context": "20.43.1-alpha.2+adfe3dca79",
53
+ "@uniformdev/context": "20.43.1",
54
54
  "p-limit": "3.1.0"
55
55
  },
56
56
  "files": [
@@ -59,5 +59,5 @@
59
59
  "publishConfig": {
60
60
  "access": "public"
61
61
  },
62
- "gitHead": "adfe3dca79f0d87c8e7284ed0abd5461920bcaa6"
62
+ "gitHead": "512dbd842eab9d59ce8c241eb92a5fd058893336"
63
63
  }