@adobe/spacecat-shared-rum-api-client 2.32.2 → 2.33.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/CHANGELOG.md +14 -0
- package/package.json +2 -2
- package/src/functions/traffic-analysis.js +9 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-rum-api-client-v2.33.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.33.0...@adobe/spacecat-shared-rum-api-client-v2.33.1) (2025-07-19)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** update external fixes ([#859](https://github.com/adobe/spacecat-shared/issues/859)) ([7ca9099](https://github.com/adobe/spacecat-shared/commit/7ca90994d61d07f71e580301365447b94ad07a52))
|
|
7
|
+
|
|
8
|
+
# [@adobe/spacecat-shared-rum-api-client-v2.33.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.32.2...@adobe/spacecat-shared-rum-api-client-v2.33.0) (2025-07-16)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **rum-api-client:** add latest_scroll metric to traffic-analysis import output ([#849](https://github.com/adobe/spacecat-shared/issues/849)) ([6c219ee](https://github.com/adobe/spacecat-shared/commit/6c219eecb9bf0966e83b5a212c919a20add87fb4))
|
|
14
|
+
|
|
1
15
|
# [@adobe/spacecat-shared-rum-api-client-v2.32.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.32.1...@adobe/spacecat-shared-rum-api-client-v2.32.2) (2025-07-12)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/spacecat-shared-rum-api-client",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.33.1",
|
|
4
4
|
"description": "Shared modules of the Spacecat Services - Rum API client",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"chai": "5.2.1",
|
|
48
48
|
"chai-as-promised": "8.0.1",
|
|
49
|
-
"nock": "14.0.
|
|
49
|
+
"nock": "14.0.6",
|
|
50
50
|
"sinon": "20.0.0",
|
|
51
51
|
"sinon-chai": "4.0.0",
|
|
52
52
|
"typescript": "5.8.3"
|
|
@@ -27,10 +27,12 @@ function getCWV(bundle, metric) {
|
|
|
27
27
|
return measurements.length > 0 ? Math.max(...measurements) : null;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
.
|
|
33
|
-
|
|
30
|
+
function getLatestScroll(bundle) {
|
|
31
|
+
const scrolls = bundle.events
|
|
32
|
+
.filter((e) => e.checkpoint === 'viewmedia' || e.checkpoint === 'viewblock')
|
|
33
|
+
.map((e) => e.timeDelta);
|
|
34
|
+
|
|
35
|
+
return scrolls.length > 0 ? Math.max(...scrolls) : null;
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
function getNotFound(bundle) {
|
|
@@ -98,6 +100,7 @@ async function handler(bundles) {
|
|
|
98
100
|
/* eslint-disable camelcase */
|
|
99
101
|
const trafficData = trafficType(bundle, memo);
|
|
100
102
|
const clicked = getClicked(bundle);
|
|
103
|
+
const latestScroll = getLatestScroll(bundle);
|
|
101
104
|
|
|
102
105
|
return {
|
|
103
106
|
path: new URL(bundle.url).pathname,
|
|
@@ -113,7 +116,8 @@ async function handler(bundles) {
|
|
|
113
116
|
notfound: getNotFound(bundle),
|
|
114
117
|
pageviews: bundle.weight,
|
|
115
118
|
clicked,
|
|
116
|
-
engaged:
|
|
119
|
+
engaged: (latestScroll >= 10000 || clicked) ? 1 : 0,
|
|
120
|
+
latest_scroll: latestScroll,
|
|
117
121
|
lcp: getCWV(bundle, 'lcp'),
|
|
118
122
|
inp: getCWV(bundle, 'inp'),
|
|
119
123
|
cls: getCWV(bundle, 'cls'),
|