vtlab-generic-functions 1.0.6 → 1.0.7

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vtlab-generic-functions",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "scripts": {
5
5
  "test": "jest"
6
6
  },
package/s3bucket/index.js CHANGED
@@ -152,8 +152,11 @@ const uploadFilesToS3 = async (path, files, extension = 'pdf', options = {
152
152
  * @returns {Promise<string>} - A promise that resolves to the presigned URL.
153
153
  * @throws {Error} - Throws an error if the URL generation fails.
154
154
  */
155
- const generatePresignedUrl = async (bucket, key, expirationInSeconds = 86400 * 30) => {
155
+ const generatePresignedUrl = async (bucket, key, expirationInSeconds = 604000) => {
156
156
  try {
157
+ if(expirationInSeconds > 604000){ //7 days is the max expiration time for a presigned url v4
158
+ expirationInSeconds = 604000;
159
+ }
157
160
  const s3Client = new S3Client();
158
161
 
159
162
  const command = new GetObjectCommand({