@adobe/spacecat-shared-rum-api-client 2.25.0 → 2.25.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,17 @@
1
+ # [@adobe/spacecat-shared-rum-api-client-v2.25.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.25.1...@adobe/spacecat-shared-rum-api-client-v2.25.2) (2025-05-19)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update dependency @adobe/fetch to v4.2.2 ([#747](https://github.com/adobe/spacecat-shared/issues/747)) ([64e350a](https://github.com/adobe/spacecat-shared/commit/64e350ad62b7b6d3ad9aa47c66f51ba16508fc6c))
7
+
8
+ # [@adobe/spacecat-shared-rum-api-client-v2.25.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.25.0...@adobe/spacecat-shared-rum-api-client-v2.25.1) (2025-05-19)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * use rum bundler for consent classification ([#744](https://github.com/adobe/spacecat-shared/issues/744)) ([251ca76](https://github.com/adobe/spacecat-shared/commit/251ca76ec65c3775fdc1656143cfd1767bfb9b1c))
14
+
1
15
  # [@adobe/spacecat-shared-rum-api-client-v2.25.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.24.3...@adobe/spacecat-shared-rum-api-client-v2.25.0) (2025-05-16)
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.25.0",
3
+ "version": "2.25.2",
4
4
  "description": "Shared modules of the Spacecat Services - Rum API client",
5
5
  "type": "module",
6
6
  "engines": {
@@ -35,7 +35,7 @@
35
35
  "access": "public"
36
36
  },
37
37
  "dependencies": {
38
- "@adobe/fetch": "4.2.1",
38
+ "@adobe/fetch": "4.2.2",
39
39
  "@adobe/helix-shared-wrap": "2.0.2",
40
40
  "@adobe/helix-universal": "5.2.1",
41
41
  "@adobe/spacecat-shared-utils": "1.26.4",
@@ -14,95 +14,3 @@ export const GRANULARITY = {
14
14
  HOURLY: 'HOURLY',
15
15
  DAILY: 'DAILY',
16
16
  };
17
-
18
- export const COOKIE_CONSENT_SELECTORS = [
19
- // OneTrust
20
- 'onetrust',
21
- '.onetrust-banner',
22
- '#onetrust-consent-sdk',
23
- '#onetrust-banner-sdk',
24
- '#ot-sdk-cookie-policy',
25
- '.ot-sdk-container',
26
- '.ot-sdk-row',
27
- '.ot-sdk-column',
28
- '.ot-sdk-show-settings',
29
- '#ot-',
30
- '.ot-',
31
-
32
- // Cookiebot / Usercentrics
33
- '#CybotCookiebotDialog',
34
- '.CybotCookiebotDialog',
35
- '#CookiebotWidget',
36
- '.CookiebotWidget',
37
- '.cookie-consent__banner',
38
- '.cookie-consent__dialog',
39
- '.cookie-consent__button',
40
-
41
- // TrustArc
42
- 'truste-',
43
- '#truste-',
44
- '#truste-consent-banner',
45
- '.truste-consent-banner',
46
- '#truste-consent-button',
47
- '.truste-consent-button',
48
- '.truste-consent-text',
49
- '.truste-consent-close',
50
-
51
- // CookieYes
52
- '#cookieyes-banner',
53
- '.cky-consent',
54
- '.cky-banner',
55
- '.cky-btn',
56
- '.cky-btn-accept',
57
- '.cky-btn-reject',
58
- '.cky-btn-settings',
59
-
60
- // Termly
61
- '#termly-consent-banner',
62
- '.termly-consent-banner',
63
- '.termly-consent-button',
64
- '.termly-consent-text',
65
- '.termly-consent-close',
66
-
67
- // CookieScript
68
- '#cookiescript_injected',
69
- '.cookiescript-consent',
70
- '.cookiescript-banner',
71
- '.cookiescript-btn',
72
- '.cookiescript-btn-accept',
73
- '.cookiescript-btn-reject',
74
- '.cookiescript-btn-settings',
75
-
76
- // CookieFirst
77
- '#cookiefirst-root',
78
- '.cookiefirst-banner',
79
- '.cookiefirst-button',
80
- '.cookiefirst-text',
81
- '.cookiefirst-close',
82
-
83
- // Quantcast Choice
84
- '#qc-cmp2-ui',
85
- '.qc-cmp2-ui',
86
- '.qc-cmp2-summary',
87
- '.qc-cmp2-footer',
88
- '.qc-cmp2-header',
89
- '.qc-cmp2-buttons',
90
- '.qc-cmp2-button',
91
- '.qc-cmp2-button-accept',
92
- '.qc-cmp2-button-reject',
93
-
94
- // Crownpeak (Evidon)
95
- '#evidon-banner',
96
- '.evidon-banner',
97
- '.evidon-button',
98
- '.evidon-text',
99
- '.evidon-close',
100
-
101
- // Popupsmart
102
- '#popupsmart-consent',
103
- '.popupsmart-consent',
104
- '.popupsmart-banner',
105
- '.popupsmart-button',
106
- '.popupsmart-text',
107
- '.popupsmart-close',
108
- ];
@@ -10,8 +10,8 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- import { hasText, isNonEmptyObject } from '@adobe/spacecat-shared-utils';
14
- import { COOKIE_CONSENT_SELECTORS } from './constants.js';
13
+ import { hasText, isNonEmptyObject, isString } from '@adobe/spacecat-shared-utils';
14
+ import classifyConsent from '@adobe/rum-distiller/consent.js';
15
15
 
16
16
  const uncategorized = 'uncategorized';
17
17
 
@@ -39,10 +39,6 @@ export function getPageType(bundle, pageTypes) {
39
39
  }
40
40
 
41
41
  export function isConsentClick(source) {
42
- if (typeof source !== 'string' || !source) {
43
- return false;
44
- }
45
-
46
- const sourceLower = source.toLowerCase();
47
- return COOKIE_CONSENT_SELECTORS.some((keyword) => sourceLower.includes(keyword.toLowerCase()));
42
+ const consent = isString(source) ? classifyConsent(source?.toLocaleLowerCase()) : undefined;
43
+ return !(consent === undefined);
48
44
  }