@middy/s3 7.2.1 → 7.2.3
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 +4 -2
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
createPrefetchClient,
|
|
9
9
|
getCache,
|
|
10
10
|
getInternal,
|
|
11
|
+
jsonContentTypePattern,
|
|
11
12
|
jsonSafeParse,
|
|
12
13
|
modifyCache,
|
|
13
14
|
processCache,
|
|
@@ -25,7 +26,6 @@ const defaults = {
|
|
|
25
26
|
cacheExpiry: -1,
|
|
26
27
|
setToContext: false,
|
|
27
28
|
};
|
|
28
|
-
const jsonContentTypePattern = /^application\/([a-z0-9.+-]+\+)?json(;|$)/i;
|
|
29
29
|
const s3Middleware = (opts = {}) => {
|
|
30
30
|
const options = {
|
|
31
31
|
...defaults,
|
|
@@ -57,13 +57,15 @@ const s3Middleware = (opts = {}) => {
|
|
|
57
57
|
return values;
|
|
58
58
|
};
|
|
59
59
|
let client;
|
|
60
|
+
let clientInit;
|
|
60
61
|
if (canPrefetch(options)) {
|
|
61
62
|
client = createPrefetchClient(options);
|
|
62
63
|
processCache(options, fetchRequest);
|
|
63
64
|
}
|
|
64
65
|
const s3MiddlewareBefore = async (request) => {
|
|
65
66
|
if (!client) {
|
|
66
|
-
|
|
67
|
+
clientInit ??= createClient(options, request);
|
|
68
|
+
client = await clientInit;
|
|
67
69
|
}
|
|
68
70
|
const { value } = processCache(options, fetchRequest, request);
|
|
69
71
|
Object.assign(request.internal, value);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@middy/s3",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.3",
|
|
4
4
|
"description": "S3 middleware for the middy framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"url": "https://github.com/sponsors/willfarrell"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@middy/util": "7.2.
|
|
66
|
+
"@middy/util": "7.2.3"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"@aws-sdk/client-s3": "^3.0.0"
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@aws-sdk/client-s3": "^3.0.0",
|
|
78
|
-
"@middy/core": "7.2.
|
|
78
|
+
"@middy/core": "7.2.3",
|
|
79
79
|
"@types/aws-lambda": "^8.0.0",
|
|
80
80
|
"@types/node": "^22.0.0",
|
|
81
81
|
"aws-xray-sdk": "^3.3.3"
|