Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update url and version of libs #5

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const assert = require('assert');
const debug = require('debug')('zenvia');
const request = require('superagent');
const uuid = require('uuid');
const URL_ZENVIA = 'https://api-rest.zenvia.com/services';

class Zenvia {
constructor(options = {}) {
Expand Down Expand Up @@ -59,7 +60,7 @@ class Zenvia {
assert(message.from, 'Missing `message.from`');
assert(message.msg, 'Missing `message.msg`');
assert(message.from.length <= 20, 'message.from needs to be shorter or equal to 20 characters');
assert((message.from.length + 2 + message.msg.length) <= 160, 'message.from and message.msg summed must be greater than or equal to 160 characters.');
assert((message.from.length + 2 + message.msg.length) <= 1500, 'message.from and message.msg summed must be greater than or equal to 1500 characters.');
} catch (err) {
return cb(err);
}
Expand All @@ -70,7 +71,7 @@ class Zenvia {

debug('Sending SMS request', message.id);
request
.post('https://api-rest.zenvia360.com.br/services/send-sms')
.post(`${URL_ZENVIA}/send-sms`)
.auth(
options.user || this.user || process.env.ZENVIA_API_USER,
options.password || this.password || process.env.ZENVIA_API_PASSWORD
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
"author": "Pedro Tacla Yamada",
"license": "AGPLv3",
"dependencies": {
"debug": "^2.2.0",
"superagent": "^2.3.0",
"uuid": "^2.0.3"
"debug": "^4.1.0",
"superagent": "^4.0.0",
"uuid": "^3.3.2"
},
"devDependencies": {
"mocha": "^3.1.2",
"mocha": "^5.2.0",
"mocha-make-stub": "^2.3.2",
"should": "^11.1.1"
"should": "^13.2.3"
}
}