Built motion from commit 70d17190.|2.0.55
[motion2.git] / server / api / interval / interval.rpc.js
1 var _0xb2e8=["\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","\x66\x73","\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","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x6A\x61\x79\x73\x6F\x6E\x2F\x70\x72\x6F\x6D\x69\x73\x65","\x68\x74\x74\x70","\x63\x6C\x69\x65\x6E\x74","\x49\x6E\x74\x65\x72\x76\x61\x6C\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","\x49\x6E\x74\x65\x72\x76\x61\x6C\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\x49\x6E\x74\x65\x72\x76\x61\x6C","\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","\x49\x6E\x74\x65\x72\x76\x61\x6C","\x53\x68\x6F\x77\x49\x6E\x74\x65\x72\x76\x61\x6C","\x66\x69\x6E\x64"];_0xb2e8[0];var _=require(_0xb2e8[1]);var util=require(_0xb2e8[2]);var moment=require(_0xb2e8[3]);var BPromise=require(_0xb2e8[4]);var rs=require(_0xb2e8[5]);var fs=require(_0xb2e8[6]);var db=require(_0xb2e8[8])[_0xb2e8[7]];var utils=require(_0xb2e8[9]);var logger=require(_0xb2e8[11])(_0xb2e8[10]);var config=require(_0xb2e8[12]);var jayson=require(_0xb2e8[13]);var client=jayson[_0xb2e8[15]][_0xb2e8[14]]({port:9002});function respondWithRpcPromise(_0x6efdxe,_0x6efdxf,_0x6efdx10){return  new BPromise(function(_0x6efdx11,_0x6efdx12){return client[_0xb2e8[28]](_0x6efdxe,_0x6efdx10)[_0xb2e8[27]](function(_0x6efdx14){logger[_0xb2e8[20]](_0xb2e8[16],_0x6efdxf,_0xb2e8[19]);logger[_0xb2e8[23]](_0xb2e8[21],_0x6efdxf,_0xb2e8[19],JSON[_0xb2e8[22]](_0x6efdx14));if(_0x6efdx14[_0xb2e8[17]]){if(_0x6efdx14[_0xb2e8[17]][_0xb2e8[24]]=== 500){logger[_0xb2e8[17]](_0xb2e8[16],_0x6efdxf,_0x6efdx14[_0xb2e8[17]][_0xb2e8[25]]);return _0x6efdx12(_0x6efdx14[_0xb2e8[17]][_0xb2e8[25]])};logger[_0xb2e8[17]](_0xb2e8[16],_0x6efdxf,_0x6efdx14[_0xb2e8[17]][_0xb2e8[25]]);return _0x6efdx11(_0x6efdx14[_0xb2e8[17]][_0xb2e8[25]])}else {logger[_0xb2e8[20]](_0xb2e8[16],_0x6efdxf,_0xb2e8[19]);_0x6efdx11(_0x6efdx14[_0xb2e8[26]][_0xb2e8[25]])}})[_0xb2e8[18]](function(_0x6efdx13){logger[_0xb2e8[17]](_0xb2e8[16],_0x6efdxf,_0x6efdx13);_0x6efdx12(_0x6efdx13)})})}exports[_0xb2e8[29]]= function(_0x6efdx10){var _0x6efdx15=this;return  new Promise(function(_0x6efdx11,_0x6efdx12){return db[_0xb2e8[40]][_0xb2e8[39]]({raw:_0x6efdx10[_0xb2e8[30]]?(_0x6efdx10[_0xb2e8[30]][_0xb2e8[31]]=== undefined)?true:false:true,where:_0x6efdx10[_0xb2e8[30]]?_0x6efdx10[_0xb2e8[30]][_0xb2e8[32]]|| null:null,attributes:_0x6efdx10[_0xb2e8[30]]?_0x6efdx10[_0xb2e8[30]][_0xb2e8[33]]|| null:null,limit:_0x6efdx10[_0xb2e8[30]]?_0x6efdx10[_0xb2e8[30]][_0xb2e8[34]]|| null:null,include:_0x6efdx10[_0xb2e8[30]]?(_0x6efdx10[_0xb2e8[30]][_0xb2e8[35]]?_[_0xb2e8[38]](_0x6efdx10[_0xb2e8[30]][_0xb2e8[35]],function(_0x6efdx16){return {model:db[_0x6efdx16[_0xb2e8[36]]],as:_0x6efdx16[_0xb2e8[37]],attributes:_0x6efdx16[_0xb2e8[33]],include:_0x6efdx16[_0xb2e8[35]]?_[_0xb2e8[38]](_0x6efdx16[_0xb2e8[35]],function(_0x6efdx17){return {model:db[_0x6efdx17[_0xb2e8[36]]],as:_0x6efdx17[_0xb2e8[37]],attributes:_0x6efdx17[_0xb2e8[33]],include:_0x6efdx17[_0xb2e8[35]]?_[_0xb2e8[38]](_0x6efdx17[_0xb2e8[35]],function(_0x6efdx18){return {model:db[_0x6efdx18[_0xb2e8[36]]],as:_0x6efdx18[_0xb2e8[37]],attributes:_0x6efdx18[_0xb2e8[33]]}}):[]}}):[]}}):[]):[]})[_0xb2e8[27]](function(_0x6efdx14){logger[_0xb2e8[20]](_0xb2e8[29],_0x6efdx10);logger[_0xb2e8[23]](_0xb2e8[29],_0x6efdx10,JSON[_0xb2e8[22]](_0x6efdx14));_0x6efdx11(_0x6efdx14)})[_0xb2e8[18]](function(_0x6efdx13){logger[_0xb2e8[17]](_0xb2e8[29],_0x6efdx13[_0xb2e8[25]],_0x6efdx10);_0x6efdx12(_0x6efdx15[_0xb2e8[17]](500,_0x6efdx13[_0xb2e8[25]]))})})};exports[_0xb2e8[41]]= function(_0x6efdx10){var _0x6efdx15=this;return  new Promise(function(_0x6efdx11,_0x6efdx12){return db[_0xb2e8[40]][_0xb2e8[42]]({raw:_0x6efdx10[_0xb2e8[30]]?(_0x6efdx10[_0xb2e8[30]][_0xb2e8[31]]=== undefined)?true:false:true,where:_0x6efdx10[_0xb2e8[30]]?_0x6efdx10[_0xb2e8[30]][_0xb2e8[32]]|| null:null,attributes:_0x6efdx10[_0xb2e8[30]]?_0x6efdx10[_0xb2e8[30]][_0xb2e8[33]]|| null:null,include:_0x6efdx10[_0xb2e8[30]]?(_0x6efdx10[_0xb2e8[30]][_0xb2e8[35]]?_[_0xb2e8[38]](_0x6efdx10[_0xb2e8[30]][_0xb2e8[35]],function(_0x6efdx16){return {model:db[_0x6efdx16[_0xb2e8[36]]],as:_0x6efdx16[_0xb2e8[37]],attributes:_0x6efdx16[_0xb2e8[33]],include:_0x6efdx16[_0xb2e8[35]]?_[_0xb2e8[38]](_0x6efdx16[_0xb2e8[35]],function(_0x6efdx17){return {model:db[_0x6efdx17[_0xb2e8[36]]],as:_0x6efdx17[_0xb2e8[37]],attributes:_0x6efdx17[_0xb2e8[33]],include:_0x6efdx17[_0xb2e8[35]]?_[_0xb2e8[38]](_0x6efdx17[_0xb2e8[35]],function(_0x6efdx18){return {model:db[_0x6efdx18[_0xb2e8[36]]],as:_0x6efdx18[_0xb2e8[37]],attributes:_0x6efdx18[_0xb2e8[33]]}}):[]}}):[]}}):[]):[]})[_0xb2e8[27]](function(_0x6efdx14){logger[_0xb2e8[20]](_0xb2e8[41],_0x6efdx10);logger[_0xb2e8[23]](_0xb2e8[41],_0x6efdx10,JSON[_0xb2e8[22]](_0x6efdx14));_0x6efdx11(_0x6efdx14)})[_0xb2e8[18]](function(_0x6efdx13){logger[_0xb2e8[17]](_0xb2e8[41],_0x6efdx13[_0xb2e8[25]],_0x6efdx10);_0x6efdx12(_0x6efdx15[_0xb2e8[17]](500,_0x6efdx13[_0xb2e8[25]]))})})}