ea93bd63dcee6aa2e09f1e397ac9d23232840a96
[motion.git] / server / config / agi / lib / rpc / index.js
1 var _0xa8be=["\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","\x75\x74\x69\x6C","\x53\x71\x75\x61\x72\x65\x50\x72\x6F\x6A\x65\x63\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x56\x61\x72\x69\x61\x62\x6C\x65","\x53\x71\x75\x61\x72\x65\x4F\x64\x62\x63","\x55\x73\x65\x72","\x54\x72\x75\x6E\x6B","\x53\x6F\x75\x6E\x64","\x49\x6E\x74\x65\x72\x76\x61\x6C","\x52\x65\x70\x6F\x72\x74\x53\x71\x75\x61\x72\x65\x44\x65\x74\x61\x69\x6C","\x52\x65\x70\x6F\x72\x74\x53\x71\x75\x61\x72\x65","\x53\x71\x75\x61\x72\x65\x52\x65\x63\x6F\x72\x64\x69\x6E\x67","\x4D\x61\x69\x6C\x53\x65\x72\x76\x65\x72\x4F\x75\x74","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74","\x54\x65\x6D\x70\x6C\x61\x74\x65","\x53\x6D\x73\x41\x63\x63\x6F\x75\x6E\x74","\x46\x61\x78\x41\x63\x63\x6F\x75\x6E\x74","\x43\x6F\x6E\x74\x61\x63\x74","\x65\x78\x70\x6F\x72\x74\x73","\x70\x72\x6F\x64\x75\x63\x74\x69\x6F\x6E","\x66\x69\x6E\x64","\x6E\x61\x6D\x65","\x64\x73\x6E","\x73\x61\x76\x65\x5F\x6E\x61\x6D\x65","\x73\x75\x62\x69\x6E\x74\x65\x72\x76\x61\x6C\x73","\x73\x63\x6F\x70\x65","\x63\x72\x65\x61\x74\x65","\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","\x61\x72\x67\x5F\x31","\x61\x72\x67\x5F\x32","","\x6D\x65\x72\x67\x65","\x75\x70\x64\x61\x74\x65","\x6C\x6F\x63\x61\x6C\x73\x74\x61\x74\x69\x6F\x6E\x69\x64","\x69\x64","\x61\x64\x64\x72\x65\x73\x73","\x75\x73\x65\x72\x6E\x61\x6D\x65","\x63\x72\x65\x61\x74\x65\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x73\x65\x6E\x64","\x72\x65\x73\x6F\x6C\x76\x65","\x63\x72\x65\x61\x74\x65\x46\x61\x78\x4D\x65\x73\x73\x61\x67\x65","\x73\x75\x62\x6A\x65\x63\x74","\x68\x74\x6D\x6C","\x74\x79\x70\x65","\x70\x68\x6F\x6E\x65","\x63\x72\x65\x61\x74\x65\x53\x6D\x73\x4D\x65\x73\x73\x61\x67\x65","\x6D\x69\x6E\x75\x74\x65\x73","\x61\x64\x64"];_0xa8be[0];var BPromise=require(_0xa8be[1]);var moment=require(_0xa8be[2]);var _=require(_0xa8be[3]);var util=require(_0xa8be[4]);var SquareProject=require(_0xa8be[6])[_0xa8be[5]];var VoiceQueue=require(_0xa8be[6])[_0xa8be[7]];var Variable=require(_0xa8be[6])[_0xa8be[8]];var SquareOdbc=require(_0xa8be[6])[_0xa8be[9]];var User=require(_0xa8be[6])[_0xa8be[10]];var Trunk=require(_0xa8be[6])[_0xa8be[11]];var Sound=require(_0xa8be[6])[_0xa8be[12]];var Interval=require(_0xa8be[6])[_0xa8be[13]];var ReportSquareDetail=require(_0xa8be[6])[_0xa8be[14]];var ReportSquare=require(_0xa8be[6])[_0xa8be[15]];var SquareRecording=require(_0xa8be[6])[_0xa8be[16]];var MailServerOut=require(_0xa8be[6])[_0xa8be[17]];var MailAccount=require(_0xa8be[6])[_0xa8be[18]];var Template=require(_0xa8be[6])[_0xa8be[19]];var SmsAccount=require(_0xa8be[6])[_0xa8be[20]];var FaxAccount=require(_0xa8be[6])[_0xa8be[21]];var Contact=require(_0xa8be[6])[_0xa8be[22]];module[_0xa8be[23]]= function(){return {getSquareProject:function(_0xa967x16){return SquareProject[_0xa8be[25]]({where:{name:_0xa967x16},attributes:[_0xa8be[24]]})},getSquareProjectById:function(_0xa967x17){return SquareProject[_0xa8be[25]]({where:{id:_0xa967x17},attributes:[_0xa8be[26]]})},getVoiceQueueById:function(_0xa967x17){return VoiceQueue[_0xa8be[25]]({where:{id:_0xa967x17},attributes:[_0xa8be[26]]})},getVariableById:function(_0xa967x17){return Variable[_0xa8be[25]]({where:{id:_0xa967x17},attributes:[_0xa8be[26]]})},getSquareOdbcById:function(_0xa967x17){return SquareOdbc[_0xa8be[25]]({where:{id:_0xa967x17},attributes:[_0xa8be[27]]})},getUserById:function(_0xa967x17){return User[_0xa8be[25]]({where:{id:_0xa967x17},attributes:[_0xa8be[26]],raw:true})},getTrunkById:function(_0xa967x17){return Trunk[_0xa8be[25]]({where:{id:_0xa967x17},attributes:[_0xa8be[26]],raw:true})},getSoundById:function(_0xa967x17){return Sound[_0xa8be[25]]({where:{id:_0xa967x17},attributes:[_0xa8be[28]],raw:true})},getIntervalById:function(_0xa967x17){return Interval[_0xa8be[30]](_0xa8be[29])[_0xa8be[25]]({where:{id:_0xa967x17}})},createSquareDetailsReport:function(_0xa967x18){return ReportSquareDetail[_0xa8be[31]](_0xa967x18,{raw:true})},createSquareReport:function(_0xa967x18){return ReportSquare[_0xa8be[31]](_[_0xa8be[37]](_0xa967x18,{joinAt:moment()[_0xa8be[33]](_0xa8be[32]),project_name:_0xa967x18[_0xa8be[34]],prev_project_name:_0xa967x18[_0xa8be[35]]|| _0xa8be[36],is_subproject:_0xa967x18[_0xa8be[35]]?true:false}),{raw:true})},updateSquareReport:function(_0xa967x19,_0xa967x1a){return ReportSquare[_0xa8be[38]]({leaveAt:moment()[_0xa8be[33]](_0xa8be[32])},{where:{uniqueid:_0xa967x19,project_name:_0xa967x1a,leaveAt:null},raw:true,individualHooks:true})},createSquareRecording:function(_0xa967x18){return SquareRecording[_0xa8be[31]](_0xa967x18,{raw:true})},getFaxAccountNumberById:function(_0xa967x17){return FaxAccount[_0xa8be[25]]({where:{id:_0xa967x17},attributes:[_0xa8be[39]]})},getMailServerOutById:function(_0xa967x17){return MailAccount[_0xa8be[25]]({attributes:[_0xa8be[40],_0xa8be[41]],include:[{model:MailServerOut,attributes:[_0xa8be[40],_0xa8be[42]],where:{id:_0xa967x17}}]})},createMailMessage:function(_0xa967x18){process[_0xa8be[44]]({message:_0xa8be[43],doc:_0xa967x18});return BPromise[_0xa8be[45]]()},createFaxMessage:function(_0xa967x18){process[_0xa8be[44]]({message:_0xa8be[46],doc:_0xa967x18});return BPromise[_0xa8be[45]]()},getTemplateById:function(_0xa967x17){return Template[_0xa8be[25]]({where:{id:_0xa967x17},attributes:[_0xa8be[47],_0xa8be[48]]})},getSmsAccountById:function(_0xa967x17){return SmsAccount[_0xa8be[25]]({where:{id:_0xa967x17},attributes:[_0xa8be[49],_0xa8be[50]]})},createSmsMessage:function(_0xa967x18){process[_0xa8be[44]]({message:_0xa8be[51],doc:_0xa967x18});return BPromise[_0xa8be[45]]()},callbackContact:function(_0xa967x1b,_0xa967x16,_0xa967x1c,_0xa967x1d,_0xa967x1e,_0xa967x1f){return Contact[_0xa8be[31]]({ListId:_0xa967x1b,firstName:_0xa967x16,lastName:_0xa967x1c,phone:_0xa967x1d,description:_0xa967x1e,planningtime:moment()[_0xa8be[53]](_0xa967x1f|| 5,_0xa8be[52])[_0xa8be[33]](_0xa8be[32])},{raw:true})}}}