Built motion from commit 67e5df37.|2.0.60
[motion2.git] / server / api / voiceChanSpy / voiceChanSpy.model.js
1 var _0xc2ec=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x62\x6C\x75\x65\x62\x69\x72\x64","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72","\x2E\x2F\x76\x6F\x69\x63\x65\x43\x68\x61\x6E\x53\x70\x79\x2E\x61\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x66\x72\x6F\x6D\x2D\x73\x69\x70","\x73\x79\x73\x74\x65\x6D","\x25\x73\x25\x73","\x70\x72\x65\x66\x69\x78","\x66\x6F\x72\x6D\x61\x74","\x69\x64","\x53\x65\x74","\x43\x44\x52\x28\x74\x79\x70\x65\x29\x3D\x25\x73","\x63\x68\x61\x6E\x73\x70\x79","\x6D\x65\x72\x67\x65","\x70\x75\x73\x68","\x72\x65\x63\x6F\x72\x64","\x4D\x69\x78\x4D\x6F\x6E\x69\x74\x6F\x72","\x24\x7B\x55\x4E\x49\x51\x55\x45\x49\x44\x7D\x2E\x25\x73\x2C\x61\x62","\x72\x65\x63\x6F\x72\x64\x69\x6E\x67\x46\x6F\x72\x6D\x61\x74","\x61\x75\x74\x68","\x41\x75\x74\x68\x65\x6E\x74\x69\x63\x61\x74\x65","\x70\x61\x73\x73\x77\x6F\x72\x64","\x43\x68\x61\x6E\x53\x70\x79","\x53\x49\x50\x2F\x25\x73\x2C\x25\x73","\x6E\x61\x6D\x65","\x6F\x70\x74\x69\x6F\x6E\x73","","\x6A\x6F\x69\x6E","\x53\x74\x6F\x70\x4D\x69\x78\x4D\x6F\x6E\x69\x74\x6F\x72","\x6C\x65\x6E\x67\x74\x68","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x63\x6F\x6E\x63\x61\x74","\x63\x61\x74\x63\x68","\x74\x68\x65\x6E","\x61\x67\x65\x6E\x74","\x66\x69\x6E\x64\x41\x6C\x6C","\x55\x73\x65\x72","\x65\x78\x70\x6F\x72\x74\x73","\x6D\x6F\x64\x65\x6C\x73","\x56\x6F\x69\x63\x65\x43\x68\x61\x6E\x53\x70\x79","\x76\x6F\x69\x63\x65\x5F\x63\x68\x61\x6E\x73\x70\x79","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x56\x6F\x69\x63\x65\x45\x78\x74\x65\x6E\x73\x69\x6F\x6E","\x64\x65\x73\x74\x72\x6F\x79","\x64\x65\x66\x69\x6E\x65"];_0xc2ec[0];var _=require(_0xc2ec[1]);var util=require(_0xc2ec[2]);var BPromise=require(_0xc2ec[3]);var logger=require(_0xc2ec[5])(_0xc2ec[4]);var attributes=require(_0xc2ec[6]);var getUserApplications=function(_0x8938x7,_0x8938x8,_0x8938x9){var _0x8938xa=1;var _0x8938xb=[];var _0x8938xc={context:_0xc2ec[7],type:_0xc2ec[8],isApp:false};var _0x8938xd={exten:util[_0xc2ec[11]](_0xc2ec[9],_0x8938x7[_0xc2ec[10]],_0x8938x9),ChanSpyId:_0x8938x7[_0xc2ec[12]],UserId:_0x8938x8[_0xc2ec[12]]};_0x8938xb[_0xc2ec[17]](_[_0xc2ec[16]]({app:_0xc2ec[13],appdata:util[_0xc2ec[11]](_0xc2ec[14],_0xc2ec[15]),priority:_0x8938xa++},_0x8938xc,_0x8938xd));if(_0x8938x7[_0xc2ec[18]]){_0x8938xb[_0xc2ec[17]](_[_0xc2ec[16]]({app:_0xc2ec[19],appdata:util[_0xc2ec[11]](_0xc2ec[20],_0x8938x7[_0xc2ec[21]]),priority:_0x8938xa++},_0x8938xc,_0x8938xd))};if(_0x8938x7[_0xc2ec[22]]){_0x8938xb[_0xc2ec[17]](_[_0xc2ec[16]]({app:_0xc2ec[23],appdata:_0x8938x7[_0xc2ec[24]],priority:_0x8938xa++},_0x8938xc,_0x8938xd))};_0x8938xb[_0xc2ec[17]](_[_0xc2ec[16]]({app:_0xc2ec[25],appdata:util[_0xc2ec[11]](_0xc2ec[26],_0x8938x8[_0xc2ec[27]],_0x8938x7[_0xc2ec[28]]?_0x8938x7[_0xc2ec[28]][_0xc2ec[30]](_0xc2ec[29]):_0xc2ec[29]),priority:_0x8938xa++},_0x8938xc,_0x8938xd));if(_0x8938x7[_0xc2ec[18]]){_0x8938xb[_0xc2ec[17]](_[_0xc2ec[16]]({app:_0xc2ec[31],priority:_0x8938xa++},_0x8938xc,_0x8938xd))};return _0x8938xb};var getChanSpyApplications=function(_0x8938x7,_0x8938xf){var _0x8938xb=[];for(var _0x8938x10=0,_0x8938xa=1;_0x8938x10< _0x8938xf[_0xc2ec[32]];_0x8938x10++,_0x8938xa= 1){var _0x8938x11=getUserApplications(_0x8938x7,_0x8938xf[_0x8938x10],_0x8938xf[_0x8938x10][_0xc2ec[33]]);var _0x8938x12=getUserApplications(_0x8938x7,_0x8938xf[_0x8938x10],_0x8938xf[_0x8938x10][_0xc2ec[27]]);_0x8938xb= _0x8938xb[_0xc2ec[34]](_0x8938x11,_0x8938x12)};return _0x8938xb};var getChanSpyPromise=function(_0x8938x14,_0x8938x7){return  new BPromise(function(_0x8938x15,_0x8938x16){return _0x8938x14[_0xc2ec[39]][_0xc2ec[38]]({attributes:[_0xc2ec[12],_0xc2ec[27],_0xc2ec[33]],where:{role:_0xc2ec[37],chanspy:true},raw:true})[_0xc2ec[36]](function(_0x8938x18){if(_0x8938x18){return _0x8938x15(getChanSpyApplications(_0x8938x7,_0x8938x18))};return _0x8938x15([])})[_0xc2ec[35]](function(_0x8938x17){_0x8938x16(_0x8938x17)})})};module[_0xc2ec[40]]= function(_0x8938x19,_0x8938x1a){var _0x8938x14=_0x8938x19[_0xc2ec[41]];return _0x8938x19[_0xc2ec[47]](_0xc2ec[42],attributes,{tableName:_0xc2ec[43],paranoid:false,indexes:[],timestamps:true,hooks:{afterCreate:function(_0x8938x1b,_0x8938x1c,_0x8938x1d){return getChanSpyPromise(_0x8938x14,_0x8938x1b)[_0xc2ec[36]](function(_0x8938xb){if(_0x8938xb&& _0x8938xb[_0xc2ec[32]]){return _0x8938x14[_0xc2ec[45]][_0xc2ec[44]](_0x8938xb)}})[_0xc2ec[36]](function(){_0x8938x1d()})[_0xc2ec[35]](function(_0x8938x17){_0x8938x1d(_0x8938x17)})},afterUpdate:function(_0x8938x1b,_0x8938x1c,_0x8938x1d){return _0x8938x14[_0xc2ec[45]][_0xc2ec[46]]({where:{ChanSpyId:_0x8938x1b[_0xc2ec[12]]}})[_0xc2ec[36]](function(){return getChanSpyPromise(_0x8938x14,_0x8938x1b)})[_0xc2ec[36]](function(_0x8938xb){if(_0x8938xb&& _0x8938xb[_0xc2ec[32]]){return _0x8938x14[_0xc2ec[45]][_0xc2ec[44]](_0x8938xb)}})[_0xc2ec[36]](function(){_0x8938x1d()})[_0xc2ec[35]](function(_0x8938x17){_0x8938x1d(_0x8938x17)})},afterDestroy:function(_0x8938x1b,_0x8938x1c,_0x8938x1d){return _0x8938x14[_0xc2ec[45]][_0xc2ec[46]]({where:{ChanSpyId:_0x8938x1b[_0xc2ec[12]]}})[_0xc2ec[36]](function(){_0x8938x1d()})[_0xc2ec[35]](function(_0x8938x17){_0x8938x1d(_0x8938x17)})}}})}