@adobe/spacecat-shared-data-access 2.9.6 → 2.10.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-data-access-v2.10.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.9.6...@adobe/spacecat-shared-data-access-v2.10.0) (2025-03-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* introduce getEnabledAuditsForSite in the configuration model ([#643](https://github.com/adobe/spacecat-shared/issues/643)) ([c4b60f5](https://github.com/adobe/spacecat-shared/commit/c4b60f519b75a7482856c7e1b35a1e087d2f1731))
|
|
7
|
+
|
|
1
8
|
# [@adobe/spacecat-shared-data-access-v2.9.6](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.9.5...@adobe/spacecat-shared-data-access-v2.9.6) (2025-03-03)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
|
@@ -62,6 +62,17 @@ class Configuration extends BaseModel {
|
|
|
62
62
|
return this.getHandler(type)?.enabled?.sites || [];
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
getEnabledAuditsForSite(site) {
|
|
66
|
+
const enabledHandlers = new Set(
|
|
67
|
+
Object.keys(this.getHandlers() || {})
|
|
68
|
+
.filter((handler) => this.isHandlerEnabledForSite(handler, site)),
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
return (this.getJobs() || [])
|
|
72
|
+
.filter((job) => job.group === 'audits' && enabledHandlers.has(job.type))
|
|
73
|
+
.map((job) => job.type);
|
|
74
|
+
}
|
|
75
|
+
|
|
65
76
|
isHandlerEnabledForSite(type, site) {
|
|
66
77
|
const handler = this.getHandlers()?.[type];
|
|
67
78
|
if (!handler) return false;
|