@adobe/spacecat-shared-rum-api-client 2.21.5 → 2.22.0

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-rum-api-client-v2.22.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.21.5...@adobe/spacecat-shared-rum-api-client-v2.22.0) (2025-03-06)
2
+
3
+
4
+ ### Features
5
+
6
+ * **rum-api-client:** pageviews query ([#656](https://github.com/adobe/spacecat-shared/issues/656)) ([349cf1d](https://github.com/adobe/spacecat-shared/commit/349cf1dc716f61ba08921a04726e9a50393893e9))
7
+
1
8
  # [@adobe/spacecat-shared-rum-api-client-v2.21.5](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.21.4...@adobe/spacecat-shared-rum-api-client-v2.21.5) (2025-03-05)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-rum-api-client",
3
- "version": "2.21.5",
3
+ "version": "2.22.0",
4
4
  "description": "Shared modules of the Spacecat Services - Rum API client",
5
5
  "type": "module",
6
6
  "engines": {
@@ -0,0 +1,29 @@
1
+ /*
2
+ * Copyright 2024 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ import { DataChunks, series } from '@adobe/rum-distiller';
13
+ import { loadBundles } from '../utils.js';
14
+
15
+ function handler(bundles) {
16
+ const dataChunks = new DataChunks();
17
+ loadBundles(bundles, dataChunks);
18
+ dataChunks.addSeries('pageviews', series.pageViews);
19
+
20
+ const pageviews = dataChunks?.totals?.pageviews?.weight;
21
+
22
+ return {
23
+ pageviews,
24
+ };
25
+ }
26
+
27
+ export default {
28
+ handler,
29
+ };
package/src/index.js CHANGED
@@ -19,6 +19,7 @@ import experiment from './functions/experiment.js';
19
19
  import trafficAcquisition from './functions/traffic-acquisition.js';
20
20
  import totalMetrics from './functions/total-metrics.js';
21
21
  import variant from './functions/variant.js';
22
+ import pageviews from './functions/pageviews.js';
22
23
  import rageclick from './functions/opportunities/rageclick.js';
23
24
  import highInorganicHighBounceRate from './functions/opportunities/high-inorganic-high-bounce-rate.js';
24
25
  import highOrganicLowCtr from './functions/opportunities/high-organic-low-ctr.js';
@@ -38,6 +39,7 @@ const HANDLERS = {
38
39
  totalMetrics,
39
40
  'high-inorganic-high-bounce-rate': highInorganicHighBounceRate,
40
41
  'high-organic-low-ctr': highOrganicLowCtr,
42
+ pageviews,
41
43
  };
42
44
 
43
45
  function sanitize(opts) {