@adobe/spacecat-shared-data-access 1.32.0 → 1.33.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,15 @@
1
+ # [@adobe/spacecat-shared-data-access-v1.33.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.32.0...@adobe/spacecat-shared-data-access-v1.33.0) (2024-06-21)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * getSitesByOrganizationID performance ([485818f](https://github.com/adobe/spacecat-shared/commit/485818f846c1ceb0e50b32f531bd2e438cee7614))
7
+
8
+
9
+ ### Features
10
+
11
+ * introduce fixed URLs in audit type config ([#272](https://github.com/adobe/spacecat-shared/issues/272)) ([07858a9](https://github.com/adobe/spacecat-shared/commit/07858a95ce457f395fd2c4269d79b445f34de504))
12
+
1
13
  # [@adobe/spacecat-shared-data-access-v1.32.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.31.0...@adobe/spacecat-shared-data-access-v1.32.0) (2024-06-20)
2
14
 
3
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-data-access",
3
- "version": "1.32.0",
3
+ "version": "1.33.0",
4
4
  "description": "Shared modules of the Spacecat Services - Data Access",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -15,6 +15,7 @@ const AuditConfigType = (data = {}) => {
15
15
  disabled: data.disabled || false,
16
16
  excludedURLs: data.excludedURLs || [],
17
17
  manualOverwrites: data.manualOverwrites || [],
18
+ fixedURLs: data.fixedURLs || [],
18
19
  };
19
20
 
20
21
  const self = {
@@ -27,6 +28,10 @@ const AuditConfigType = (data = {}) => {
27
28
  updateManualOverwrites: (manualOverwrites) => {
28
29
  state.manualOverwrites = manualOverwrites;
29
30
  },
31
+ getFixedURLs: () => state.fixedURLs,
32
+ updateFixedURLs: (fixedURLs) => {
33
+ state.fixedURLs = fixedURLs;
34
+ },
30
35
  updateDisabled: (newValue) => {
31
36
  state.disabled = newValue;
32
37
  },
@@ -40,6 +45,7 @@ AuditConfigType.fromDynamoItem = (dynamoItem) => {
40
45
  disabled: dynamoItem.disabled,
41
46
  excludedURLs: dynamoItem.excludedURLs,
42
47
  manualOverwrites: dynamoItem.manualOverwrites,
48
+ fixedURLs: dynamoItem.fixedURLs,
43
49
  };
44
50
  return AuditConfigType(auditConfigTypeData);
45
51
  };
@@ -48,6 +54,7 @@ AuditConfigType.toDynamoItem = (auditConfigType) => ({
48
54
  disabled: auditConfigType.disabled(),
49
55
  excludedURLs: auditConfigType.getExcludedURLs(),
50
56
  manualOverwrites: auditConfigType.getManualOverwrites(),
57
+ fixedURLs: auditConfigType.getFixedURLs(),
51
58
  });
52
59
 
53
60
  export default AuditConfigType;
@@ -35,6 +35,10 @@ export const configSchema = Joi.object({
35
35
  brokenTargetURL: Joi.string().optional(),
36
36
  targetURL: Joi.string().optional(),
37
37
  })).optional(),
38
+ fixedURLs: Joi.array().items(Joi.object({
39
+ brokenTargetURL: Joi.string().optional(),
40
+ targetURL: Joi.string().optional(),
41
+ })).optional(),
38
42
  }).unknown(true),
39
43
  ).unknown(true),
40
44
  }).unknown(true),
@@ -260,7 +260,6 @@ export const getSitesByOrganizationID = async (
260
260
  ExpressionAttributeValues: {
261
261
  ':organizationId': organizationId,
262
262
  },
263
- Limit: 1,
264
263
  });
265
264
 
266
265
  return dynamoItems.map((dynamoItem) => SiteDto.fromDynamoItem(dynamoItem));