@adobe/spacecat-shared-data-access 1.10.4 → 1.11.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.11.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.10.5...@adobe/spacecat-shared-data-access-v1.11.0) (2024-01-29)
2
+
3
+
4
+ ### Features
5
+
6
+ * default value for disabled property of audit config ([#114](https://github.com/adobe/spacecat-shared/issues/114)) ([daf9b80](https://github.com/adobe/spacecat-shared/commit/daf9b8039a6fe567e283dc07eef156bfd13edc4f))
7
+
8
+ # [@adobe/spacecat-shared-data-access-v1.10.5](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.10.4...@adobe/spacecat-shared-data-access-v1.10.5) (2024-01-27)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update external fixes to v3.501.0 ([#115](https://github.com/adobe/spacecat-shared/issues/115)) ([7cf246f](https://github.com/adobe/spacecat-shared/commit/7cf246f4ddb303f149937bbe019032b876934bd7))
14
+
1
15
  # [@adobe/spacecat-shared-data-access-v1.10.4](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.10.3...@adobe/spacecat-shared-data-access-v1.10.4) (2024-01-26)
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.10.4",
3
+ "version": "1.11.0",
4
4
  "description": "Shared modules of the Spacecat Services - Data Access",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -31,8 +31,8 @@
31
31
  "dependencies": {
32
32
  "@adobe/spacecat-shared-dynamo": "1.2.5",
33
33
  "@adobe/spacecat-shared-utils": "1.2.0",
34
- "@aws-sdk/client-dynamodb": "3.499.0",
35
- "@aws-sdk/lib-dynamodb": "3.499.0",
34
+ "@aws-sdk/client-dynamodb": "3.501.0",
35
+ "@aws-sdk/lib-dynamodb": "3.501.0",
36
36
  "@types/joi": "17.2.3",
37
37
  "joi": "17.12.0",
38
38
  "uuid": "9.0.1"
@@ -40,7 +40,7 @@
40
40
  "devDependencies": {
41
41
  "chai": "4.4.1",
42
42
  "chai-as-promised": "7.1.1",
43
- "dynamo-db-local": "6.1.0",
43
+ "dynamo-db-local": "7.3.0",
44
44
  "sinon": "17.0.1"
45
45
  }
46
46
  }
@@ -11,10 +11,27 @@
11
11
  */
12
12
 
13
13
  import AuditConfigType from './audit-config-type.js';
14
+ import { AUDIT_TYPE_BROKEN_BACKLINKS } from '../audit.js';
15
+
16
+ const AUDIT_TYPE_DISABLED_DEFAULTS = {
17
+ [AUDIT_TYPE_BROKEN_BACKLINKS]: true,
18
+ };
14
19
 
15
20
  function getAuditTypeConfigs(auditTypeConfigs, auditsDisabled) {
21
+ if (!auditTypeConfigs || Object.keys(auditTypeConfigs).length === 0) {
22
+ return {
23
+ [AUDIT_TYPE_BROKEN_BACKLINKS]: AuditConfigType({ disabled: true }),
24
+ };
25
+ }
16
26
  return Object.entries(auditTypeConfigs || {}).reduce((acc, [key, value]) => {
17
- acc[key] = AuditConfigType(value, auditsDisabled);
27
+ const disabled = value.disabled !== undefined
28
+ ? value.disabled : (AUDIT_TYPE_DISABLED_DEFAULTS[key] || auditsDisabled || false);
29
+ acc[key] = AuditConfigType(
30
+ {
31
+ ...value,
32
+ disabled,
33
+ },
34
+ );
18
35
  return acc;
19
36
  }, {});
20
37
  }