From e4d671e922a0e7d633ec76c37bd09294d186e20c Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 5 Jul 2017 21:50:18 +0000 Subject: [PATCH] cleanup capabilities --- lib/apis.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/apis.js b/lib/apis.js index bed3111..db76fc6 100644 --- a/lib/apis.js +++ b/lib/apis.js @@ -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 () {