cleanup capabilities
This commit is contained in:
		
							parent
							
								
									83f825c2f9
								
							
						
					
					
						commit
						e4d671e922
					
				
							
								
								
									
										18
									
								
								lib/apis.js
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								lib/apis.js
									
									
									
									
									
								
							@ -444,11 +444,25 @@ module.exports.create = function (xconfx, apiFactories, apiDeps) {
 | 
				
			|||||||
              return apiDeps.Promise.resolve(_twilio);
 | 
					              return apiDeps.Promise.resolve(_twilio);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            function mailgunMail(/*opts*/) {
 | 
				
			||||||
 | 
					              return apiDeps.Promise.resolve(req.getSiteMailer());
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // Twilio Parameters are often 26 long
 | 
					            // Twilio Parameters are often 26 long
 | 
				
			||||||
            var bodyParserTwilio = require('body-parser').urlencoded({ limit: '4kb', parameterLimit: 100, extended: false });
 | 
					            var bodyParserTwilio = require('body-parser').urlencoded({ limit: '4kb', parameterLimit: 100, extended: false });
 | 
				
			||||||
            var caps = {
 | 
					            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) {
 | 
					            , 'twilio.urlencoded@daplie.com': function (req, res, next) {
 | 
				
			||||||
                // TODO null for res and Promise instead of next?
 | 
					                // TODO null for res and Promise instead of next?
 | 
				
			||||||
                return bodyParserTwilio(req, res, function () {
 | 
					                return bodyParserTwilio(req, res, function () {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user