Built motion from commit 14588770.|2.5.38
[motion2.git] / server / services / ami / trigger / urlforward / index.js
index 3280179..3b15c66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x355c=['%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','request-promise','lodash','mustache','exec','data1','toUpperCase','render','data2','data5','number','data6','error','stack','GET','POST','data7','parse','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','isNil',',\x20request\x20body:\x20','body','info'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x355c,0x16d));var _0xc355=function(_0x5b7e20,_0x17cfec){_0x5b7e20=_0x5b7e20-0x0;var _0x57eddf=_0x355c[_0x5b7e20];return _0x57eddf;};'use strict';var rp=require(_0xc355('0x0'));var util=require('util');var _=require(_0xc355('0x1'));var Mustache=require(_0xc355('0x2'));var logger=require('../../../../config/logger')('trigger');exports[_0xc355('0x3')]=function(_0x5f1e43,_0x3c6b04){var _0x3d5223,_0x316995;var _0x301361={'method':_0x5f1e43[_0xc355('0x4')][_0xc355('0x5')](),'uri':Mustache[_0xc355('0x6')](_0x5f1e43[_0xc355('0x7')],_0x3c6b04),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5f1e43[_0xc355('0x8')])===_0xc355('0x9')&&parseInt(_0x5f1e43[_0xc355('0x8')])>=0x1&&parseInt(_0x5f1e43[_0xc355('0x8')])<=0xa?parseInt(_0x5f1e43[_0xc355('0x8')])*0x3e8:0x5*0x3e8};try{_0x301361['headers']=_0x5f1e43[_0xc355('0xa')]?JSON['parse'](Mustache[_0xc355('0x6')](_0x5f1e43[_0xc355('0xa')],_0x3c6b04)):{};}catch(_0x475e80){logger[_0xc355('0xb')](_0x475e80[_0xc355('0xc')]);}switch(_0x5f1e43['data1']['toUpperCase']()){case _0xc355('0xd'):case'DELETE':_0x3d5223=null;_0x301361['qs']=_0x3c6b04;break;case _0xc355('0xe'):case'PUT':if(_0x5f1e43[_0xc355('0xf')]){try{_0x3d5223=JSON[_0xc355('0x10')](Mustache[_0xc355('0x6')](_0x5f1e43[_0xc355('0xf')],_0x3c6b04));_0x301361['body']=_0x3d5223;}catch(_0x643b15){logger[_0xc355('0xb')](_0x643b15[_0xc355('0xc')]);logger['error'](_0xc355('0x11'));}}else{_0x3d5223=_0x3c6b04;_0x301361['body']=_0x3d5223;}break;}logger['info'](util[_0xc355('0x12')](_0xc355('0x13'),_0x5f1e43[_0xc355('0x4')],_0x5f1e43['data2'],JSON[_0xc355('0x14')](_0x301361)));rp(_0x301361)['then'](function(_0xd8509e){_0x3d5223=!_[_0xc355('0x15')](_0x3d5223)?_0xc355('0x16')+_0x3d5223:'';_0x316995=typeof _0xd8509e[_0xc355('0x17')]==='object'?JSON[_0xc355('0x14')](_0xd8509e[_0xc355('0x17')]):_0xd8509e['body'];logger[_0xc355('0x18')](util[_0xc355('0x12')](_0xc355('0x19'),_0x5f1e43[_0xc355('0x4')],_0x5f1e43[_0xc355('0x7')],_0xd8509e[_0xc355('0x1a')],_0x316995));})[_0xc355('0x1b')](function(_0x24b119){logger[_0xc355('0xb')](util[_0xc355('0x12')](_0xc355('0x1c'),_0x5f1e43[_0xc355('0x4')],_0x5f1e43[_0xc355('0x7')],_0x24b119['statusCode'],_0x24b119[_0xc355('0x1d')],_0x24b119['message']));});};
\ No newline at end of file
+var _0x41b8=['request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','render','data2','data5','number','headers','data6','parse','stack','data1','toUpperCase','GET','DELETE','POST','PUT','data7','error','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','isNil',',\x20request\x20body:\x20','body','object','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','name','message'];(function(_0x473b78,_0x568697){var _0x554b34=function(_0x123e99){while(--_0x123e99){_0x473b78['push'](_0x473b78['shift']());}};_0x554b34(++_0x568697);}(_0x41b8,0x94));var _0x841b=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0x41b8[_0x292f93];return _0x5a94b1;};'use strict';var rp=require(_0x841b('0x0'));var util=require(_0x841b('0x1'));var _=require(_0x841b('0x2'));var Mustache=require(_0x841b('0x3'));var logger=require(_0x841b('0x4'))(_0x841b('0x5'));exports[_0x841b('0x6')]=function(_0x489e38,_0x5da420){var _0x173814,_0x16bd50;var _0x232ff7={'method':_0x489e38['data1']['toUpperCase'](),'uri':Mustache[_0x841b('0x7')](_0x489e38[_0x841b('0x8')],_0x5da420),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x489e38[_0x841b('0x9')])===_0x841b('0xa')&&parseInt(_0x489e38[_0x841b('0x9')])>=0x1&&parseInt(_0x489e38[_0x841b('0x9')])<=0xa?parseInt(_0x489e38[_0x841b('0x9')])*0x3e8:0x5*0x3e8};try{_0x232ff7[_0x841b('0xb')]=_0x489e38[_0x841b('0xc')]?JSON[_0x841b('0xd')](Mustache[_0x841b('0x7')](_0x489e38[_0x841b('0xc')],_0x5da420)):{};}catch(_0xe5c857){logger['error'](_0xe5c857[_0x841b('0xe')]);}switch(_0x489e38[_0x841b('0xf')][_0x841b('0x10')]()){case _0x841b('0x11'):case _0x841b('0x12'):_0x173814=null;_0x232ff7['qs']=_0x5da420;break;case _0x841b('0x13'):case _0x841b('0x14'):if(_0x489e38[_0x841b('0x15')]){try{_0x173814=JSON[_0x841b('0xd')](Mustache[_0x841b('0x7')](_0x489e38[_0x841b('0x15')],_0x5da420));_0x232ff7['body']=_0x173814;}catch(_0x171ad8){logger[_0x841b('0x16')](_0x171ad8[_0x841b('0xe')]);logger[_0x841b('0x16')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x173814=_0x5da420;_0x232ff7['body']=_0x173814;}break;}logger[_0x841b('0x17')](util['format'](_0x841b('0x18'),_0x489e38[_0x841b('0xf')],_0x489e38[_0x841b('0x8')],JSON[_0x841b('0x19')](_0x232ff7)));rp(_0x232ff7)['then'](function(_0x5eb966){_0x173814=!_[_0x841b('0x1a')](_0x173814)?_0x841b('0x1b')+_0x173814:'';_0x16bd50=typeof _0x5eb966[_0x841b('0x1c')]===_0x841b('0x1d')?JSON[_0x841b('0x19')](_0x5eb966[_0x841b('0x1c')]):_0x5eb966['body'];logger[_0x841b('0x17')](util[_0x841b('0x1e')](_0x841b('0x1f'),_0x489e38[_0x841b('0xf')],_0x489e38[_0x841b('0x8')],_0x5eb966[_0x841b('0x20')],_0x16bd50));})[_0x841b('0x21')](function(_0x320eff){logger[_0x841b('0x16')](util[_0x841b('0x1e')](_0x841b('0x22'),_0x489e38['data1'],_0x489e38['data2'],_0x320eff['statusCode'],_0x320eff[_0x841b('0x23')],_0x320eff[_0x841b('0x24')]));});};
\ No newline at end of file