@adobe/spacecat-shared-athena-client 1.6.1 → 1.7.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-athena-client-v1.7.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-athena-client-v1.6.1...@adobe/spacecat-shared-athena-client-v1.7.0) (2025-11-20)
2
+
3
+
4
+ ### Features
5
+
6
+ * athena multi week queries ([#1157](https://github.com/adobe/spacecat-shared/issues/1157)) ([8a4f54b](https://github.com/adobe/spacecat-shared/commit/8a4f54b9cff7248eae1b7ea772f09a2d7e64579f))
7
+
1
8
  # [@adobe/spacecat-shared-athena-client-v1.6.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-athena-client-v1.6.0...@adobe/spacecat-shared-athena-client-v1.6.1) (2025-11-15)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-athena-client",
3
- "version": "1.6.1",
3
+ "version": "1.7.0",
4
4
  "description": "Shared modules of the Spacecat Services - AWS Athena Client",
5
5
  "type": "module",
6
6
  "engines": {
@@ -35,8 +35,8 @@
35
35
  "access": "public"
36
36
  },
37
37
  "dependencies": {
38
- "@aws-sdk/client-athena": "3.932.0",
39
- "@adobe/spacecat-shared-utils": "1.66.0"
38
+ "@adobe/spacecat-shared-utils": "1.77.1",
39
+ "@aws-sdk/client-athena": "3.932.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "chai": "6.2.1",
@@ -91,6 +91,7 @@ export function getTrafficAnalysisQueryPlaceholdersFilled({
91
91
  trfTypes = null,
92
92
  temporalCondition = null,
93
93
  pageViewThreshold = 1000,
94
+ numTemporalSeries = 1,
94
95
  }) {
95
96
  if (!siteId || !tableName) {
96
97
  throw new Error('Missing required parameters: siteId, or tableName');
@@ -109,7 +110,12 @@ export function getTrafficAnalysisQueryPlaceholdersFilled({
109
110
 
110
111
  let tempCondition = null;
111
112
  if (!temporalCondition) {
112
- tempCondition = getTemporalCondition({ week, month, year });
113
+ tempCondition = getTemporalCondition({
114
+ week,
115
+ month,
116
+ year,
117
+ numSeries: numTemporalSeries,
118
+ });
113
119
  }
114
120
 
115
121
  let pageTypeCase = 'NULL as page_type';
@@ -48,8 +48,9 @@ WITH min_totals AS (
48
48
  ),
49
49
  raw AS (
50
50
  SELECT
51
+ week,
51
52
  path,
52
- ${pageTypeCase},
53
+ ${pageTypeCase},
53
54
  trf_type,
54
55
  trf_channel,
55
56
  trf_platform,
@@ -64,7 +65,7 @@ raw AS (
64
65
  clicked,
65
66
  engaged,
66
67
  latest_scroll,
67
- CASE WHEN latest_scroll >= 10000 THEN 1 ELSE 0 END AS engaged_scroll,
68
+ CASE WHEN latest_scroll >= 10000 THEN 1 ELSE 0 END AS engaged_scroll,
68
69
  lcp,
69
70
  cls,
70
71
  inp
@@ -76,6 +77,7 @@ raw AS (
76
77
  ),
77
78
  agg AS (
78
79
  SELECT
80
+ week,
79
81
  ${dimensionColumns},
80
82
  COUNT(*) AS row_count,
81
83
  CAST(SUM(pageviews) AS BIGINT) AS pageviews,
@@ -87,12 +89,13 @@ agg AS (
87
89
  approx_percentile(cls, 0.70) AS p70_cls,
88
90
  approx_percentile(inp, 0.70) AS p70_inp
89
91
  FROM raw
90
- GROUP BY ${groupBy}
92
+ GROUP BY week, ${groupBy}
91
93
  ),
92
94
  grand_total AS (
93
95
  SELECT CAST(SUM(pageviews) AS BIGINT) AS total_pv FROM agg
94
96
  )
95
97
  SELECT
98
+ a.week,
96
99
  ${dimensionColumnsPrefixed},
97
100
  a.pageviews,
98
101
  CAST(a.pageviews AS DOUBLE) / NULLIF(t.total_pv, 0) AS pct_pageviews,
@@ -33,6 +33,7 @@ export const TrafficDataResponseDto = {
33
33
  * }} JSON object.
34
34
  */
35
35
  toJSON: (data) => ({
36
+ week: data.week,
36
37
  type: data.trf_type,
37
38
  channel: data.trf_channel,
38
39
  platform: data.trf_platform,