@adobe/spacecat-shared-utils 1.36.1 → 1.36.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [@adobe/spacecat-shared-utils-v1.36.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.36.1...@adobe/spacecat-shared-utils-v1.36.2) (2025-04-15)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update external fixes ([#679](https://github.com/adobe/spacecat-shared/issues/679)) ([a41bf0c](https://github.com/adobe/spacecat-shared/commit/a41bf0cd488efa0f72af0933992edb256302af18))
7
+
1
8
  # [@adobe/spacecat-shared-utils-v1.36.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.36.0...@adobe/spacecat-shared-utils-v1.36.1) (2025-04-10)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-utils",
3
- "version": "1.36.1",
3
+ "version": "1.36.2",
4
4
  "description": "Shared modules of the Spacecat Services - utils",
5
5
  "type": "module",
6
6
  "engines": {
@@ -39,14 +39,14 @@
39
39
  "chai": "5.2.0",
40
40
  "chai-as-promised": "8.0.1",
41
41
  "husky": "9.1.7",
42
- "nock": "14.0.1",
42
+ "nock": "14.0.3",
43
43
  "sinon": "20.0.0",
44
44
  "sinon-chai": "4.0.0"
45
45
  },
46
46
  "dependencies": {
47
47
  "@adobe/fetch": "4.2.0",
48
- "@aws-sdk/client-s3": "3.758.0",
49
- "@aws-sdk/client-sqs": "3.758.0",
48
+ "@aws-sdk/client-s3": "3.787.0",
49
+ "@aws-sdk/client-sqs": "3.787.0",
50
50
  "@json2csv/plainjs": "7.0.6",
51
51
  "aws-xray-sdk": "3.10.3",
52
52
  "uuid": "11.1.0"
package/src/formcalc.js CHANGED
@@ -28,6 +28,7 @@ function aggregateFormVitalsByDevice(formVitalsCollection) {
28
28
  formVitalsCollection.forEach((item) => {
29
29
  const {
30
30
  url, formview = {}, formengagement = {}, pageview = {}, formsubmit = {},
31
+ trafficacquisition = {},
31
32
  } = item;
32
33
 
33
34
  const totals = {
@@ -54,7 +55,7 @@ function aggregateFormVitalsByDevice(formVitalsCollection) {
54
55
  totals.formengagement = calculateSums(formengagement, totals.formengagement);
55
56
  totals.pageview = calculateSums(pageview, totals.pageview);
56
57
  totals.formsubmit = calculateSums(formsubmit, totals.formsubmit);
57
-
58
+ totals.trafficacquisition = trafficacquisition;
58
59
  resultMap.set(url, totals);
59
60
  });
60
61
 
@@ -90,18 +91,13 @@ export function getHighFormViewsLowConversionMetrics(formVitalsCollection) {
90
91
  const urls = [];
91
92
  resultMap.forEach((metrics, url) => {
92
93
  const pageViews = metrics.pageview.total;
93
- // Default to pageViews if formViews are not available
94
- const formViews = metrics.formview.total || pageViews;
95
- const formEngagement = metrics.formengagement.total;
94
+ const formViews = metrics.formview.total;
96
95
  const formSubmit = metrics.formsubmit.total;
97
96
 
98
97
  if (hasHighPageViews(pageViews) && hasLowerConversionRate(formSubmit, formViews)) {
99
98
  urls.push({
100
99
  url,
101
- pageViews,
102
- formViews,
103
- formEngagement,
104
- formSubmit,
100
+ ...metrics,
105
101
  });
106
102
  }
107
103
  });
@@ -182,9 +178,7 @@ export function getHighPageViewsLowFormCtrMetrics(formVitalsCollection) {
182
178
  if (deviceData != null) {
183
179
  urls.push({
184
180
  url: entry.url,
185
- pageViews: deviceData.pageview.total,
186
- formViews: deviceData.formview.total,
187
- formEngagement: deviceData.formengagement.total,
181
+ ...deviceData,
188
182
  CTA: {
189
183
  url: maxPageviewUrl.url,
190
184
  source: y.source,