jscommunicator
JS client for communicator
Last updated 2 years ago by udit2909 .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install jscommunicator 
SYNC missed versions from official npm registry.

jsCommunicator

Communicator client for javascript

Install

npm install jscommunicator --save

Usage

For web app

const express = require('express')
const jsComm = require('jscommunicator')
const app = express()

const config = {
                  communicator: {
                    communicatorQueueUri: 'beanstalk://localhost/dev-',
                    signingKey: 'xxxx'
                  }
                }

app.use(function (req, res, next) {
  client = new jsComm.CommunicatorClient(req, config, "accounts")
  const obj = client.getInstance('smsGenericPromotional')
  console.log(obj.getDomain())
  next()
})

app.get('/', (req, res) => res.send('Hello World!'))

app.listen(3000, () => console.log('Example app listening on port 3000!'))

For workers


client = new jsComm.CommunicatorClient(null, config, "accounts")
const obj = client.getInstance('smsGenericPromotional')
obj.setDomain("domain value")

host eg. abc-access123.practodev.com

config eg. { communicator: { communicatorQueueUri: 'beanstalk://localhost/dev-', signingKey: 'xxxx' } }

appName eg. accounts

Get instance for the type of mail or sms

obj = client.getInstance('smsGenericPromotional')

Sending sms/email

obj.sendSms(params)
obj.sendMail(params)

Fetching sms/email info [GET request]

obj.getMessagesByReferenceId(2, '["FIT_RAY_SHARE_SMS"]', (err, response)=>{
  if(err){
    console.log(err);
  }
  else{
    console.log(response)}
  })

To contribute in jsCommunicator

Clone the repo

Finally build using npm run build

Update package in npm using npm publish

Notes

  • Make sure to run build before publish because it will publish the local lib folder.
  • Please don't push the lib version in git repository. Only the source code.

Current Tags

  • 1.0.32                                ...           latest (2 years ago)

33 Versions

  • 1.0.32                                ...           2 years ago
  • 1.0.31                                ...           2 years ago
  • 1.0.30                                ...           2 years ago
  • 1.0.29                                ...           3 years ago
  • 1.0.28                                ...           3 years ago
  • 1.0.27                                ...           3 years ago
  • 1.0.26                                ...           3 years ago
  • 1.0.25                                ...           3 years ago
  • 1.0.24                                ...           3 years ago
  • 1.0.23                                ...           3 years ago
  • 1.0.22                                ...           3 years ago
  • 1.0.21                                ...           3 years ago
  • 1.0.20                                ...           3 years ago
  • 1.0.19                                ...           3 years ago
  • 1.0.18                                ...           3 years ago
  • 1.0.17                                ...           3 years ago
  • 1.0.16                                ...           3 years ago
  • 1.0.15                                ...           3 years ago
  • 1.0.14                                ...           3 years ago
  • 1.0.13                                ...           3 years ago
  • 1.0.12                                ...           3 years ago
  • 1.0.11                                ...           3 years ago
  • 1.0.10                                ...           3 years ago
  • 1.0.9                                ...           3 years ago
  • 1.0.8                                ...           3 years ago
  • 1.0.7                                ...           3 years ago
  • 1.0.6                                ...           3 years ago
  • 1.0.5                                ...           3 years ago
  • 1.0.4                                ...           3 years ago
  • 1.0.3                                ...           3 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (8)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |