@adobe/spacecat-shared-data-access 1.41.7 → 1.42.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,17 @@
1
+ # [@adobe/spacecat-shared-data-access-v1.42.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.41.8...@adobe/spacecat-shared-data-access-v1.42.0) (2024-08-20)
2
+
3
+
4
+ ### Features
5
+
6
+ * introduce url inspect in google client ([#326](https://github.com/adobe/spacecat-shared/issues/326)) ([eb9e8ae](https://github.com/adobe/spacecat-shared/commit/eb9e8ae67f7a95ca5e4abb993f8b625400735312))
7
+
8
+ # [@adobe/spacecat-shared-data-access-v1.41.8](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.41.7...@adobe/spacecat-shared-data-access-v1.41.8) (2024-08-20)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * add only unique site/org ids in enabled/disabled for a handler ([#322](https://github.com/adobe/spacecat-shared/issues/322)) ([abb01c9](https://github.com/adobe/spacecat-shared/commit/abb01c914f1d77d2adf06c0de80c977945d597bb))
14
+
1
15
  # [@adobe/spacecat-shared-data-access-v1.41.7](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.41.6...@adobe/spacecat-shared-data-access-v1.41.7) (2024-08-20)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-data-access",
3
- "version": "1.41.7",
3
+ "version": "1.42.0",
4
4
  "description": "Shared modules of the Spacecat Services - Data Access",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -69,11 +69,11 @@ const Configuration = (data = {}) => {
69
69
  handler.disabled.orgs = handler.disabled.orgs?.filter((id) => id !== orgId) || [];
70
70
  } else {
71
71
  handler.enabled = handler.enabled || { orgs: [] };
72
- handler.enabled.orgs = [...(handler.enabled?.orgs || []), orgId];
72
+ handler.enabled.orgs = Array.from(new Set([...(handler.enabled?.orgs || []), orgId]));
73
73
  }
74
74
  } else if (handler.enabledByDefault) {
75
75
  handler.disabled = handler.disabled || { orgs: [] };
76
- handler.disabled.orgs = [...(handler.disabled?.orgs || []), orgId];
76
+ handler.disabled.orgs = Array.from(new Set([...(handler.disabled?.orgs || []), orgId]));
77
77
  } else {
78
78
  handler.enabled.orgs = handler.enabled.orgs?.filter((id) => id !== orgId) || [];
79
79
  }
@@ -88,11 +88,11 @@ const Configuration = (data = {}) => {
88
88
  handler.disabled.sites = handler.disabled.sites?.filter((id) => id !== siteId) || [];
89
89
  } else {
90
90
  handler.enabled = handler.enabled || { sites: [] };
91
- handler.enabled.sites = [...(handler.enabled.sites || []), siteId];
91
+ handler.enabled.sites = Array.from(new Set([...(handler.enabled.sites || []), siteId]));
92
92
  }
93
93
  } else if (handler.enabledByDefault) {
94
94
  handler.disabled = handler.disabled || { sites: [] };
95
- handler.disabled.sites = [...(handler.disabled.sites || []), siteId];
95
+ handler.disabled.sites = Array.from(new Set([...(handler.disabled.sites || []), siteId]));
96
96
  } else {
97
97
  handler.enabled.sites = handler.enabled.sites?.filter((id) => id !== siteId) || [];
98
98
  }
@@ -30,6 +30,7 @@ export const configSchema = Joi.object({
30
30
  brokenTargetURL: Joi.string().optional(),
31
31
  targetURL: Joi.string().optional(),
32
32
  })).optional(),
33
+ productDetailPages: Joi.array().items(Joi.string()),
33
34
  }).unknown(true)).unknown(true),
34
35
  }).unknown(true);
35
36
 
@@ -63,6 +64,7 @@ export const Config = (data = {}) => {
63
64
  self.getExcludedURLs = (type) => state?.handlers[type]?.excludedURLs;
64
65
  self.getManualOverwrites = (type) => state?.handlers[type]?.manualOverwrites;
65
66
  self.getFixedURLs = (type) => state?.handlers[type]?.fixedURLs;
67
+ self.getProductDetailPages = (type) => state?.handlers[type]?.productDetailPages;
66
68
 
67
69
  self.updateSlackConfig = (channel, workspace, invitedUserCount) => {
68
70
  state.slack = {