@adobe/spacecat-shared-rum-api-client 2.5.0 → 2.5.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.5.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.5.1...@adobe/spacecat-shared-rum-api-client-v2.5.2) (2024-07-30)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * updating inferred start and end dates to reflect old and latest from RUM bundles ([#303](https://github.com/adobe/spacecat-shared/issues/303)) ([92852bd](https://github.com/adobe/spacecat-shared/commit/92852bd5e5f033fbc568c70cc7d6f5d5eda50deb))
7
+
8
+ # [@adobe/spacecat-shared-rum-api-client-v2.5.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.5.0...@adobe/spacecat-shared-rum-api-client-v2.5.1) (2024-07-27)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update external fixes ([#304](https://github.com/adobe/spacecat-shared/issues/304)) ([c6c56a7](https://github.com/adobe/spacecat-shared/commit/c6c56a72897acb60fb042215b708816ec16a5870))
14
+
1
15
  # [@adobe/spacecat-shared-rum-api-client-v2.5.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v2.4.0...@adobe/spacecat-shared-rum-api-client-v2.5.0) (2024-07-23)
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.5.0",
3
+ "version": "2.5.2",
4
4
  "description": "Shared modules of the Spacecat Services - Rum API client",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -39,11 +39,11 @@
39
39
  "d3-array": "3.2.4"
40
40
  },
41
41
  "devDependencies": {
42
- "chai": "4.4.1",
42
+ "chai": "4.5.0",
43
43
  "chai-as-promised": "8.0.0",
44
44
  "nock": "13.5.4",
45
45
  "sinon": "18.0.0",
46
46
  "sinon-chai": "3.7.0",
47
- "typescript": "5.5.3"
47
+ "typescript": "5.5.4"
48
48
  }
49
49
  }
@@ -55,31 +55,20 @@ function updateInferredStartAndEndDate(experimentObject, time) {
55
55
  const bundleDate = new Date(bundleTime);
56
56
  bundleDate.setHours(0, 0, 0, 0);
57
57
  if (!experimentObject.inferredStartDate && !experimentObject.inferredEndDate) {
58
- // adding the inferredStartDate and inferredEndDate properties for the first time
59
58
  // eslint-disable-next-line no-param-reassign
60
59
  experimentObject.inferredStartDate = time;
61
- // check if bundleTime is before yesterday
62
- if (bundleDate < yesterday) {
63
- // RUM data is delayed by a day, so if we don't have
64
- // any RUM data for yesterday, so we can infer the endDate
65
- // eslint-disable-next-line no-param-reassign
66
- experimentObject.inferredEndDate = time;
67
- } else {
68
- // eslint-disable-next-line no-param-reassign
69
- experimentObject.inferredEndDate = null;
70
- }
60
+ // eslint-disable-next-line no-param-reassign
61
+ experimentObject.inferredEndDate = time;
71
62
  } else {
72
63
  const inferredStartDateObj = new Date(experimentObject.inferredStartDate);
64
+ const inferredEndDateObj = new Date(experimentObject.inferredEndDate);
73
65
  if (bundleTime < inferredStartDateObj) {
74
66
  // eslint-disable-next-line no-param-reassign
75
67
  experimentObject.inferredStartDate = time;
76
68
  }
77
- if (bundleDate < yesterday) {
78
- if (!experimentObject.inferredEndDate
79
- || (bundleTime > new Date(experimentObject.inferredEndDate))) {
80
- // eslint-disable-next-line no-param-reassign
81
- experimentObject.inferredEndDate = time;
82
- }
69
+ if (bundleTime > inferredEndDateObj) {
70
+ // eslint-disable-next-line no-param-reassign
71
+ experimentObject.inferredEndDate = time;
83
72
  }
84
73
  }
85
74
  }