@adobe/spacecat-shared-data-access 2.80.1 → 2.81.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-v2.81.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.80.2...@adobe/spacecat-shared-data-access-v2.81.0) (2025-11-11)
2
+
3
+
4
+ ### Features
5
+
6
+ * **COMOPT-880:** add PRODUCT_METATAGS_AUTO_FIX audit type ([#1112](https://github.com/adobe/spacecat-shared/issues/1112)) ([b4e61db](https://github.com/adobe/spacecat-shared/commit/b4e61dbfa9b0d7c18a30d9ac025cfaa05c7d5bc0))
7
+
8
+ # [@adobe/spacecat-shared-data-access-v2.80.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.80.1...@adobe/spacecat-shared-data-access-v2.80.2) (2025-11-10)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **dynamo-db:** prevent connection storms in Lambda by caching client instances ([#1110](https://github.com/adobe/spacecat-shared/issues/1110)) ([f854100](https://github.com/adobe/spacecat-shared/commit/f85410088a2290dbab8d8956c16137e99e47147b))
14
+
1
15
  # [@adobe/spacecat-shared-data-access-v2.80.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.80.0...@adobe/spacecat-shared-data-access-v2.80.1) (2025-11-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": "2.80.1",
3
+ "version": "2.81.0",
4
4
  "description": "Shared modules of the Spacecat Services - Data Access",
5
5
  "type": "module",
6
6
  "engines": {
@@ -68,6 +68,7 @@ class Audit extends BaseModel {
68
68
  PRERENDER: 'prerender',
69
69
  PRODUCT_METATAGS: 'product-metatags',
70
70
  PRODUCT_METATAGS_AUTO_SUGGEST: 'product-metatags-auto-suggest',
71
+ PRODUCT_METATAGS_AUTO_FIX: 'product-metatags-auto-fix',
71
72
  SUMMARIZATION: 'summarization',
72
73
  PAGE_TYPE_DETECTION: 'page-type-detection',
73
74
  FAQS: 'faqs',
@@ -22,14 +22,29 @@ export * from '../errors/index.js';
22
22
  export * from '../models/index.js';
23
23
  export * from '../util/index.js';
24
24
 
25
+ let defaultDynamoDBClient;
26
+ const documentClientCache = new WeakMap();
27
+
25
28
  const createRawClient = (client = undefined) => {
26
- const dbClient = instrumentAWSClient(client || new DynamoDB());
27
- return DynamoDBDocument.from(dbClient, {
28
- marshallOptions: {
29
- convertEmptyValues: true,
30
- removeUndefinedValues: true,
31
- },
32
- });
29
+ const rawClient = client || (() => {
30
+ if (!defaultDynamoDBClient) {
31
+ defaultDynamoDBClient = new DynamoDB();
32
+ }
33
+ return defaultDynamoDBClient;
34
+ })();
35
+
36
+ let documentClient = documentClientCache.get(rawClient);
37
+ if (!documentClient) {
38
+ documentClient = DynamoDBDocument.from(instrumentAWSClient(rawClient), {
39
+ marshallOptions: {
40
+ convertEmptyValues: true,
41
+ removeUndefinedValues: true,
42
+ },
43
+ });
44
+ documentClientCache.set(rawClient, documentClient);
45
+ }
46
+
47
+ return documentClient;
33
48
  };
34
49
 
35
50
  const createElectroService = (client, config, log) => {