Built motion from commit ab065936.|2.0.51
[motion2.git] / server / api / cmHopper / cmHopper.rpc.js
1 var _0x97fd=["\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","\x43\x6D\x48\x6F\x70\x70\x65\x72\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","\x43\x6D\x48\x6F\x70\x70\x65\x72\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\x43\x6D\x48\x6F\x70\x70\x65\x72","\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","\x43\x6D\x48\x6F\x70\x70\x65\x72","\x53\x68\x6F\x77\x43\x6D\x48\x6F\x70\x70\x65\x72","\x66\x69\x6E\x64","\x43\x72\x65\x61\x74\x65\x43\x6D\x48\x6F\x70\x70\x65\x72","\x62\x6F\x64\x79","\x63\x72\x65\x61\x74\x65","\x55\x70\x64\x61\x74\x65\x43\x6D\x48\x6F\x70\x70\x65\x72","\x75\x70\x64\x61\x74\x65","\x44\x65\x73\x74\x72\x6F\x79\x43\x6D\x48\x6F\x70\x70\x65\x72","\x64\x65\x73\x74\x72\x6F\x79","\x47\x65\x74\x43\x6F\x6E\x74\x61\x63\x74\x44\x69\x61\x6C\x65\x72","\x6C\x65\x6E\x67\x74\x68","\x70\x75\x73\x68","\x61\x6C\x6C","\x6F\x72\x64\x65\x72","\x55\x50\x44\x41\x54\x45","\x4C\x4F\x43\x4B","\x43\x6D\x43\x6F\x6E\x74\x61\x63\x74","\x43\x6F\x6E\x74\x61\x63\x74","\x6B\x65\x79\x73","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x64\x65\x73\x63\x72\x69\x62\x65","\x4D\x6F\x76\x65\x43\x6F\x6E\x74\x61\x63\x74\x4D\x61\x6E\x61\x67\x65\x64\x44\x69\x61\x6C\x65\x72","\x43\x6D\x48\x6F\x70\x70\x65\x72\x46\x69\x6E\x61\x6C","\x43\x6F\x75\x6E\x74\x52\x65\x53\x63\x68\x65\x64\x75\x6C\x65\x64","\x43\x4F\x55\x4E\x54","\x49\x46","\x60\x73\x63\x68\x65\x64\x75\x6C\x65\x64\x61\x74\x60\x20\x3E\x3D\x20","\x22\x25\x73\x22","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x6D\x61\x74","\x20\x2C\x20\x31\x2C\x20\x6E\x75\x6C\x6C","\x6C\x69\x74\x65\x72\x61\x6C","\x66\x6E","\x63\x6F\x6E\x74\x61\x63\x74\x73\x52\x65\x73\x63\x68\x65\x64\x75\x6C\x65\x64","\x47\x65\x74\x43\x6F\x6E\x74\x61\x63\x74\x52\x65\x63\x61\x6C\x6C\x4D\x65","\x55\x73\x65\x72\x49\x64"];_0x97fd[0];var _=require(_0x97fd[1]);var util=require(_0x97fd[2]);var moment=require(_0x97fd[3]);var BPromise=require(_0x97fd[4]);var rs=require(_0x97fd[5]);var db=require(_0x97fd[7])[_0x97fd[6]];var utils=require(_0x97fd[8]);var logger=require(_0x97fd[10])(_0x97fd[9]);var jayson=require(_0x97fd[11]);var client=jayson[_0x97fd[13]][_0x97fd[12]]({port:9002});function respondWithRpcPromise(_0x368axc,_0x368axd,_0x368axe){return  new BPromise(function(_0x368axf,_0x368ax10){return client[_0x97fd[26]](_0x368axc,_0x368axe)[_0x97fd[25]](function(_0x368ax12){logger[_0x97fd[18]](_0x97fd[14],_0x368axd,_0x97fd[17]);logger[_0x97fd[21]](_0x97fd[19],_0x368axd,_0x97fd[17],JSON[_0x97fd[20]](_0x368ax12));if(_0x368ax12[_0x97fd[15]]){if(_0x368ax12[_0x97fd[15]][_0x97fd[22]]=== 500){logger[_0x97fd[15]](_0x97fd[14],_0x368axd,_0x368ax12[_0x97fd[15]][_0x97fd[23]]);return _0x368ax10(_0x368ax12[_0x97fd[15]][_0x97fd[23]])};logger[_0x97fd[15]](_0x97fd[14],_0x368axd,_0x368ax12[_0x97fd[15]][_0x97fd[23]]);return _0x368axf(_0x368ax12[_0x97fd[15]][_0x97fd[23]])}else {logger[_0x97fd[18]](_0x97fd[14],_0x368axd,_0x97fd[17]);_0x368axf(_0x368ax12[_0x97fd[24]][_0x97fd[23]])}})[_0x97fd[16]](function(_0x368ax11){logger[_0x97fd[15]](_0x97fd[14],_0x368axd,_0x368ax11);_0x368ax10(_0x368ax11)})})}exports[_0x97fd[27]]= function(_0x368axe){var _0x368ax13=this;return  new Promise(function(_0x368axf,_0x368ax10){return db[_0x97fd[38]][_0x97fd[37]]({raw:_0x368axe[_0x97fd[28]]?(_0x368axe[_0x97fd[28]][_0x97fd[29]]=== undefined)?true:false:true,where:_0x368axe[_0x97fd[28]]?_0x368axe[_0x97fd[28]][_0x97fd[30]]|| null:null,attributes:_0x368axe[_0x97fd[28]]?_0x368axe[_0x97fd[28]][_0x97fd[31]]|| null:null,limit:_0x368axe[_0x97fd[28]]?_0x368axe[_0x97fd[28]][_0x97fd[32]]|| null:null,include:_0x368axe[_0x97fd[28]]?(_0x368axe[_0x97fd[28]][_0x97fd[33]]?_[_0x97fd[36]](_0x368axe[_0x97fd[28]][_0x97fd[33]],function(_0x368ax14){return {model:db[_0x368ax14[_0x97fd[34]]],as:_0x368ax14[_0x97fd[35]],attributes:_0x368ax14[_0x97fd[31]],include:_0x368ax14[_0x97fd[33]]?_[_0x97fd[36]](_0x368ax14[_0x97fd[33]],function(_0x368ax15){return {model:db[_0x368ax15[_0x97fd[34]]],as:_0x368ax15[_0x97fd[35]],attributes:_0x368ax15[_0x97fd[31]],include:_0x368ax15[_0x97fd[33]]?_[_0x97fd[36]](_0x368ax15[_0x97fd[33]],function(_0x368ax16){return {model:db[_0x368ax16[_0x97fd[34]]],as:_0x368ax16[_0x97fd[35]],attributes:_0x368ax16[_0x97fd[31]]}}):[]}}):[]}}):[]):[]})[_0x97fd[25]](function(_0x368ax12){logger[_0x97fd[18]](_0x97fd[27],_0x368axe);logger[_0x97fd[21]](_0x97fd[27],_0x368axe,JSON[_0x97fd[20]](_0x368ax12));_0x368axf(_0x368ax12)})[_0x97fd[16]](function(_0x368ax11){logger[_0x97fd[15]](_0x97fd[27],_0x368ax11[_0x97fd[23]],_0x368axe);_0x368ax10(_0x368ax13[_0x97fd[15]](500,_0x368ax11[_0x97fd[23]]))})})};exports[_0x97fd[39]]= function(_0x368axe){var _0x368ax13=this;return  new Promise(function(_0x368axf,_0x368ax10){return db[_0x97fd[38]][_0x97fd[40]]({raw:_0x368axe[_0x97fd[28]]?(_0x368axe[_0x97fd[28]][_0x97fd[29]]=== undefined)?true:false:true,where:_0x368axe[_0x97fd[28]]?_0x368axe[_0x97fd[28]][_0x97fd[30]]|| null:null,attributes:_0x368axe[_0x97fd[28]]?_0x368axe[_0x97fd[28]][_0x97fd[31]]|| null:null,include:_0x368axe[_0x97fd[28]]?(_0x368axe[_0x97fd[28]][_0x97fd[33]]?_[_0x97fd[36]](_0x368axe[_0x97fd[28]][_0x97fd[33]],function(_0x368ax14){return {model:db[_0x368ax14[_0x97fd[34]]],as:_0x368ax14[_0x97fd[35]],attributes:_0x368ax14[_0x97fd[31]],include:_0x368ax14[_0x97fd[33]]?_[_0x97fd[36]](_0x368ax14[_0x97fd[33]],function(_0x368ax15){return {model:db[_0x368ax15[_0x97fd[34]]],as:_0x368ax15[_0x97fd[35]],attributes:_0x368ax15[_0x97fd[31]],include:_0x368ax15[_0x97fd[33]]?_[_0x97fd[36]](_0x368ax15[_0x97fd[33]],function(_0x368ax16){return {model:db[_0x368ax16[_0x97fd[34]]],as:_0x368ax16[_0x97fd[35]],attributes:_0x368ax16[_0x97fd[31]]}}):[]}}):[]}}):[]):[]})[_0x97fd[25]](function(_0x368ax12){logger[_0x97fd[18]](_0x97fd[39],_0x368axe);logger[_0x97fd[21]](_0x97fd[39],_0x368axe,JSON[_0x97fd[20]](_0x368ax12));_0x368axf(_0x368ax12)})[_0x97fd[16]](function(_0x368ax11){logger[_0x97fd[15]](_0x97fd[39],_0x368ax11[_0x97fd[23]],_0x368axe);_0x368ax10(_0x368ax13[_0x97fd[15]](500,_0x368ax11[_0x97fd[23]]))})})};exports[_0x97fd[41]]= function(_0x368axe){var _0x368ax13=this;return  new Promise(function(_0x368axf,_0x368ax10){return db[_0x97fd[38]][_0x97fd[43]](_0x368axe[_0x97fd[42]],{raw:_0x368axe[_0x97fd[28]]?(_0x368axe[_0x97fd[28]][_0x97fd[29]]=== undefined)?true:false:true})[_0x97fd[25]](function(_0x368ax12){logger[_0x97fd[18]](_0x97fd[41],_0x368axe);logger[_0x97fd[21]](_0x97fd[41],_0x368axe,JSON[_0x97fd[20]](_0x368ax12));_0x368axf(_0x368ax12)})[_0x97fd[16]](function(_0x368ax11){logger[_0x97fd[15]](_0x97fd[41],_0x368ax11[_0x97fd[23]],_0x368axe);_0x368ax10(_0x368ax13[_0x97fd[15]](500,_0x368ax11[_0x97fd[23]]))})})};exports[_0x97fd[44]]= function(_0x368axe){var _0x368ax13=this;return  new Promise(function(_0x368axf,_0x368ax10){return db[_0x97fd[38]][_0x97fd[45]](_0x368axe[_0x97fd[42]],{raw:_0x368axe[_0x97fd[28]]?(_0x368axe[_0x97fd[28]][_0x97fd[29]]=== undefined)?true:false:true,individualHooks:true,where:_0x368axe[_0x97fd[28]]?_0x368axe[_0x97fd[28]][_0x97fd[30]]|| null:null,attributes:_0x368axe[_0x97fd[28]]?_0x368axe[_0x97fd[28]][_0x97fd[31]]|| null:null,limit:_0x368axe[_0x97fd[28]]?_0x368axe[_0x97fd[28]][_0x97fd[32]]|| null:null})[_0x97fd[25]](function(_0x368ax12){logger[_0x97fd[18]](_0x97fd[44],_0x368axe);logger[_0x97fd[21]](_0x97fd[44],_0x368axe,JSON[_0x97fd[20]](_0x368ax12));_0x368axf(_0x368ax12)})[_0x97fd[16]](function(_0x368ax11){logger[_0x97fd[15]](_0x97fd[44],_0x368ax11[_0x97fd[23]],_0x368axe);_0x368ax10(_0x368ax13[_0x97fd[15]](500,_0x368ax11[_0x97fd[23]]))})})};exports[_0x97fd[46]]= function(_0x368axe){var _0x368ax13=this;return  new Promise(function(_0x368axf,_0x368ax10){return db[_0x97fd[38]][_0x97fd[47]]({where:_0x368axe[_0x97fd[28]]?_0x368axe[_0x97fd[28]][_0x97fd[30]]|| null:null})[_0x97fd[25]](function(_0x368ax12){logger[_0x97fd[18]](_0x97fd[46],_0x368axe);logger[_0x97fd[21]](_0x97fd[46],_0x368axe,JSON[_0x97fd[20]](_0x368ax12));_0x368axf(_0x368ax12)})[_0x97fd[16]](function(_0x368ax11){logger[_0x97fd[15]](_0x97fd[46],_0x368ax11[_0x97fd[23]],_0x368axe);_0x368ax10(_0x368ax13[_0x97fd[15]](500,_0x368ax11[_0x97fd[23]]))})})};exports[_0x97fd[48]]= function(_0x368axe){var _0x368ax13=this;return  new Promise(function(_0x368axf,_0x368ax10){return db[_0x97fd[55]][_0x97fd[60]]()[_0x97fd[25]](function(_0x368ax17){return db[_0x97fd[59]][_0x97fd[58]](function(_0x368ax18){return db[_0x97fd[38]][_0x97fd[37]]({where:_0x368axe[_0x97fd[28]]?_0x368axe[_0x97fd[28]][_0x97fd[30]]|| null:null,attributes:_0x368axe[_0x97fd[28]]?_0x368axe[_0x97fd[28]][_0x97fd[31]]|| null:null,limit:_0x368axe[_0x97fd[28]]?_0x368axe[_0x97fd[28]][_0x97fd[32]]|| null:null,order:_0x368axe[_0x97fd[28]]?_0x368axe[_0x97fd[28]][_0x97fd[52]]|| null:null,transaction:_0x368ax18,lock:_0x368ax18[_0x97fd[54]][_0x97fd[53]],include:[{model:db[_0x97fd[55]],as:_0x97fd[56],attributes:_[_0x97fd[57]](_0x368ax17)}]})[_0x97fd[25]](function(_0x368ax12){var _0x368ax19=[];for(var _0x368ax14=0;_0x368ax14< _0x368ax12[_0x97fd[49]];_0x368ax14+= 1){_0x368ax19[_0x97fd[50]](_0x368ax12[_0x368ax14][_0x97fd[45]](_0x368axe[_0x97fd[42]],{transaction:_0x368ax18}))};return BPromise[_0x97fd[51]](_0x368ax19)})})[_0x97fd[25]](function(_0x368ax12){logger[_0x97fd[18]](_0x97fd[48],_0x368axe);logger[_0x97fd[21]](_0x97fd[48],_0x368axe,JSON[_0x97fd[20]](_0x368ax12));_0x368axf(_0x368ax12)})[_0x97fd[16]](function(_0x368ax11){logger[_0x97fd[15]](_0x97fd[48],_0x368ax11[_0x97fd[23]],_0x368axe);_0x368ax10(_0x368ax13[_0x97fd[15]](500,_0x368ax11[_0x97fd[23]]))})})})};exports[_0x97fd[61]]= function(_0x368axe){var _0x368ax13=this;return  new Promise(function(_0x368axf,_0x368ax10){return db[_0x97fd[59]][_0x97fd[58]](function(_0x368ax18){return db[_0x97fd[62]][_0x97fd[43]](_0x368axe[_0x97fd[42]],{raw:_0x368axe[_0x97fd[28]]?(_0x368axe[_0x97fd[28]][_0x97fd[29]]=== undefined)?true:false:true,transaction:_0x368ax18})[_0x97fd[25]](function(){return db[_0x97fd[38]][_0x97fd[47]]({where:_0x368axe[_0x97fd[28]]?_0x368axe[_0x97fd[28]][_0x97fd[30]]|| null:null,transaction:_0x368ax18})})})[_0x97fd[25]](function(_0x368ax12){logger[_0x97fd[18]](_0x97fd[61],_0x368axe);logger[_0x97fd[21]](_0x97fd[61],_0x368axe,JSON[_0x97fd[20]](_0x368ax12));_0x368axf(_0x368ax12)})[_0x97fd[16]](function(_0x368ax11){logger[_0x97fd[15]](_0x97fd[61],_0x368ax11[_0x97fd[23]],_0x368axe);_0x368ax10(_0x368ax13[_0x97fd[15]](500,_0x368ax11[_0x97fd[23]]))})})};exports[_0x97fd[63]]= function(_0x368axe){var _0x368ax13=this;return  new Promise(function(_0x368axf,_0x368ax10){return db[_0x97fd[38]][_0x97fd[37]]({raw:_0x368axe[_0x97fd[28]]?(_0x368axe[_0x97fd[28]][_0x97fd[29]]=== undefined)?true:false:true,where:_0x368axe[_0x97fd[28]]?_0x368axe[_0x97fd[28]][_0x97fd[30]]|| null:null,attributes:[[db[_0x97fd[59]][_0x97fd[72]](_0x97fd[64],db[_0x97fd[59]][_0x97fd[72]](_0x97fd[65],db[_0x97fd[59]][_0x97fd[71]](_0x97fd[66]+ util[_0x97fd[69]](_0x97fd[67],moment()[_0x97fd[69]](_0x97fd[68]))+ _0x97fd[70]))),_0x97fd[73]]]})[_0x97fd[25]](function(_0x368ax12){logger[_0x97fd[18]](_0x97fd[63],_0x368axe);logger[_0x97fd[21]](_0x97fd[63],_0x368axe,JSON[_0x97fd[20]](_0x368ax12));_0x368axf(_0x368ax12)})[_0x97fd[16]](function(_0x368ax11){logger[_0x97fd[15]](_0x97fd[63],_0x368ax11[_0x97fd[23]],_0x368axe);_0x368ax10(_0x368ax13[_0x97fd[15]](500,_0x368ax11[_0x97fd[23]]))})})};exports[_0x97fd[74]]= function(_0x368axe){var _0x368ax13=this;return  new Promise(function(_0x368axf,_0x368ax10){return db[_0x97fd[55]][_0x97fd[60]]()[_0x97fd[25]](function(_0x368ax17){return db[_0x97fd[59]][_0x97fd[58]](function(_0x368ax18){return db[_0x97fd[38]][_0x97fd[37]]({where:_0x368axe[_0x97fd[28]]?_0x368axe[_0x97fd[28]][_0x97fd[30]]|| null:null,attributes:_0x368axe[_0x97fd[28]]?_0x368axe[_0x97fd[28]][_0x97fd[31]]|| null:null,limit:_0x368axe[_0x97fd[28]]?_0x368axe[_0x97fd[28]][_0x97fd[32]]|| null:null,order:_0x368axe[_0x97fd[28]]?_0x368axe[_0x97fd[28]][_0x97fd[52]]|| null:null,group:db[_0x97fd[38]][_0x97fd[75]],transaction:_0x368ax18,lock:_0x368ax18[_0x97fd[54]][_0x97fd[53]],include:_0x368axe[_0x97fd[28]]?(_0x368axe[_0x97fd[28]][_0x97fd[33]]?_[_0x97fd[36]](_0x368axe[_0x97fd[28]][_0x97fd[33]],function(_0x368ax14){return {model:db[_0x368ax14[_0x97fd[34]]],as:_0x368ax14[_0x97fd[35]],attributes:_0x368ax14[_0x97fd[31]],include:_0x368ax14[_0x97fd[33]]?_[_0x97fd[36]](_0x368ax14[_0x97fd[33]],function(_0x368ax15){return {model:db[_0x368ax15[_0x97fd[34]]],as:_0x368ax15[_0x97fd[35]],attributes:_0x368ax15[_0x97fd[31]],include:_0x368ax15[_0x97fd[33]]?_[_0x97fd[36]](_0x368ax15[_0x97fd[33]],function(_0x368ax16){return {model:db[_0x368ax16[_0x97fd[34]]],as:_0x368ax16[_0x97fd[35]],attributes:_0x368ax16[_0x97fd[31]]}}):[]}}):[]}}):[]):[]})[_0x97fd[25]](function(_0x368ax12){var _0x368ax19=[];for(var _0x368ax14=0;_0x368ax14< _0x368ax12[_0x97fd[49]];_0x368ax14+= 1){_0x368ax19[_0x97fd[50]](_0x368ax12[_0x368ax14][_0x97fd[45]](_0x368axe[_0x97fd[42]],{transaction:_0x368ax18}))};return BPromise[_0x97fd[51]](_0x368ax19)})})[_0x97fd[25]](function(_0x368ax12){logger[_0x97fd[18]](_0x97fd[74],_0x368axe);logger[_0x97fd[21]](_0x97fd[74],_0x368axe,JSON[_0x97fd[20]](_0x368ax12));_0x368axf(_0x368ax12)})[_0x97fd[16]](function(_0x368ax11){logger[_0x97fd[15]](_0x97fd[74],_0x368ax11[_0x97fd[23]],_0x368axe);_0x368ax10(_0x368ax13[_0x97fd[15]](500,_0x368ax11[_0x97fd[23]]))})})})}