vtlab-generic-functions 1.0.8 → 1.0.9
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/package.json +1 -1
- package/s3bucket/index.js +9 -2
package/package.json
CHANGED
package/s3bucket/index.js
CHANGED
|
@@ -108,7 +108,7 @@ const downloadFileFromS3 = async (path) => {
|
|
|
108
108
|
});
|
|
109
109
|
|
|
110
110
|
try {
|
|
111
|
-
let response = await
|
|
111
|
+
let response = await s3Client.send(command);
|
|
112
112
|
let Body = response.Body;
|
|
113
113
|
|
|
114
114
|
if (Body && Body instanceof stream.Readable) {
|
|
@@ -175,7 +175,14 @@ const generatePresignedUrl = async (bucket, key, expirationInSeconds = 604000) =
|
|
|
175
175
|
if(expirationInSeconds > 604000){ //7 days is the max expiration time for a presigned url v4
|
|
176
176
|
expirationInSeconds = 604000;
|
|
177
177
|
}
|
|
178
|
-
const
|
|
178
|
+
const allConfig = await config.get();
|
|
179
|
+
const s3Client = new S3Client({
|
|
180
|
+
credentials: {
|
|
181
|
+
accessKeyId: allConfig.awsCredentials.accessKeyId,
|
|
182
|
+
secretAccessKey: allConfig.awsCredentials.secretAccessKey,
|
|
183
|
+
},
|
|
184
|
+
region: allConfig.awsCredentials.region
|
|
185
|
+
});
|
|
179
186
|
|
|
180
187
|
const command = new GetObjectCommand({
|
|
181
188
|
Bucket: bucket,
|