Built motion from commit ded33658aad58fc8de845a8299a9db59a88cc353. Version 3.0.0...
[motion-next.git] / server / services / ami / trigger / urlforward / index.js
index 3c85a42..231ce82 100644 (file)
@@ -1 +1 @@
-const a1148_0x416d=['format',',\x20request\x20body:\x20','data7','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','parse','request-promise-native','DELETE','number','data5','mustache','data6','exec','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','render','toUpperCase','message','headers','data2','stack','error','data1','lodash','statusCode','body','then','catch','trigger','name','GET','stringify','../../../../config/logger','util'];(function(_0x5588b8,_0x416d33){const _0x440baf=function(_0x7adaef){while(--_0x7adaef){_0x5588b8['push'](_0x5588b8['shift']());}};_0x440baf(++_0x416d33);}(a1148_0x416d,0x9a));const a1148_0x440b=function(_0x5588b8,_0x416d33){_0x5588b8=_0x5588b8-0x0;let _0x440baf=a1148_0x416d[_0x5588b8];return _0x440baf;};const _0x36a254=a1148_0x440b;'use strict';const rp=require(_0x36a254('0x11')),util=require(_0x36a254('0xa')),_=require(_0x36a254('0x0')),Mustache=require(_0x36a254('0x15')),logger=require(_0x36a254('0x9'))(_0x36a254('0x5'));exports[_0x36a254('0x17')]=function(_0x7adaef,_0x32dc1a){const _0x24f063=_0x36a254;let _0x488d14,_0x5012cb;const _0x32aeb7={'method':_0x7adaef['data1'][_0x24f063('0x1a')](),'uri':Mustache[_0x24f063('0x19')](_0x7adaef[_0x24f063('0x1d')],_0x32dc1a),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x7adaef[_0x24f063('0x14')])===_0x24f063('0x13')&&parseInt(_0x7adaef[_0x24f063('0x14')])>=0x1&&parseInt(_0x7adaef['data5'])<=0xa?parseInt(_0x7adaef[_0x24f063('0x14')])*0x3e8:0x5*0x3e8};try{_0x32aeb7[_0x24f063('0x1c')]=_0x7adaef[_0x24f063('0x16')]?JSON[_0x24f063('0x10')](Mustache[_0x24f063('0x19')](_0x7adaef['data6'],_0x32dc1a)):{};}catch(_0x5e55df){logger['error'](_0x5e55df[_0x24f063('0x1e')]);}switch(_0x7adaef[_0x24f063('0x20')]['toUpperCase']()){case _0x24f063('0x7'):case _0x24f063('0x12'):_0x488d14=null,_0x32aeb7['qs']=_0x32dc1a;break;case'POST':case'PUT':if(_0x7adaef[_0x24f063('0xd')])try{_0x488d14=JSON[_0x24f063('0x10')](Mustache[_0x24f063('0x19')](_0x7adaef[_0x24f063('0xd')],_0x32dc1a)),_0x32aeb7['body']=_0x488d14;}catch(_0x2312ad){logger[_0x24f063('0x1f')](_0x2312ad[_0x24f063('0x1e')]),logger['error']('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}else _0x488d14=_0x32dc1a,_0x32aeb7[_0x24f063('0x2')]=_0x488d14;break;}logger['info'](util[_0x24f063('0xb')](_0x24f063('0xf'),_0x7adaef[_0x24f063('0x20')],_0x7adaef[_0x24f063('0x1d')],JSON['stringify'](_0x32aeb7))),rp(_0x32aeb7)[_0x24f063('0x3')](function(_0x22f926){const _0x5156a6=_0x24f063;_0x488d14=!_['isNil'](_0x488d14)?_0x5156a6('0xc')+_0x488d14:'',_0x5012cb=typeof _0x22f926[_0x5156a6('0x2')]==='object'?JSON[_0x5156a6('0x8')](_0x22f926['body']):_0x22f926[_0x5156a6('0x2')],logger[_0x5156a6('0xe')](util[_0x5156a6('0xb')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x7adaef[_0x5156a6('0x20')],_0x7adaef[_0x5156a6('0x1d')],_0x22f926['statusCode'],_0x5012cb));})[_0x24f063('0x4')](function(_0x18b21f){const _0x3a0b4e=_0x24f063;logger['error'](util['format'](_0x3a0b4e('0x18'),_0x7adaef[_0x3a0b4e('0x20')],_0x7adaef['data2'],_0x18b21f[_0x3a0b4e('0x1')],_0x18b21f[_0x3a0b4e('0x6')],_0x18b21f[_0x3a0b4e('0x1b')]));});};
\ No newline at end of file
+const a1148_0x3359=['statusCode',',\x20request\x20body:\x20','body','GET','exec','info','format','then','../../../../config/logger','data6','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','util','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','DELETE','data5','request-promise-native','stringify','toUpperCase','error','parse','number','message','render','data7','headers','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data1','PUT','stack','mustache','data2','isNil','POST','trigger'];(function(_0x633084,_0x3359c6){const _0x3ad4cb=function(_0x455fed){while(--_0x455fed){_0x633084['push'](_0x633084['shift']());}};_0x3ad4cb(++_0x3359c6);}(a1148_0x3359,0x71));const a1148_0x3ad4=function(_0x633084,_0x3359c6){_0x633084=_0x633084-0x0;let _0x3ad4cb=a1148_0x3359[_0x633084];return _0x3ad4cb;};const _0x53860a=a1148_0x3ad4;'use strict';const rp=require(_0x53860a('0x4')),util=require(_0x53860a('0x0')),_=require('lodash'),Mustache=require(_0x53860a('0x12')),logger=require(_0x53860a('0x1f'))(_0x53860a('0x16'));exports[_0x53860a('0x1b')]=function(_0x455fed,_0x4ed43c){const _0x385644=_0x53860a;let _0x10a085,_0x4e5d16;const _0xa09a65={'method':_0x455fed['data1'][_0x385644('0x6')](),'uri':Mustache[_0x385644('0xb')](_0x455fed[_0x385644('0x13')],_0x4ed43c),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x455fed[_0x385644('0x3')])===_0x385644('0x9')&&parseInt(_0x455fed['data5'])>=0x1&&parseInt(_0x455fed['data5'])<=0xa?parseInt(_0x455fed['data5'])*0x3e8:0x5*0x3e8};try{_0xa09a65[_0x385644('0xd')]=_0x455fed['data6']?JSON['parse'](Mustache[_0x385644('0xb')](_0x455fed[_0x385644('0x20')],_0x4ed43c)):{};}catch(_0x2340e9){logger[_0x385644('0x7')](_0x2340e9[_0x385644('0x11')]);}switch(_0x455fed['data1'][_0x385644('0x6')]()){case _0x385644('0x1a'):case _0x385644('0x2'):_0x10a085=null,_0xa09a65['qs']=_0x4ed43c;break;case _0x385644('0x15'):case _0x385644('0x10'):if(_0x455fed[_0x385644('0xc')])try{_0x10a085=JSON[_0x385644('0x8')](Mustache['render'](_0x455fed['data7'],_0x4ed43c)),_0xa09a65['body']=_0x10a085;}catch(_0x49d520){logger['error'](_0x49d520[_0x385644('0x11')]),logger[_0x385644('0x7')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}else _0x10a085=_0x4ed43c,_0xa09a65[_0x385644('0x19')]=_0x10a085;break;}logger[_0x385644('0x1c')](util['format'](_0x385644('0xe'),_0x455fed[_0x385644('0xf')],_0x455fed[_0x385644('0x13')],JSON[_0x385644('0x5')](_0xa09a65))),rp(_0xa09a65)[_0x385644('0x1e')](function(_0x45b0d3){const _0xcf3aa3=_0x385644;_0x10a085=!_[_0xcf3aa3('0x14')](_0x10a085)?_0xcf3aa3('0x18')+_0x10a085:'',_0x4e5d16=typeof _0x45b0d3[_0xcf3aa3('0x19')]==='object'?JSON[_0xcf3aa3('0x5')](_0x45b0d3[_0xcf3aa3('0x19')]):_0x45b0d3[_0xcf3aa3('0x19')],logger[_0xcf3aa3('0x1c')](util[_0xcf3aa3('0x1d')](_0xcf3aa3('0x1'),_0x455fed['data1'],_0x455fed[_0xcf3aa3('0x13')],_0x45b0d3['statusCode'],_0x4e5d16));})['catch'](function(_0x4ec3a1){const _0x2de731=_0x385644;logger[_0x2de731('0x7')](util[_0x2de731('0x1d')](_0x2de731('0x21'),_0x455fed['data1'],_0x455fed['data2'],_0x4ec3a1[_0x2de731('0x17')],_0x4ec3a1['name'],_0x4ec3a1[_0x2de731('0xa')]));});};
\ No newline at end of file