Skip to content

Commit

Permalink
Update aws and multer (#474)
Browse files Browse the repository at this point in the history
* Update axios
- Updated axios version
- Pinned auto-added buffer package required by parcel

# Conflicts:
#	browser-extension/plugin/package-lock.json
#	browser-extension/plugin/package.json

* - Recreated package lock file

# Conflicts:
#	browser-extension/plugin/package-lock.json

* Update aws-sdk and multer-s3
- Updated AWS SDK for JS packages
- Updated multer-s3 package
- Migrated AWS code to use current package version

* Update AWS SDK modules
- Updated aws-sdk client-s3
- Updated aws-sdk client-sesv2
  • Loading branch information
duggalsu authored Nov 21, 2023
1 parent ddc568d commit db1ec1e
Show file tree
Hide file tree
Showing 5 changed files with 2,219 additions and 263 deletions.
31 changes: 16 additions & 15 deletions browser-extension/api-server/email.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
const AWS = require("aws-sdk");

AWS.config.update({
region: "ap-south-1",
credentials: {
accessKeyId: process.env.SERVICE_AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.SERVICE_AWS_SECRET_ACCESS_KEY,
},
});

try {
} catch (error) {
console.log("Could not connect to AWS SES");
}
const {
SES
} = require("@aws-sdk/client-sesv2");

const constructParamsObject = ({ subject, body, receiver }) => {
const params = {
Expand All @@ -38,7 +27,19 @@ const constructParamsObject = ({ subject, body, receiver }) => {
};

const sendEmail = async ({ subject, body, receiver }) => {
const sendPromise = new AWS.SES({ apiVersion: "2010-12-01" })
const sendPromise = new SES({
// The transformation for apiVersion is not implemented.
// Refer to UPGRADING.md on aws-sdk-js-v3 for changes needed.
// Please create/upvote feature request on aws-sdk-js-codemod for apiVersion.
apiVersion: "2010-12-01",

region: "ap-south-1",

credentials: {
accessKeyId: process.env.SERVICE_AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.SERVICE_AWS_SECRET_ACCESS_KEY,
}
})
.sendEmail(constructParamsObject({ subject, body, receiver }))
.promise();
try {
Expand Down
Loading

0 comments on commit db1ec1e

Please sign in to comment.