Built motion from commit c8dd8619.|2.0.42
[motion2.git] / server / api / trunk / trunk.rpc.js
1 var _0x40f7=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x6D\x6F\x6D\x65\x6E\x74","\x62\x6C\x75\x65\x62\x69\x72\x64","\x72\x61\x6E\x64\x6F\x6D\x73\x74\x72\x69\x6E\x67","\x64\x62","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x79\x73\x71\x6C\x64\x62","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C\x73","\x72\x70\x63","\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","\x54\x72\x75\x6E\x6B\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","\x54\x72\x75\x6E\x6B\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","\x47\x65\x74\x54\x72\x75\x6E\x6B","\x6F\x70\x74\x69\x6F\x6E\x73","\x72\x61\x77","\x77\x68\x65\x72\x65","\x61\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x6C\x69\x6D\x69\x74","\x69\x6E\x63\x6C\x75\x64\x65","\x6D\x6F\x64\x65\x6C","\x61\x73","\x6D\x61\x70","\x66\x69\x6E\x64\x41\x6C\x6C","\x54\x72\x75\x6E\x6B","\x53\x68\x6F\x77\x54\x72\x75\x6E\x6B","\x66\x69\x6E\x64"];_0x40f7[0];var _=require(_0x40f7[1]);var util=require(_0x40f7[2]);var moment=require(_0x40f7[3]);var BPromise=require(_0x40f7[4]);var rs=require(_0x40f7[5]);var db=require(_0x40f7[7])[_0x40f7[6]];var utils=require(_0x40f7[8]);var logger=require(_0x40f7[10])(_0x40f7[9]);var jayson=require(_0x40f7[11]);var client=jayson[_0x40f7[13]][_0x40f7[12]]({port:9002});function respondWithRpcPromise(_0x7200xc,_0x7200xd,_0x7200xe){return  new BPromise(function(_0x7200xf,_0x7200x10){return client[_0x40f7[26]](_0x7200xc,_0x7200xe)[_0x40f7[25]](function(_0x7200x12){logger[_0x40f7[18]](_0x40f7[14],_0x7200xd,_0x40f7[17]);logger[_0x40f7[21]](_0x40f7[19],_0x7200xd,_0x40f7[17],JSON[_0x40f7[20]](_0x7200x12));if(_0x7200x12[_0x40f7[15]]){if(_0x7200x12[_0x40f7[15]][_0x40f7[22]]=== 500){logger[_0x40f7[15]](_0x40f7[14],_0x7200xd,_0x7200x12[_0x40f7[15]][_0x40f7[23]]);return _0x7200x10(_0x7200x12[_0x40f7[15]][_0x40f7[23]])};logger[_0x40f7[15]](_0x40f7[14],_0x7200xd,_0x7200x12[_0x40f7[15]][_0x40f7[23]]);return _0x7200xf(_0x7200x12[_0x40f7[15]][_0x40f7[23]])}else {logger[_0x40f7[18]](_0x40f7[14],_0x7200xd,_0x40f7[17]);_0x7200xf(_0x7200x12[_0x40f7[24]][_0x40f7[23]])}})[_0x40f7[16]](function(_0x7200x11){logger[_0x40f7[15]](_0x40f7[14],_0x7200xd,_0x7200x11);_0x7200x10(_0x7200x11)})})}exports[_0x40f7[27]]= function(_0x7200xe){var _0x7200x13=this;return  new Promise(function(_0x7200xf,_0x7200x10){return db[_0x40f7[38]][_0x40f7[37]]({raw:_0x7200xe[_0x40f7[28]]?(_0x7200xe[_0x40f7[28]][_0x40f7[29]]=== undefined)?true:false:true,where:_0x7200xe[_0x40f7[28]]?_0x7200xe[_0x40f7[28]][_0x40f7[30]]|| null:null,attributes:_0x7200xe[_0x40f7[28]]?_0x7200xe[_0x40f7[28]][_0x40f7[31]]|| null:null,limit:_0x7200xe[_0x40f7[28]]?_0x7200xe[_0x40f7[28]][_0x40f7[32]]|| null:null,include:_0x7200xe[_0x40f7[28]]?(_0x7200xe[_0x40f7[28]][_0x40f7[33]]?_[_0x40f7[36]](_0x7200xe[_0x40f7[28]][_0x40f7[33]],function(_0x7200x14){return {model:db[_0x7200x14[_0x40f7[34]]],as:_0x7200x14[_0x40f7[35]],attributes:_0x7200x14[_0x40f7[31]],include:_0x7200x14[_0x40f7[33]]?_[_0x40f7[36]](_0x7200x14[_0x40f7[33]],function(_0x7200x15){return {model:db[_0x7200x15[_0x40f7[34]]],as:_0x7200x15[_0x40f7[35]],attributes:_0x7200x15[_0x40f7[31]],include:_0x7200x15[_0x40f7[33]]?_[_0x40f7[36]](_0x7200x15[_0x40f7[33]],function(_0x7200x16){return {model:db[_0x7200x16[_0x40f7[34]]],as:_0x7200x16[_0x40f7[35]],attributes:_0x7200x16[_0x40f7[31]]}}):[]}}):[]}}):[]):[]})[_0x40f7[25]](function(_0x7200x12){logger[_0x40f7[18]](_0x40f7[27],_0x7200xe);logger[_0x40f7[21]](_0x40f7[27],_0x7200xe,JSON[_0x40f7[20]](_0x7200x12));_0x7200xf(_0x7200x12)})[_0x40f7[16]](function(_0x7200x11){logger[_0x40f7[15]](_0x40f7[27],_0x7200x11[_0x40f7[23]],_0x7200xe);_0x7200x10(_0x7200x13[_0x40f7[15]](500,_0x7200x11[_0x40f7[23]]))})})};exports[_0x40f7[39]]= function(_0x7200xe){var _0x7200x13=this;return  new Promise(function(_0x7200xf,_0x7200x10){return db[_0x40f7[38]][_0x40f7[40]]({raw:_0x7200xe[_0x40f7[28]]?(_0x7200xe[_0x40f7[28]][_0x40f7[29]]=== undefined)?true:false:true,where:_0x7200xe[_0x40f7[28]]?_0x7200xe[_0x40f7[28]][_0x40f7[30]]|| null:null,attributes:_0x7200xe[_0x40f7[28]]?_0x7200xe[_0x40f7[28]][_0x40f7[31]]|| null:null,include:_0x7200xe[_0x40f7[28]]?(_0x7200xe[_0x40f7[28]][_0x40f7[33]]?_[_0x40f7[36]](_0x7200xe[_0x40f7[28]][_0x40f7[33]],function(_0x7200x14){return {model:db[_0x7200x14[_0x40f7[34]]],as:_0x7200x14[_0x40f7[35]],attributes:_0x7200x14[_0x40f7[31]],include:_0x7200x14[_0x40f7[33]]?_[_0x40f7[36]](_0x7200x14[_0x40f7[33]],function(_0x7200x15){return {model:db[_0x7200x15[_0x40f7[34]]],as:_0x7200x15[_0x40f7[35]],attributes:_0x7200x15[_0x40f7[31]],include:_0x7200x15[_0x40f7[33]]?_[_0x40f7[36]](_0x7200x15[_0x40f7[33]],function(_0x7200x16){return {model:db[_0x7200x16[_0x40f7[34]]],as:_0x7200x16[_0x40f7[35]],attributes:_0x7200x16[_0x40f7[31]]}}):[]}}):[]}}):[]):[]})[_0x40f7[25]](function(_0x7200x12){logger[_0x40f7[18]](_0x40f7[39],_0x7200xe);logger[_0x40f7[21]](_0x40f7[39],_0x7200xe,JSON[_0x40f7[20]](_0x7200x12));_0x7200xf(_0x7200x12)})[_0x40f7[16]](function(_0x7200x11){logger[_0x40f7[15]](_0x40f7[39],_0x7200x11[_0x40f7[23]],_0x7200xe);_0x7200x10(_0x7200x13[_0x40f7[15]](500,_0x7200x11[_0x40f7[23]]))})})}