Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

external-communications-manager

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

external-communications-manager - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

4

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc