Built motion from commit 838c2833.|2.6.24
[motion2.git] / server / services / ami / trigger / urlforward / index.js
index 2b8b6bf..94a071d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75f2=[',\x20request\x20body:\x20','stringify','%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','message','request-promise','util','lodash','mustache','trigger','exec','data1','data2','data5','headers','data6','parse','render','error','stack','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','then','isNil'];(function(_0x901852,_0x1d74f6){var _0x18da1d=function(_0x343c3d){while(--_0x343c3d){_0x901852['push'](_0x901852['shift']());}};_0x18da1d(++_0x1d74f6);}(_0x75f2,0x1b9));var _0x275f=function(_0x26be12,_0x338b2c){_0x26be12=_0x26be12-0x0;var _0x110b3c=_0x75f2[_0x26be12];return _0x110b3c;};'use strict';var rp=require(_0x275f('0x0'));var util=require(_0x275f('0x1'));var _=require(_0x275f('0x2'));var Mustache=require(_0x275f('0x3'));var logger=require('../../../../config/logger')(_0x275f('0x4'));exports[_0x275f('0x5')]=function(_0x1d07ef,_0x27ae85){var _0x48486e,_0x452a55;var _0x5156d7={'method':_0x1d07ef[_0x275f('0x6')]['toUpperCase'](),'uri':Mustache['render'](_0x1d07ef[_0x275f('0x7')],_0x27ae85),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1d07ef[_0x275f('0x8')])==='number'&&parseInt(_0x1d07ef[_0x275f('0x8')])>=0x1&&parseInt(_0x1d07ef[_0x275f('0x8')])<=0xa?parseInt(_0x1d07ef[_0x275f('0x8')])*0x3e8:0x5*0x3e8};try{_0x5156d7[_0x275f('0x9')]=_0x1d07ef[_0x275f('0xa')]?JSON[_0x275f('0xb')](Mustache[_0x275f('0xc')](_0x1d07ef[_0x275f('0xa')],_0x27ae85)):{};}catch(_0x8765d2){logger[_0x275f('0xd')](_0x8765d2[_0x275f('0xe')]);}switch(_0x1d07ef[_0x275f('0x6')]['toUpperCase']()){case'GET':case'DELETE':_0x48486e=null;_0x5156d7['qs']=_0x27ae85;break;case _0x275f('0xf'):case _0x275f('0x10'):if(_0x1d07ef['data7']){try{_0x48486e=JSON[_0x275f('0xb')](Mustache[_0x275f('0xc')](_0x1d07ef[_0x275f('0x11')],_0x27ae85));_0x5156d7[_0x275f('0x12')]=_0x48486e;}catch(_0x1ccd1a){logger[_0x275f('0xd')](_0x1ccd1a[_0x275f('0xe')]);logger[_0x275f('0xd')](_0x275f('0x13'));}}else{_0x48486e=_0x27ae85;_0x5156d7[_0x275f('0x12')]=_0x48486e;}break;}logger[_0x275f('0x14')](util[_0x275f('0x15')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x1d07ef[_0x275f('0x6')],_0x1d07ef['data2'],JSON['stringify'](_0x5156d7)));rp(_0x5156d7)[_0x275f('0x16')](function(_0x2b4609){_0x48486e=!_[_0x275f('0x17')](_0x48486e)?_0x275f('0x18')+_0x48486e:'';_0x452a55=typeof _0x2b4609[_0x275f('0x12')]==='object'?JSON[_0x275f('0x19')](_0x2b4609[_0x275f('0x12')]):_0x2b4609[_0x275f('0x12')];logger[_0x275f('0x14')](util[_0x275f('0x15')](_0x275f('0x1a'),_0x1d07ef[_0x275f('0x6')],_0x1d07ef[_0x275f('0x7')],_0x2b4609[_0x275f('0x1b')],_0x452a55));})[_0x275f('0x1c')](function(_0x180a23){logger[_0x275f('0xd')](util['format'](_0x275f('0x1d'),_0x1d07ef[_0x275f('0x6')],_0x1d07ef['data2'],_0x180a23[_0x275f('0x1b')],_0x180a23['name'],_0x180a23[_0x275f('0x1e')]));});};
\ No newline at end of file
+var _0x0b7f=['headers','data6','error','stack','GET','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then',',\x20request\x20body:\x20','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','format','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','data5','number'];(function(_0x1b70f7,_0xd1d2c8){var _0x18f09f=function(_0x2c4eac){while(--_0x2c4eac){_0x1b70f7['push'](_0x1b70f7['shift']());}};_0x18f09f(++_0xd1d2c8);}(_0x0b7f,0xe1));var _0xf0b7=function(_0x307bf7,_0x315dce){_0x307bf7=_0x307bf7-0x0;var _0x578e59=_0x0b7f[_0x307bf7];return _0x578e59;};'use strict';var rp=require(_0xf0b7('0x0'));var util=require(_0xf0b7('0x1'));var _=require(_0xf0b7('0x2'));var Mustache=require(_0xf0b7('0x3'));var logger=require(_0xf0b7('0x4'))(_0xf0b7('0x5'));exports[_0xf0b7('0x6')]=function(_0x1a402c,_0x3bf05c){var _0x5decf6,_0x22d116;var _0x2414fa={'method':_0x1a402c[_0xf0b7('0x7')][_0xf0b7('0x8')](),'uri':Mustache[_0xf0b7('0x9')](_0x1a402c[_0xf0b7('0xa')],_0x3bf05c),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1a402c[_0xf0b7('0xb')])===_0xf0b7('0xc')&&parseInt(_0x1a402c[_0xf0b7('0xb')])>=0x1&&parseInt(_0x1a402c[_0xf0b7('0xb')])<=0xa?parseInt(_0x1a402c['data5'])*0x3e8:0x5*0x3e8};try{_0x2414fa[_0xf0b7('0xd')]=_0x1a402c[_0xf0b7('0xe')]?JSON['parse'](Mustache[_0xf0b7('0x9')](_0x1a402c['data6'],_0x3bf05c)):{};}catch(_0x2fe285){logger[_0xf0b7('0xf')](_0x2fe285[_0xf0b7('0x10')]);}switch(_0x1a402c['data1']['toUpperCase']()){case _0xf0b7('0x11'):case'DELETE':_0x5decf6=null;_0x2414fa['qs']=_0x3bf05c;break;case _0xf0b7('0x12'):case _0xf0b7('0x13'):if(_0x1a402c[_0xf0b7('0x14')]){try{_0x5decf6=JSON['parse'](Mustache[_0xf0b7('0x9')](_0x1a402c['data7'],_0x3bf05c));_0x2414fa[_0xf0b7('0x15')]=_0x5decf6;}catch(_0x57d1ac){logger[_0xf0b7('0xf')](_0x57d1ac[_0xf0b7('0x10')]);logger['error'](_0xf0b7('0x16'));}}else{_0x5decf6=_0x3bf05c;_0x2414fa['body']=_0x5decf6;}break;}logger[_0xf0b7('0x17')](util['format'](_0xf0b7('0x18'),_0x1a402c[_0xf0b7('0x7')],_0x1a402c[_0xf0b7('0xa')],JSON[_0xf0b7('0x19')](_0x2414fa)));rp(_0x2414fa)[_0xf0b7('0x1a')](function(_0x395d07){_0x5decf6=!_['isNil'](_0x5decf6)?_0xf0b7('0x1b')+_0x5decf6:'';_0x22d116=typeof _0x395d07[_0xf0b7('0x15')]==='object'?JSON[_0xf0b7('0x19')](_0x395d07[_0xf0b7('0x15')]):_0x395d07[_0xf0b7('0x15')];logger['info'](util['format'](_0xf0b7('0x1c'),_0x1a402c[_0xf0b7('0x7')],_0x1a402c[_0xf0b7('0xa')],_0x395d07[_0xf0b7('0x1d')],_0x22d116));})[_0xf0b7('0x1e')](function(_0x40658b){logger['error'](util[_0xf0b7('0x1f')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x1a402c[_0xf0b7('0x7')],_0x1a402c[_0xf0b7('0xa')],_0x40658b[_0xf0b7('0x1d')],_0x40658b[_0xf0b7('0x20')],_0x40658b[_0xf0b7('0x21')]));});};
\ No newline at end of file