@middy/s3 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 +7 -4
package/index.js
CHANGED
|
@@ -28,7 +28,7 @@ const s3Middleware = (opts = {}) => {
|
|
|
28
28
|
...defaults,
|
|
29
29
|
...opts
|
|
30
30
|
}
|
|
31
|
-
const
|
|
31
|
+
const fetchRequest = (request, cachedValues = {}) => {
|
|
32
32
|
const values = {}
|
|
33
33
|
for (const internalKey of Object.keys(options.fetchData)) {
|
|
34
34
|
if (cachedValues[internalKey]) continue
|
|
@@ -55,13 +55,13 @@ const s3Middleware = (opts = {}) => {
|
|
|
55
55
|
let client
|
|
56
56
|
if (canPrefetch(options)) {
|
|
57
57
|
client = createPrefetchClient(options)
|
|
58
|
-
processCache(options,
|
|
58
|
+
processCache(options, fetchRequest)
|
|
59
59
|
}
|
|
60
60
|
const s3MiddlewareBefore = async (request) => {
|
|
61
61
|
if (!client) {
|
|
62
62
|
client = await createClient(options, request)
|
|
63
63
|
}
|
|
64
|
-
const { value } = processCache(options,
|
|
64
|
+
const { value } = processCache(options, fetchRequest, request)
|
|
65
65
|
Object.assign(request.internal, value)
|
|
66
66
|
if (options.setToContext) {
|
|
67
67
|
const data = await getInternal(Object.keys(options.fetchData), request)
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@middy/s3",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0-beta.0",
|
|
4
4
|
"description": "S3 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
|
},
|
|
@@ -58,11 +61,11 @@
|
|
|
58
61
|
"url": "https://github.com/sponsors/willfarrell"
|
|
59
62
|
},
|
|
60
63
|
"dependencies": {
|
|
61
|
-
"@middy/util": "
|
|
64
|
+
"@middy/util": "6.0.0-beta.0"
|
|
62
65
|
},
|
|
63
66
|
"devDependencies": {
|
|
64
67
|
"@aws-sdk/client-s3": "^3.0.0",
|
|
65
|
-
"@middy/core": "
|
|
68
|
+
"@middy/core": "6.0.0-beta.0",
|
|
66
69
|
"@types/aws-lambda": "^8.10.101",
|
|
67
70
|
"aws-xray-sdk": "^3.3.3"
|
|
68
71
|
},
|