@middy/s3-object-response 3.2.0 → 3.3.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.cjs +12 -10
- package/package.json +4 -4
package/index.cjs
CHANGED
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
module
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
Object.defineProperty(module, "exports", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>_default
|
|
8
|
+
});
|
|
9
|
+
const _https = _interopRequireDefault(require("https"));
|
|
10
|
+
const _url = require("url");
|
|
11
|
+
const _util = require("@middy/util");
|
|
12
|
+
const _s3Js = _interopRequireDefault(require("aws-sdk/clients/s3.js"));
|
|
10
13
|
function _interopRequireDefault(obj) {
|
|
11
14
|
return obj && obj.__esModule ? obj : {
|
|
12
15
|
default: obj
|
|
@@ -39,8 +42,8 @@ const s3ObjectResponseMiddleware = (opts = {})=>{
|
|
|
39
42
|
https = options.httpsCapture(options.__https);
|
|
40
43
|
}
|
|
41
44
|
let client;
|
|
42
|
-
if ((0, _util
|
|
43
|
-
client = (0, _util
|
|
45
|
+
if ((0, _util.canPrefetch)(options)) {
|
|
46
|
+
client = (0, _util.createPrefetchClient)(options);
|
|
44
47
|
}
|
|
45
48
|
const s3ObjectResponseMiddlewareBefore = async (request)=>{
|
|
46
49
|
const { inputS3Url , outputRoute , outputToken } = request.event.getObjectContext;
|
|
@@ -58,7 +61,7 @@ const s3ObjectResponseMiddleware = (opts = {})=>{
|
|
|
58
61
|
};
|
|
59
62
|
const s3ObjectResponseMiddlewareAfter = async (request)=>{
|
|
60
63
|
if (!client) {
|
|
61
|
-
client = await (0, _util
|
|
64
|
+
client = await (0, _util.createClient)(options, request);
|
|
62
65
|
}
|
|
63
66
|
(_response = request.response).Body ?? (_response.Body = request.response.body);
|
|
64
67
|
delete request.response.body;
|
|
@@ -96,8 +99,7 @@ const fetchPromise = (fetchOptions)=>{
|
|
|
96
99
|
stream.on('error', (error)=>reject(error));
|
|
97
100
|
});
|
|
98
101
|
};
|
|
99
|
-
|
|
100
|
-
module.exports = _default;
|
|
102
|
+
const _default = s3ObjectResponseMiddleware;
|
|
101
103
|
|
|
102
104
|
|
|
103
105
|
//# sourceMappingURL=index.cjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@middy/s3-object-response",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "S3 object response handling middleware for the middy framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -62,13 +62,13 @@
|
|
|
62
62
|
},
|
|
63
63
|
"homepage": "https://middy.js.org",
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@middy/util": "3.
|
|
65
|
+
"@middy/util": "3.3.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@middy/core": "3.
|
|
68
|
+
"@middy/core": "3.3.0",
|
|
69
69
|
"@types/aws-lambda": "^8.10.101",
|
|
70
70
|
"aws-sdk": "^2.939.0",
|
|
71
71
|
"aws-xray-sdk": "^3.3.3"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "33d459b619c2aaf55ac8640bc56e439178a62e8a"
|
|
74
74
|
}
|