Built motion from commit 6a0adb95.|2.6.31
[motion2.git] / server / services / ami / trigger / urlforward / index.js
index 91ffdcf..639f8bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6621=['name','message','request-promise','util','lodash','mustache','../../../../config/logger','exec','data1','toUpperCase','render','data5','number','headers','data6','stack','GET','POST','parse','data7','body','error','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then',',\x20request\x20body:\x20','info','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s'];(function(_0x3b06ea,_0x3b2a89){var _0x277c50=function(_0x1cbaee){while(--_0x1cbaee){_0x3b06ea['push'](_0x3b06ea['shift']());}};_0x277c50(++_0x3b2a89);}(_0x6621,0x18e));var _0x1662=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6621[_0x17d9e3];return _0x14192d;};'use strict';var rp=require(_0x1662('0x0'));var util=require(_0x1662('0x1'));var _=require(_0x1662('0x2'));var Mustache=require(_0x1662('0x3'));var logger=require(_0x1662('0x4'))('trigger');exports[_0x1662('0x5')]=function(_0x54598d,_0x306539){var _0x5b5c38,_0xf90db5;var _0x135675={'method':_0x54598d[_0x1662('0x6')][_0x1662('0x7')](),'uri':Mustache[_0x1662('0x8')](_0x54598d['data2'],_0x306539),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x54598d[_0x1662('0x9')])===_0x1662('0xa')&&parseInt(_0x54598d['data5'])>=0x1&&parseInt(_0x54598d[_0x1662('0x9')])<=0xa?parseInt(_0x54598d[_0x1662('0x9')])*0x3e8:0x5*0x3e8};try{_0x135675[_0x1662('0xb')]=_0x54598d[_0x1662('0xc')]?JSON['parse'](Mustache[_0x1662('0x8')](_0x54598d[_0x1662('0xc')],_0x306539)):{};}catch(_0x52d277){logger['error'](_0x52d277[_0x1662('0xd')]);}switch(_0x54598d[_0x1662('0x6')][_0x1662('0x7')]()){case _0x1662('0xe'):case'DELETE':_0x5b5c38=null;_0x135675['qs']=_0x306539;break;case _0x1662('0xf'):case'PUT':if(_0x54598d['data7']){try{_0x5b5c38=JSON[_0x1662('0x10')](Mustache[_0x1662('0x8')](_0x54598d[_0x1662('0x11')],_0x306539));_0x135675[_0x1662('0x12')]=_0x5b5c38;}catch(_0x36d5a7){logger[_0x1662('0x13')](_0x36d5a7[_0x1662('0xd')]);logger[_0x1662('0x13')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x5b5c38=_0x306539;_0x135675[_0x1662('0x12')]=_0x5b5c38;}break;}logger['info'](util['format'](_0x1662('0x14'),_0x54598d[_0x1662('0x6')],_0x54598d[_0x1662('0x15')],JSON[_0x1662('0x16')](_0x135675)));rp(_0x135675)[_0x1662('0x17')](function(_0xf76788){_0x5b5c38=!_['isNil'](_0x5b5c38)?_0x1662('0x18')+_0x5b5c38:'';_0xf90db5=typeof _0xf76788[_0x1662('0x12')]==='object'?JSON[_0x1662('0x16')](_0xf76788[_0x1662('0x12')]):_0xf76788[_0x1662('0x12')];logger[_0x1662('0x19')](util[_0x1662('0x1a')](_0x1662('0x1b'),_0x54598d[_0x1662('0x6')],_0x54598d['data2'],_0xf76788[_0x1662('0x1c')],_0xf90db5));})[_0x1662('0x1d')](function(_0x5db810){logger[_0x1662('0x13')](util[_0x1662('0x1a')](_0x1662('0x1e'),_0x54598d[_0x1662('0x6')],_0x54598d[_0x1662('0x15')],_0x5db810[_0x1662('0x1c')],_0x5db810[_0x1662('0x1f')],_0x5db810[_0x1662('0x20')]));});};
\ No newline at end of file
+var _0x7d2e=['object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','util','lodash','mustache','../../../../config/logger','trigger','toUpperCase','render','data2','data5','number','headers','data6','parse','error','stack','data1','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','then','isNil',',\x20request\x20body:\x20'];(function(_0x37a9d7,_0x2b6fde){var _0x1343d3=function(_0x3bde45){while(--_0x3bde45){_0x37a9d7['push'](_0x37a9d7['shift']());}};_0x1343d3(++_0x2b6fde);}(_0x7d2e,0x8f));var _0xe7d2=function(_0x5b7606,_0x3367ef){_0x5b7606=_0x5b7606-0x0;var _0x186584=_0x7d2e[_0x5b7606];return _0x186584;};'use strict';var rp=require('request-promise');var util=require(_0xe7d2('0x0'));var _=require(_0xe7d2('0x1'));var Mustache=require(_0xe7d2('0x2'));var logger=require(_0xe7d2('0x3'))(_0xe7d2('0x4'));exports['exec']=function(_0x2aa0ad,_0x144b9c){var _0x7bf92a,_0x2db730;var _0x9b311a={'method':_0x2aa0ad['data1'][_0xe7d2('0x5')](),'uri':Mustache[_0xe7d2('0x6')](_0x2aa0ad[_0xe7d2('0x7')],_0x144b9c),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2aa0ad[_0xe7d2('0x8')])===_0xe7d2('0x9')&&parseInt(_0x2aa0ad['data5'])>=0x1&&parseInt(_0x2aa0ad[_0xe7d2('0x8')])<=0xa?parseInt(_0x2aa0ad[_0xe7d2('0x8')])*0x3e8:0x5*0x3e8};try{_0x9b311a[_0xe7d2('0xa')]=_0x2aa0ad[_0xe7d2('0xb')]?JSON[_0xe7d2('0xc')](Mustache[_0xe7d2('0x6')](_0x2aa0ad[_0xe7d2('0xb')],_0x144b9c)):{};}catch(_0x456b29){logger[_0xe7d2('0xd')](_0x456b29[_0xe7d2('0xe')]);}switch(_0x2aa0ad[_0xe7d2('0xf')]['toUpperCase']()){case'GET':case _0xe7d2('0x10'):_0x7bf92a=null;_0x9b311a['qs']=_0x144b9c;break;case _0xe7d2('0x11'):case _0xe7d2('0x12'):if(_0x2aa0ad['data7']){try{_0x7bf92a=JSON[_0xe7d2('0xc')](Mustache['render'](_0x2aa0ad[_0xe7d2('0x13')],_0x144b9c));_0x9b311a[_0xe7d2('0x14')]=_0x7bf92a;}catch(_0x448ddf){logger[_0xe7d2('0xd')](_0x448ddf[_0xe7d2('0xe')]);logger['error'](_0xe7d2('0x15'));}}else{_0x7bf92a=_0x144b9c;_0x9b311a[_0xe7d2('0x14')]=_0x7bf92a;}break;}logger[_0xe7d2('0x16')](util[_0xe7d2('0x17')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x2aa0ad[_0xe7d2('0xf')],_0x2aa0ad[_0xe7d2('0x7')],JSON['stringify'](_0x9b311a)));rp(_0x9b311a)[_0xe7d2('0x18')](function(_0x16463d){_0x7bf92a=!_[_0xe7d2('0x19')](_0x7bf92a)?_0xe7d2('0x1a')+_0x7bf92a:'';_0x2db730=typeof _0x16463d[_0xe7d2('0x14')]===_0xe7d2('0x1b')?JSON['stringify'](_0x16463d[_0xe7d2('0x14')]):_0x16463d[_0xe7d2('0x14')];logger['info'](util[_0xe7d2('0x17')](_0xe7d2('0x1c'),_0x2aa0ad['data1'],_0x2aa0ad[_0xe7d2('0x7')],_0x16463d[_0xe7d2('0x1d')],_0x2db730));})[_0xe7d2('0x1e')](function(_0xe1d2c4){logger['error'](util[_0xe7d2('0x17')](_0xe7d2('0x1f'),_0x2aa0ad[_0xe7d2('0xf')],_0x2aa0ad[_0xe7d2('0x7')],_0xe1d2c4[_0xe7d2('0x1d')],_0xe1d2c4[_0xe7d2('0x20')],_0xe1d2c4[_0xe7d2('0x21')]));});};
\ No newline at end of file