@middy/dynamodb 5.5.1 → 6.0.0-beta.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/index.js +3 -3
- package/package.json +5 -2
package/index.js
CHANGED
|
@@ -36,7 +36,7 @@ const dynamodbMiddleware = (opts = {}) => {
|
|
|
36
36
|
)
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
const
|
|
39
|
+
const fetchRequest = (request, cachedValues = {}) => {
|
|
40
40
|
const values = {}
|
|
41
41
|
for (const internalKey in options.fetchData) {
|
|
42
42
|
if (cachedValues[internalKey]) continue
|
|
@@ -59,13 +59,13 @@ const dynamodbMiddleware = (opts = {}) => {
|
|
|
59
59
|
let client
|
|
60
60
|
if (canPrefetch(options)) {
|
|
61
61
|
client = createPrefetchClient(options)
|
|
62
|
-
processCache(options,
|
|
62
|
+
processCache(options, fetchRequest)
|
|
63
63
|
}
|
|
64
64
|
const dynamodbMiddlewareBefore = async (request) => {
|
|
65
65
|
if (!client) {
|
|
66
66
|
client = await createClient(options, request)
|
|
67
67
|
}
|
|
68
|
-
const { value } = processCache(options,
|
|
68
|
+
const { value } = processCache(options, fetchRequest, request)
|
|
69
69
|
Object.assign(request.internal, value)
|
|
70
70
|
if (options.setToContext) {
|
|
71
71
|
const data = await getInternal(Object.keys(options.fetchData), request)
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@middy/dynamodb",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0-beta.0",
|
|
4
4
|
"description": "DynamoDB middleware for the middy framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
|
-
"node": ">=
|
|
7
|
+
"node": ">=20"
|
|
8
8
|
},
|
|
9
9
|
"engineStrict": true,
|
|
10
10
|
"publishConfig": {
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
"import": {
|
|
17
17
|
"types": "./index.d.ts",
|
|
18
18
|
"default": "./index.js"
|
|
19
|
+
},
|
|
20
|
+
"require": {
|
|
21
|
+
"default": "./index.js"
|
|
19
22
|
}
|
|
20
23
|
}
|
|
21
24
|
},
|