Built motion from commit b7e79837.|2.6.29
[motion2.git] / server / services / ami / trigger / urlforward / index.js
index ca7eddd..134d706 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf88c=['body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then',',\x20request\x20body:\x20','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','request-promise','util','lodash','mustache','../../../../config/logger','data1','toUpperCase','render','data2','number','data5','headers','data6','parse','error','stack','POST','PUT','data7','body'];(function(_0x5771ae,_0x516f25){var _0x5c0c28=function(_0x660d9d){while(--_0x660d9d){_0x5771ae['push'](_0x5771ae['shift']());}};_0x5c0c28(++_0x516f25);}(_0xf88c,0x184));var _0xcf88=function(_0x1de89d,_0x1cf706){_0x1de89d=_0x1de89d-0x0;var _0x21df4e=_0xf88c[_0x1de89d];return _0x21df4e;};'use strict';var rp=require(_0xcf88('0x0'));var util=require(_0xcf88('0x1'));var _=require(_0xcf88('0x2'));var Mustache=require(_0xcf88('0x3'));var logger=require(_0xcf88('0x4'))('trigger');exports['exec']=function(_0x4653a5,_0x45b2eb){var _0x43665b,_0x3ad131;var _0x70b4fa={'method':_0x4653a5[_0xcf88('0x5')][_0xcf88('0x6')](),'uri':Mustache[_0xcf88('0x7')](_0x4653a5[_0xcf88('0x8')],_0x45b2eb),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4653a5['data5'])===_0xcf88('0x9')&&parseInt(_0x4653a5[_0xcf88('0xa')])>=0x1&&parseInt(_0x4653a5['data5'])<=0xa?parseInt(_0x4653a5[_0xcf88('0xa')])*0x3e8:0x5*0x3e8};try{_0x70b4fa[_0xcf88('0xb')]=_0x4653a5[_0xcf88('0xc')]?JSON[_0xcf88('0xd')](Mustache['render'](_0x4653a5[_0xcf88('0xc')],_0x45b2eb)):{};}catch(_0x18e3d6){logger[_0xcf88('0xe')](_0x18e3d6[_0xcf88('0xf')]);}switch(_0x4653a5['data1'][_0xcf88('0x6')]()){case'GET':case'DELETE':_0x43665b=null;_0x70b4fa['qs']=_0x45b2eb;break;case _0xcf88('0x10'):case _0xcf88('0x11'):if(_0x4653a5[_0xcf88('0x12')]){try{_0x43665b=JSON[_0xcf88('0xd')](Mustache[_0xcf88('0x7')](_0x4653a5['data7'],_0x45b2eb));_0x70b4fa[_0xcf88('0x13')]=_0x43665b;}catch(_0x287243){logger[_0xcf88('0xe')](_0x287243[_0xcf88('0xf')]);logger[_0xcf88('0xe')](_0xcf88('0x14'));}}else{_0x43665b=_0x45b2eb;_0x70b4fa[_0xcf88('0x13')]=_0x43665b;}break;}logger[_0xcf88('0x15')](util[_0xcf88('0x16')](_0xcf88('0x17'),_0x4653a5[_0xcf88('0x5')],_0x4653a5[_0xcf88('0x8')],JSON[_0xcf88('0x18')](_0x70b4fa)));rp(_0x70b4fa)[_0xcf88('0x19')](function(_0xd11cc0){_0x43665b=!_['isNil'](_0x43665b)?_0xcf88('0x1a')+_0x43665b:'';_0x3ad131=typeof _0xd11cc0['body']===_0xcf88('0x1b')?JSON[_0xcf88('0x18')](_0xd11cc0[_0xcf88('0x13')]):_0xd11cc0['body'];logger['info'](util['format'](_0xcf88('0x1c'),_0x4653a5[_0xcf88('0x5')],_0x4653a5[_0xcf88('0x8')],_0xd11cc0[_0xcf88('0x1d')],_0x3ad131));})[_0xcf88('0x1e')](function(_0x38c776){logger['error'](util[_0xcf88('0x16')](_0xcf88('0x1f'),_0x4653a5['data1'],_0x4653a5[_0xcf88('0x8')],_0x38c776[_0xcf88('0x1d')],_0x38c776[_0xcf88('0x20')],_0x38c776[_0xcf88('0x21')]));});};
\ No newline at end of file
+var _0xc25b=['trigger','exec','data1','toUpperCase','render','data2','data5','number','headers','data6','parse','stack','GET','POST','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','%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','util','lodash','mustache'];(function(_0xfda486,_0x518041){var _0x20a9d5=function(_0x251386){while(--_0x251386){_0xfda486['push'](_0xfda486['shift']());}};_0x20a9d5(++_0x518041);}(_0xc25b,0x189));var _0xbc25=function(_0x30f57d,_0x2e6777){_0x30f57d=_0x30f57d-0x0;var _0x6f17a4=_0xc25b[_0x30f57d];return _0x6f17a4;};'use strict';var rp=require('request-promise');var util=require(_0xbc25('0x0'));var _=require(_0xbc25('0x1'));var Mustache=require(_0xbc25('0x2'));var logger=require('../../../../config/logger')(_0xbc25('0x3'));exports[_0xbc25('0x4')]=function(_0x46651c,_0x36930c){var _0x2b50f1,_0x447c0b;var _0x5eeb2c={'method':_0x46651c[_0xbc25('0x5')][_0xbc25('0x6')](),'uri':Mustache[_0xbc25('0x7')](_0x46651c[_0xbc25('0x8')],_0x36930c),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x46651c[_0xbc25('0x9')])===_0xbc25('0xa')&&parseInt(_0x46651c[_0xbc25('0x9')])>=0x1&&parseInt(_0x46651c[_0xbc25('0x9')])<=0xa?parseInt(_0x46651c[_0xbc25('0x9')])*0x3e8:0x5*0x3e8};try{_0x5eeb2c[_0xbc25('0xb')]=_0x46651c[_0xbc25('0xc')]?JSON[_0xbc25('0xd')](Mustache[_0xbc25('0x7')](_0x46651c['data6'],_0x36930c)):{};}catch(_0x2011d4){logger['error'](_0x2011d4[_0xbc25('0xe')]);}switch(_0x46651c['data1']['toUpperCase']()){case _0xbc25('0xf'):case'DELETE':_0x2b50f1=null;_0x5eeb2c['qs']=_0x36930c;break;case _0xbc25('0x10'):case'PUT':if(_0x46651c[_0xbc25('0x11')]){try{_0x2b50f1=JSON[_0xbc25('0xd')](Mustache[_0xbc25('0x7')](_0x46651c[_0xbc25('0x11')],_0x36930c));_0x5eeb2c[_0xbc25('0x12')]=_0x2b50f1;}catch(_0x402411){logger[_0xbc25('0x13')](_0x402411[_0xbc25('0xe')]);logger[_0xbc25('0x13')](_0xbc25('0x14'));}}else{_0x2b50f1=_0x36930c;_0x5eeb2c[_0xbc25('0x12')]=_0x2b50f1;}break;}logger[_0xbc25('0x15')](util[_0xbc25('0x16')](_0xbc25('0x17'),_0x46651c[_0xbc25('0x5')],_0x46651c['data2'],JSON[_0xbc25('0x18')](_0x5eeb2c)));rp(_0x5eeb2c)[_0xbc25('0x19')](function(_0x4c1541){_0x2b50f1=!_[_0xbc25('0x1a')](_0x2b50f1)?_0xbc25('0x1b')+_0x2b50f1:'';_0x447c0b=typeof _0x4c1541[_0xbc25('0x12')]==='object'?JSON[_0xbc25('0x18')](_0x4c1541[_0xbc25('0x12')]):_0x4c1541[_0xbc25('0x12')];logger['info'](util[_0xbc25('0x16')](_0xbc25('0x1c'),_0x46651c[_0xbc25('0x5')],_0x46651c[_0xbc25('0x8')],_0x4c1541[_0xbc25('0x1d')],_0x447c0b));})[_0xbc25('0x1e')](function(_0x2f5818){logger[_0xbc25('0x13')](util[_0xbc25('0x16')](_0xbc25('0x1f'),_0x46651c['data1'],_0x46651c[_0xbc25('0x8')],_0x2f5818['statusCode'],_0x2f5818['name'],_0x2f5818[_0xbc25('0x20')]));});};
\ No newline at end of file