a64f4899f4704110076b079f18578b07105cb719
[motion-next.git] / server / services / ami / rpc / cmHopper.js
1 const a1102_0x3a7e=['CmContact','unlockContact','Agent','format','name','updateContacts','scheduledat','Queue','MoveContactManagedDialer','queue','ListId','GetContactRecallMe','GetContactDialerIvr','User','getCmHopper','UpdateCmHopper','DESC','getContactRecallMe','moment','CampaignId','ContactId','VoiceQueueId','GetCmHopperPreview','priority','Request','getContactPreview','rescheduleContact','Contact','db.CmHopper.UserId','getContactDialer','destroyContact','CountReScheduled','YYYY-MM-DD\x20HH:mm:ss','voicePause','getContactDialerIvr','DestroyCmHopper','VoiceQueue','lte','ASC','countReScheduled','campaign','moveContactManagedDialer','GetContactDialer','../client','sequelize'];(function(_0x2e012e,_0x3a7e03){const _0x17ab61=function(_0x2ab248){while(--_0x2ab248){_0x2e012e['push'](_0x2e012e['shift']());}};_0x17ab61(++_0x3a7e03);}(a1102_0x3a7e,0x10c));const a1102_0x17ab=function(_0x2e012e,_0x3a7e03){_0x2e012e=_0x2e012e-0x0;let _0x17ab61=a1102_0x3a7e[_0x2e012e];return _0x17ab61;};const _0x4308c2=a1102_0x17ab;'use strict';const client=require(_0x4308c2('0x0')),moment=require(_0x4308c2('0x14')),{Op}=require(_0x4308c2('0x1'));exports['getContacts']=function(_0x2ab248,_0x3bc250){return function(){const _0x21ba21=a1102_0x17ab;return client[_0x21ba21('0x1a')]('GetCmHopper',{'options':{'where':{'VoiceQueueId':_0x2ab248},'include':[{'model':'CmContact','as':'Contact'}],'limit':_0x3bc250,'raw':![]},'log':_0x21ba21('0x10')});};},exports[_0x4308c2('0x7')]=function(_0x5c5cca,_0x1eaaaf,_0x861caa){return function(){const _0x2503b0=a1102_0x17ab;return client[_0x2503b0('0x1a')]('UpdateCmHopper',{'body':_0x5c5cca,'options':{'where':{'VoiceQueueId':_0x1eaaaf,'scheduledat':{[Op[_0x2503b0('0x27')]]:moment()[_0x2503b0('0x5')](_0x2503b0('0x22'))}},'limit':_0x861caa},'log':_0x2503b0('0x11')});};},exports[_0x4308c2('0x1c')]=function(_0x5f26d1){return function(){const _0x3ecb4b=a1102_0x17ab;return client[_0x3ecb4b('0x1a')](_0x3ecb4b('0x11'),{'body':_0x5f26d1,'options':{'where':{'ContactId':_0x5f26d1[_0x3ecb4b('0x16')],'ListId':_0x5f26d1[_0x3ecb4b('0xc')],'VoiceQueueId':_0x5f26d1['VoiceQueueId'],'CampaignId':_0x5f26d1[_0x3ecb4b('0x15')]}},'log':_0x3ecb4b('0x1c')});};},exports[_0x4308c2('0x20')]=function(_0x464836,_0x1f21db,_0x44fe69){return function(){const _0x4571bb=a1102_0x17ab;return client[_0x4571bb('0x1a')](_0x4571bb('0x25'),{'options':{'where':{'VoiceQueueId':_0x464836,'ListId':_0x1f21db,'ContactId':_0x44fe69}},'log':'DestroyCmHopper'});};},exports[_0x4308c2('0x1f')]=function(_0x281b55,_0x1a41a2,_0x27451b,_0x41aff6){return function(){const _0x5a4bad=a1102_0x17ab;return client[_0x5a4bad('0x1a')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x281b55,'active':![],'scheduledat':{[Op['lte']]:moment()[_0x5a4bad('0x5')](_0x5a4bad('0x22'))},[Op['or']]:[{'UserId':null},{'UserId':{[Op['in']]:_0x1a41a2}}]},'order':[[_0x5a4bad('0x19'),_0x5a4bad('0x12')],[_0x5a4bad('0x8'),_0x41aff6],['id',_0x5a4bad('0x28')]],'raw':!![],'limit':_0x27451b},'log':'GetContactDialer'});};},exports[_0x4308c2('0x24')]=function(_0x1d6d8d,_0x4ca943,_0xab1c24){return function(){const _0xc12955=a1102_0x17ab;return client['Request'](_0xc12955('0x2c'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x1d6d8d,'active':![],'scheduledat':{[Op['lte']]:moment()[_0xc12955('0x5')](_0xc12955('0x22'))}},'include':[{'model':_0xc12955('0x2'),'as':'Contact'}],'order':[[_0xc12955('0x19'),_0xc12955('0x12')],[_0xc12955('0x8'),_0xab1c24],['id',_0xc12955('0x28')]],'raw':!![],'limit':_0x4ca943},'log':_0xc12955('0xe')});};},exports[_0x4308c2('0x2b')]=function(_0x45213f,_0x47411b){return function(){const _0x4922bd=a1102_0x17ab;return _0x45213f[_0x4922bd('0x2a')]=_0x45213f[_0x4922bd('0xb')],client['Request'](_0x4922bd('0xa'),{'body':_0x45213f,'options':{'where':{'ContactId':_0x45213f[_0x4922bd('0x16')],'ListId':_0x45213f[_0x4922bd('0xc')],'VoiceQueueId':_0x45213f[_0x4922bd('0x17')],'CampaignId':_0x45213f[_0x4922bd('0x15')],'active':_0x47411b?undefined:!![]}},'log':_0x4922bd('0xa')});};},exports[_0x4308c2('0x29')]=function(_0x207f71){return function(){const _0x591069=a1102_0x17ab;return client[_0x591069('0x1a')](_0x591069('0x21'),{'options':{'where':{'VoiceQueueId':_0x207f71['id']?_0x207f71['id']||null:null}},'log':'countReScheduled'});};},exports[_0x4308c2('0x1b')]=function(_0x7f152a){return function(){const _0x240fd6=a1102_0x17ab;return client[_0x240fd6('0x1a')](_0x240fd6('0x18'),{'options':{'where':{'id':_0x7f152a},'include':[{'model':_0x240fd6('0x2'),'as':_0x240fd6('0x1d')},{'model':_0x240fd6('0xf'),'as':_0x240fd6('0x4'),'attributes':['id',_0x240fd6('0x6')]},{'model':_0x240fd6('0x26'),'as':_0x240fd6('0x9'),'attributes':['id',_0x240fd6('0x6')]}],'raw':!![]},'log':'getCmHopper'});};},exports[_0x4308c2('0x3')]=function(_0x2c5a4b,_0x31d5f5,_0x147a51){return function(){const _0xdfc818=a1102_0x17ab;return client[_0xdfc818('0x1a')](_0xdfc818('0x11'),{'body':_0x2c5a4b,'options':{'where':{'id':_0x31d5f5},'limit':_0x147a51},'log':_0xdfc818('0x11')});};},exports[_0x4308c2('0x13')]=function(_0x4312d1,_0x5f080b){return function(){const _0x2c2095=a1102_0x17ab;return client[_0x2c2095('0x1a')](_0x2c2095('0xd'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x4312d1,'active':![],'recallme':!![],'scheduledat':{[Op[_0x2c2095('0x27')]]:moment()['format'](_0x2c2095('0x22'))},'UserId':{[Op['in']]:_0x5f080b}},'order':[['priority','DESC'],['scheduledat',_0x2c2095('0x12')],['id',_0x2c2095('0x28')]],'include':[{'model':'CmContact','as':_0x2c2095('0x1d')},{'model':_0x2c2095('0xf'),'as':_0x2c2095('0x4'),'attributes':['id','name',_0x2c2095('0x23')]}],'group':_0x2c2095('0x1e'),'raw':!![]},'log':_0x2c2095('0x2c')});};};