external-communications-manager
Advanced tools
Comparing version 1.0.6 to 1.0.7
{ | ||
"name": "external-communications-manager", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "A single solution for all your outgoing communications like: API calls[axios], Mailer(sms:2factor,email:AWS), MessageQueue[Kafka], Storage[AWS-S3,Cache(Redis),HDD(Local),SFTP] as a plugin interface. Just set some env properties, and start solving your problems.", | ||
@@ -44,2 +44,2 @@ "main": "index.js", | ||
"license": "ISC" | ||
} | ||
} |
@@ -34,3 +34,3 @@ # External Communications Manager | ||
```shell | ||
# how many times should the api call be tried before declaring failed | ||
# how many times should the api call be tried before declaring failed and returning error response | ||
API_FAIL_DEFAULT_RETRY_COUNT = 3 | ||
@@ -49,2 +49,3 @@ # should a message be published to topic in case api fails 1/0 where 0 is false and non-0+ is true | ||
# returns promise, thus must be awaited | ||
# https | ||
(await ResourceAPI.https.get(someURL, headers, data)).data; | ||
@@ -55,2 +56,14 @@ (await ResourceAPI.https.patch(someURL, headers, data)).data; | ||
(await ResourceAPI.https.delete(someURL, headers, data)).data; | ||
#http | ||
const getResp = (await ResourceAPI.http.get(someURL, headers, data)).data; | ||
const patchRespRaw = await ResourceAPI.http.patch(someURL, headers, data); | ||
const patchRes = patchRespRaw.data; | ||
(await ResourceAPI.http.put(someURL, headers, data)).data; | ||
(await ResourceAPI.http.post(someURL, headers, data)).data; | ||
(await ResourceAPI.http.delete(someURL, headers, data)).data; | ||
# since http-responses-2 has a response structure like { data, metadata, status, message, ... } | ||
# to actually access the data key from the response, you may have to use it like | ||
const responseData = (await ResourceAPI.https.get(someURL, headers, data)).data?.data; | ||
# where first .data is to obtain data from axios's response, and seconds .data is to get data key from response | ||
const responseMetadata = (await ResourceAPI.https.get(someURL, headers, data)).data?.metadata; | ||
``` | ||
@@ -91,2 +104,9 @@ | ||
}, false); | ||
# please note: some css properties may be blocked by email clients like background etc, you should still be able to include images via <img> tag from public/cdn sources | ||
Mailer.email.send({ | ||
emails : void 0, | ||
email : 'hello@world.com', | ||
subject: 'Some Subject', | ||
body : '<!DOCTYPE html><html><head><title>Page Title</title></head><body><h1>This is a Heading</h1><p>This is a paragraph.</p></body></html>', | ||
}, true); | ||
@@ -112,4 +132,4 @@ # SMS - returns promise | ||
KAFKA_CLIENT_ID = myapp | ||
# in comma separated, spaces will be trimmed, empty entries will be filtered out | ||
KAFKA_BROKER = <ip>:<port> | ||
# can be comma separated, spaces will be trimmed, empty entries will be filtered out | ||
KAFKA_BROKER = <ip1>:<port1>,<ip2,port2>,...so on | ||
KAFKA_MECHANISM = plain | ||
@@ -116,0 +136,0 @@ KAFKA_GROUP_ID = mygroup |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 5 instances in 1 package
245
1
27949
17