Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
loopback-connector-enviossms
Advanced tools
Loopback connector for consume rest api of http://www.enviossms.com
This connector is for consume the REST API of enviossms.com
For more information of the enviossms REST API please read their documentation here.
$ npm install loopback-connector-enviossms --save
datasource.json
, in the "connector":
property especify the loopback-connector-enviossms. The properties "username":
and "password":
are required to connect with the api rest and consume it....
"enviossms": {
"name": "enviossms",
"connector": "loopback-connector-enviossms",
"username": "yourUsername",
"password": "yourPassword",
}
...
model-config.json
...
"sms": {
"dataSource": "enviossms",
"public": true
},
...
sms
like this// sms.js
'use strict';
const chalk = require('chalk'); // chalk is optional
module.exports = function(sms) {
const options = {
to: '+5493511122334',
text: 'My sms text',
}
sms.sendSimpleSms(options)
.then((res) => {
// res options is an array with 2 index,
// which has a parsed response body in index 0
// and a raw response in index 1
console.log(chalk.green(JSON.stringify(res[0])));
next();
})
.catch((err) => {
console.log(chalk.red(err));
next(new Error(err));
});
}
or in other models
// notifications.js
'use strict';
const chalk = require('chalk');
module.exports = function(Notifications) {
Notifications.observe('before save', function(ctx, next) {
Notifications.app.models.sms.sendSimpleSms(options)
.then((res) => {
// res options is an array with 2 index,
// which has a parsed response body in index 0
// and a raw response in index 1
console.log(chalk.green(JSON.stringify(res[0])));
})
.catch((err) => {
console.log(chalk.red(err));
});
});
};
Name | Params | return | Description |
---|---|---|---|
sendSimpleSms | options : object with to and text properties | This method return a Promise , when resolve it returns an array with parsed body response in first place and the raw response in the second place; if it is reject returns an error object. | This option consumes the /sms/1/text/single endpoint of api.envios.sms using the POST http verb. |
Other methods are in development rigth now.
To contribute in this project please read the contributing guide in our github respository (at the moment in development).
The next steps plained are:
https://github.com/fukuroo-io/loopback-connector-enviossms
FAQs
Loopback connector for consume rest api of http://www.enviossms.com
The npm package loopback-connector-enviossms receives a total of 0 weekly downloads. As such, loopback-connector-enviossms popularity was classified as not popular.
We found that loopback-connector-enviossms demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.