@ikonintegration/ikapi 3.0.0-alpha4 → 3.0.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikonintegration/ikapi",
|
|
3
|
-
"version": "3.0.0
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "main.js",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"@aws-sdk/client-dynamodb": "^3.72.0",
|
|
15
15
|
"@aws-sdk/client-ses": "^3.72.0",
|
|
16
16
|
"@aws-sdk/client-sns": "^3.72.0",
|
|
17
|
+
"@aws-sdk/credential-provider-node": "^3.72.0",
|
|
17
18
|
"@aws-sdk/node-http-handler": "^3.58.0",
|
|
18
19
|
"@aws-sdk/util-dynamodb": "^3.72.0",
|
|
19
20
|
"abind": "^1.0.5",
|
package/src/Mailer/IKMailer.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
const nodemailer = require("nodemailer");
|
|
2
2
|
const Email = require('email-templates');
|
|
3
3
|
//
|
|
4
|
-
import {
|
|
4
|
+
import { defaultProvider } from '@aws-sdk/credential-provider-node';
|
|
5
|
+
import AWSSES, { SESClient } from "@aws-sdk/client-ses";
|
|
5
6
|
import Utils from "./../API/IKUtils";
|
|
6
7
|
//
|
|
7
8
|
export default class IKMailer {
|
|
@@ -13,7 +14,10 @@ export default class IKMailer {
|
|
|
13
14
|
if (Utils.isOffline()) configObj = {region: region, accessKeyId: process.env.AWS_ACCESS_KEY_ID, secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY};
|
|
14
15
|
//
|
|
15
16
|
this.transporter = nodemailer.createTransport({
|
|
16
|
-
SES:
|
|
17
|
+
SES: {
|
|
18
|
+
ses: new SESClient({ apiVersion: "2010-12-01", ...configObj, defaultProvider }),
|
|
19
|
+
aws: AWSSES
|
|
20
|
+
}
|
|
17
21
|
});
|
|
18
22
|
}
|
|
19
23
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SNSClient } from "@aws-sdk/client-sns";
|
|
1
|
+
import { SNSClient, PublishCommand } from "@aws-sdk/client-sns";
|
|
2
2
|
import sha1 from 'sha1';
|
|
3
3
|
//
|
|
4
4
|
import Utils from "./../API/IKUtils";
|
|
@@ -24,7 +24,7 @@ export default class IKPublisher {
|
|
|
24
24
|
TopicArn: topic,
|
|
25
25
|
...(additionalProps ? additionalProps : {}),
|
|
26
26
|
};
|
|
27
|
-
resp = await PUBLISHER_CONN.
|
|
27
|
+
resp = await PUBLISHER_CONN.send(new PublishCommand(params));
|
|
28
28
|
} catch (e) {
|
|
29
29
|
console.error(`Error while publishing into topic ${topic} with error: ${e}`);
|
|
30
30
|
}
|
|
@@ -37,7 +37,7 @@ export default class IKPublisher {
|
|
|
37
37
|
//Configure when sending!
|
|
38
38
|
let configObj = { region: this.region };
|
|
39
39
|
if (Utils.isOffline()) configObj = { ...configObj, accessKeyId: process.env.AWS_ACCESS_KEY_ID, secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY };
|
|
40
|
-
PUBLISHER_CONN = (new SNSClient({ apiVersion: '2010-03-31', ...
|
|
40
|
+
PUBLISHER_CONN = (new SNSClient({ apiVersion: '2010-03-31', ...configObj }));
|
|
41
41
|
PUBLISHER_CONN_HASH = sha1(this.region);
|
|
42
42
|
}
|
|
43
43
|
}
|