@adobe/spacecat-shared-data-access 1.40.0 → 1.41.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-v1.41.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.41.0...@adobe/spacecat-shared-data-access-v1.41.1) (2024-08-14)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update external fixes ([#320](https://github.com/adobe/spacecat-shared/issues/320)) ([c75b743](https://github.com/adobe/spacecat-shared/commit/c75b7432e0add9b261ddc7999fe80b20442a0dd7))
7
+
8
+ # [@adobe/spacecat-shared-data-access-v1.41.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.40.0...@adobe/spacecat-shared-data-access-v1.41.0) (2024-08-09)
9
+
10
+
11
+ ### Features
12
+
13
+ * Introduce scoped API keys ([#312](https://github.com/adobe/spacecat-shared/issues/312)) ([449d273](https://github.com/adobe/spacecat-shared/commit/449d2736154d7e92fb4a3d1f9f290e15e665aa5e))
14
+
1
15
  # [@adobe/spacecat-shared-data-access-v1.40.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.39.1...@adobe/spacecat-shared-data-access-v1.40.0) (2024-08-08)
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.40.0",
3
+ "version": "1.41.1",
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.623.0",
35
- "@aws-sdk/lib-dynamodb": "3.623.0",
34
+ "@aws-sdk/client-dynamodb": "3.624.0",
35
+ "@aws-sdk/lib-dynamodb": "3.624.0",
36
36
  "@types/joi": "17.2.3",
37
37
  "joi": "17.13.3",
38
38
  "uuid": "10.0.0"
@@ -82,12 +82,14 @@ export const createApiKey = (data) => {
82
82
  throw new Error(`Scope name is not part of the pre-defined scopes: ${scope.name}`);
83
83
  }
84
84
 
85
- if (hasText(scope.domains) && !Array.isArray(scope.domains)) {
86
- throw new Error(`Scope domains should be an array: ${scope.domains}`);
87
- }
88
- for (const domain of scope.domains) {
89
- if (!isValidUrl(domain)) {
90
- throw new Error(`Invalid domain: ${domain}`);
85
+ if (scope.domains) {
86
+ if (!Array.isArray(scope.domains)) {
87
+ throw new Error(`Scope domains should be an array: ${scope.domains}`);
88
+ }
89
+ for (const domain of scope.domains) {
90
+ if (!isValidUrl(domain)) {
91
+ throw new Error(`Invalid domain: ${domain}`);
92
+ }
91
93
  }
92
94
  }
93
95
  }
@@ -33,7 +33,7 @@ export const getApiKeyByHashedKey = async (hashedKey, dynamoClient, log, config)
33
33
  ':hashedKey': hashedKey,
34
34
  },
35
35
  });
36
- ApiKeyDto.fromDynamoItem(item);
36
+ return item ? ApiKeyDto.fromDynamoItem(item) : null;
37
37
  };
38
38
 
39
39
  /**