@adobe/spacecat-shared-data-access 2.9.6 → 2.10.1

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-v2.10.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.10.0...@adobe/spacecat-shared-data-access-v2.10.1) (2025-03-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * getEnabledAuditsForSite not part of Configuration interface ([#646](https://github.com/adobe/spacecat-shared/issues/646)) ([33d7d03](https://github.com/adobe/spacecat-shared/commit/33d7d03ab52069aacb4f6c97fdfdc971a1eb8f1e))
7
+
8
+ # [@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)
9
+
10
+
11
+ ### Features
12
+
13
+ * introduce getEnabledAuditsForSite in the configuration model ([#643](https://github.com/adobe/spacecat-shared/issues/643)) ([c4b60f5](https://github.com/adobe/spacecat-shared/commit/c4b60f519b75a7482856c7e1b35a1e087d2f1731))
14
+
1
15
  # [@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
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-data-access",
3
- "version": "2.9.6",
3
+ "version": "2.10.1",
4
4
  "description": "Shared modules of the Spacecat Services - Data Access",
5
5
  "type": "module",
6
6
  "engines": {
@@ -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;
@@ -22,6 +22,7 @@ export interface Configuration extends BaseModel {
22
22
  enableHandlerForSite(type: string, site: Site): void;
23
23
  getConfigurationId(): string;
24
24
  getEnabledSiteIdsForHandler(type: string): string[];
25
+ getEnabledAuditsForSite(site: Site): string[];
25
26
  getHandler(type: string): object | undefined;
26
27
  getHandlers(): object;
27
28
  getJobs(): object;