cleanup capabilities

This commit is contained in:
AJ ONeal 2017-07-05 21:50:18 +00:00
parent 83f825c2f9
commit e4d671e922
1 changed files with 16 additions and 2 deletions

View File

@ -444,11 +444,25 @@ module.exports.create = function (xconfx, apiFactories, apiDeps) {
return apiDeps.Promise.resolve(_twilio);
}
function mailgunMail(/*opts*/) {
return apiDeps.Promise.resolve(req.getSiteMailer());
}
// Twilio Parameters are often 26 long
var bodyParserTwilio = require('body-parser').urlencoded({ limit: '4kb', parameterLimit: 100, extended: false });
var caps = {
'twilio@daplie.com': twilioTel
, 'com.daplie.tel.twilio': twilioTel // deprecated
//
// Capabilities for APIs
//
'mailer@daplie.com': mailgunMail // whichever mailer
, 'mailgun@daplie.com': mailgunMail // specifically mailgun
, 'tel@daplie.com': twilioTel // whichever telephony service
, 'twilio@daplie.com': twilioTel // specifically twilio
, 'com.daplie.tel.twilio': twilioTel // deprecated alias
//
// Webhook Parsers
//
, 'twilio.urlencoded@daplie.com': function (req, res, next) {
// TODO null for res and Promise instead of next?
return bodyParserTwilio(req, res, function () {