Built motion from commit de2cb856.|2.0.30
[motion2.git] / server / api / rpc / rpc.controller.js
1 var _0xb5c6=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x62\x6C\x75\x65\x62\x69\x72\x64","\x6D\x6F\x6D\x65\x6E\x74","\x6C\x6F\x64\x61\x73\x68","\x64\x62","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x79\x73\x71\x6C\x64\x62","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72","\x6A\x61\x79\x73\x6F\x6E\x2F\x70\x72\x6F\x6D\x69\x73\x65","\x68\x74\x74\x70","\x63\x6C\x69\x65\x6E\x74","\x52\x70\x63\x2C\x20\x25\x73\x2C\x20\x25\x73","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x72\x65\x71\x75\x65\x73\x74\x20\x73\x65\x6E\x74","\x69\x6E\x66\x6F","\x52\x70\x63\x2C\x20\x25\x73\x2C\x20\x25\x73\x2C\x20\x25\x73","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x64\x65\x62\x75\x67","\x63\x6F\x64\x65","\x6D\x65\x73\x73\x61\x67\x65","\x72\x65\x73\x75\x6C\x74","\x74\x68\x65\x6E","\x72\x65\x71\x75\x65\x73\x74","\x65\x6E\x74\x69\x74\x79\x20\x66\x6F\x75\x6E\x64","\x52\x70\x63\x2C\x20\x25\x73\x2C\x20\x25\x73\x2C\x20\x25\x73\x2C\x20\x25\x73","\x6A\x73\x6F\x6E","\x73\x74\x61\x74\x75\x73","\x73\x65\x6E\x64","\x76\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x71\x75\x65\x72\x79","\x76\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73\x50\x72\x65\x76\x69\x65\x77","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73\x50\x72\x65\x76\x69\x65\x77","\x70\x61\x72\x61\x6D\x73","\x6D\x65\x72\x67\x65","\x76\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73\x43\x68\x61\x6E\x6E\x65\x6C\x73","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73\x43\x68\x61\x6E\x6E\x65\x6C\x73","\x76\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73\x43\x68\x61\x6E\x6E\x65\x6C","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73\x43\x68\x61\x6E\x6E\x65\x6C","\x76\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73\x43\x68\x61\x6E\x6E\x65\x6C\x48\x61\x6E\x67\x75\x70","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73\x43\x68\x61\x6E\x6E\x65\x6C\x48\x61\x6E\x67\x75\x70","\x76\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73\x43\x68\x61\x6E\x6E\x65\x6C\x52\x65\x64\x69\x72\x65\x63\x74","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73\x43\x68\x61\x6E\x6E\x65\x6C\x52\x65\x64\x69\x72\x65\x63\x74","\x6F\x75\x74\x62\x6F\x75\x6E\x64","\x4F\x75\x74\x62\x6F\x75\x6E\x64","\x6F\x75\x74\x62\x6F\x75\x6E\x64\x43\x68\x61\x6E\x6E\x65\x6C\x73","\x4F\x75\x74\x62\x6F\x75\x6E\x64\x43\x68\x61\x6E\x6E\x65\x6C\x73","\x61\x67\x65\x6E\x74\x73","\x41\x67\x65\x6E\x74\x73","\x74\x65\x6C\x65\x70\x68\x6F\x6E\x65\x73","\x54\x65\x6C\x65\x70\x68\x6F\x6E\x65\x73","\x74\x72\x75\x6E\x6B\x73","\x54\x72\x75\x6E\x6B\x73","\x63\x61\x6D\x70\x61\x69\x67\x6E\x73","\x43\x61\x6D\x70\x61\x69\x67\x6E\x73"];_0xb5c6[0];var BPromise=require(_0xb5c6[1]);var moment=require(_0xb5c6[2]);var _=require(_0xb5c6[3]);var db=require(_0xb5c6[5])[_0xb5c6[4]];var logger=require(_0xb5c6[7])(_0xb5c6[6]);var jayson=require(_0xb5c6[8]);var client=jayson[_0xb5c6[10]][_0xb5c6[9]]({port:9002});function respondWithRpcPromise(_0x708ax9,_0x708axa,_0x708axb){return  new BPromise(function(_0x708axc,_0x708axd){return client[_0xb5c6[23]](_0x708ax9,_0x708axb)[_0xb5c6[22]](function(_0x708axf){logger[_0xb5c6[15]](_0xb5c6[11],_0x708axa,_0xb5c6[14]);logger[_0xb5c6[18]](_0xb5c6[16],_0x708axa,_0xb5c6[14],JSON[_0xb5c6[17]](_0x708axf));if(_0x708axf[_0xb5c6[12]]){if(_0x708axf[_0xb5c6[12]][_0xb5c6[19]]=== 500){logger[_0xb5c6[12]](_0xb5c6[11],_0x708axa,_0x708axf[_0xb5c6[12]][_0xb5c6[20]]);return _0x708axd(_0x708axf[_0xb5c6[12]][_0xb5c6[20]])};logger[_0xb5c6[12]](_0xb5c6[11],_0x708axa,_0x708axf[_0xb5c6[12]][_0xb5c6[20]]);return _0x708axc(_0x708axf[_0xb5c6[12]][_0xb5c6[20]])}else {logger[_0xb5c6[15]](_0xb5c6[11],_0x708axa,_0xb5c6[14]);_0x708axc(_0x708axf[_0xb5c6[21]])}})[_0xb5c6[13]](function(_0x708axe){logger[_0xb5c6[12]](_0xb5c6[11],_0x708axa,_0x708axe);_0x708axd(_0x708axe)})})}function respondWithResult(_0x708axf,_0x708ax11,_0x708axa){_0x708ax11= _0x708ax11|| 200;return function(_0x708ax12){if(_0x708ax12){logger[_0xb5c6[15]](_0xb5c6[16],_0x708axa,_0x708ax11,_0xb5c6[24]);logger[_0xb5c6[18]](_0xb5c6[25],_0x708axa,_0x708ax11,_0xb5c6[24],JSON[_0xb5c6[17]](_0x708ax12));return _0x708axf[_0xb5c6[27]](_0x708ax11)[_0xb5c6[26]](_0x708ax12)};return null}}function handleError(_0x708axf,_0x708ax11,_0x708axa){_0x708ax11= _0x708ax11|| 500;return function(_0x708axe){logger[_0xb5c6[12]](_0xb5c6[11],_0x708axa,_0x708ax11,_0x708axe);_0x708axf[_0xb5c6[27]](_0x708ax11)[_0xb5c6[28]](_0x708axe)}}exports[_0xb5c6[29]]= function(_0x708axb,_0x708axf){return respondWithRpcPromise(_0xb5c6[30],_0xb5c6[30],_0x708axb[_0xb5c6[31]])[_0xb5c6[22]](respondWithResult(_0x708axf,null,_0xb5c6[30]))[_0xb5c6[13]](handleError(_0x708axf,null,_0xb5c6[30]))};exports[_0xb5c6[32]]= function(_0x708axb,_0x708axf){return respondWithRpcPromise(_0xb5c6[33],_0xb5c6[33],_[_0xb5c6[35]](_0x708axb[_0xb5c6[31]],_0x708axb[_0xb5c6[34]]))[_0xb5c6[22]](respondWithResult(_0x708axf,null,_0xb5c6[33]))[_0xb5c6[13]](handleError(_0x708axf,null,_0xb5c6[33]))};exports[_0xb5c6[36]]= function(_0x708axb,_0x708axf){return respondWithRpcPromise(_0xb5c6[37],_0xb5c6[37],_0x708axb[_0xb5c6[31]])[_0xb5c6[22]](respondWithResult(_0x708axf,null,_0xb5c6[37]))[_0xb5c6[13]](handleError(_0x708axf,null,_0xb5c6[37]))};exports[_0xb5c6[38]]= function(_0x708axb,_0x708axf){return respondWithRpcPromise(_0xb5c6[39],_0xb5c6[39],_[_0xb5c6[35]](_0x708axb[_0xb5c6[31]],_0x708axb[_0xb5c6[34]]))[_0xb5c6[22]](respondWithResult(_0x708axf,null,_0xb5c6[39]))[_0xb5c6[13]](handleError(_0x708axf,null,_0xb5c6[39]))};exports[_0xb5c6[40]]= function(_0x708axb,_0x708axf){return respondWithRpcPromise(_0xb5c6[41],_0xb5c6[41],_[_0xb5c6[35]](_0x708axb[_0xb5c6[31]],_0x708axb[_0xb5c6[34]]))[_0xb5c6[22]](respondWithResult(_0x708axf,null,_0xb5c6[41]))[_0xb5c6[13]](handleError(_0x708axf,null,_0xb5c6[41]))};exports[_0xb5c6[42]]= function(_0x708axb,_0x708axf){return respondWithRpcPromise(_0xb5c6[43],_0xb5c6[43],_[_0xb5c6[35]](_0x708axb[_0xb5c6[31]],_0x708axb[_0xb5c6[34]]))[_0xb5c6[22]](respondWithResult(_0x708axf,null,_0xb5c6[43]))[_0xb5c6[13]](handleError(_0x708axf,null,_0xb5c6[43]))};exports[_0xb5c6[44]]= function(_0x708axb,_0x708axf){return respondWithRpcPromise(_0xb5c6[45],_0xb5c6[45],_0x708axb[_0xb5c6[31]])[_0xb5c6[22]](respondWithResult(_0x708axf,null,_0xb5c6[45]))[_0xb5c6[13]](handleError(_0x708axf,null,_0xb5c6[45]))};exports[_0xb5c6[46]]= function(_0x708axb,_0x708axf){return respondWithRpcPromise(_0xb5c6[47],_0xb5c6[47],_0x708axb[_0xb5c6[31]])[_0xb5c6[22]](respondWithResult(_0x708axf,null,_0xb5c6[47]))[_0xb5c6[13]](handleError(_0x708axf,null,_0xb5c6[47]))};exports[_0xb5c6[48]]= function(_0x708axb,_0x708axf){return respondWithRpcPromise(_0xb5c6[49],_0xb5c6[49],_0x708axb[_0xb5c6[31]])[_0xb5c6[22]](respondWithResult(_0x708axf,null,_0xb5c6[49]))[_0xb5c6[13]](handleError(_0x708axf,null,_0xb5c6[49]))};exports[_0xb5c6[50]]= function(_0x708axb,_0x708axf){return respondWithRpcPromise(_0xb5c6[51],_0xb5c6[51],_0x708axb[_0xb5c6[31]])[_0xb5c6[22]](respondWithResult(_0x708axf,null,_0xb5c6[51]))[_0xb5c6[13]](handleError(_0x708axf,null,_0xb5c6[51]))};exports[_0xb5c6[52]]= function(_0x708axb,_0x708axf){return respondWithRpcPromise(_0xb5c6[53],_0xb5c6[53],_0x708axb[_0xb5c6[31]])[_0xb5c6[22]](respondWithResult(_0x708axf,null,_0xb5c6[53]))[_0xb5c6[13]](handleError(_0x708axf,null,_0xb5c6[53]))};exports[_0xb5c6[54]]= function(_0x708axb,_0x708axf){return respondWithRpcPromise(_0xb5c6[55],_0xb5c6[55],_0x708axb[_0xb5c6[31]])[_0xb5c6[22]](respondWithResult(_0x708axf,null,_0xb5c6[55]))[_0xb5c6[13]](handleError(_0x708axf,null,_0xb5c6[55]))}