3f9c9f5586e4f6dd882fda31d388c67bac392b05
[motion-next.git] / server / services / ami / rpc / cmHopper.js
1 const a1102_0xe1a6=['getContactDialerIvr','rescheduleContact','priority','DestroyCmHopper','VoiceQueue','GetContactRecallMe','User','CampaignId','format','GetContactDialer','UpdateCmHopper','voicePause','unlockContact','GetCmHopperPreview','destroyContact','ASC','CmContact','scheduledat','db.CmHopper.UserId','MoveContactManagedDialer','YYYY-MM-DD\x20HH:mm:ss','../client','countReScheduled','Contact','updateContacts','getContactRecallMe','Request','name','campaign','ContactId','queue','DESC','sequelize','Agent','GetContactDialerIvr','ListId','moment','lte','getCmHopper','getContacts','VoiceQueueId'];(function(_0x3816e3,_0xe1a6b4){const _0x41e091=function(_0x2fef9e){while(--_0x2fef9e){_0x3816e3['push'](_0x3816e3['shift']());}};_0x41e091(++_0xe1a6b4);}(a1102_0xe1a6,0xf8));const a1102_0x41e0=function(_0x3816e3,_0xe1a6b4){_0x3816e3=_0x3816e3-0x0;let _0x41e091=a1102_0xe1a6[_0x3816e3];return _0x41e091;};const _0x55fe37=a1102_0x41e0;'use strict';const client=require(_0x55fe37('0x13')),moment=require(_0x55fe37('0x22')),{Op}=require(_0x55fe37('0x1e'));exports[_0x55fe37('0x25')]=function(_0x2fef9e,_0x1bdb68){return function(){const _0x53b96f=a1102_0x41e0;return client[_0x53b96f('0x18')]('GetCmHopper',{'options':{'where':{'VoiceQueueId':_0x2fef9e},'include':[{'model':_0x53b96f('0xe'),'as':_0x53b96f('0x15')}],'limit':_0x1bdb68,'raw':![]},'log':_0x53b96f('0x24')});};},exports[_0x55fe37('0x16')]=function(_0x64eb6,_0x31c3f1,_0x1de8d9){return function(){const _0x1131b7=a1102_0x41e0;return client[_0x1131b7('0x18')]('UpdateCmHopper',{'body':_0x64eb6,'options':{'where':{'VoiceQueueId':_0x31c3f1,'scheduledat':{[Op['lte']]:moment()['format'](_0x1131b7('0x12'))}},'limit':_0x1de8d9},'log':_0x1131b7('0x8')});};},exports[_0x55fe37('0x28')]=function(_0x530d20){return function(){const _0x32e629=a1102_0x41e0;return client[_0x32e629('0x18')](_0x32e629('0x8'),{'body':_0x530d20,'options':{'where':{'ContactId':_0x530d20['ContactId'],'ListId':_0x530d20[_0x32e629('0x21')],'VoiceQueueId':_0x530d20[_0x32e629('0x26')],'CampaignId':_0x530d20[_0x32e629('0x5')]}},'log':_0x32e629('0x28')});};},exports[_0x55fe37('0xc')]=function(_0x594ec0,_0x1d4033,_0x4ea5bd){return function(){const _0xf3209a=a1102_0x41e0;return client[_0xf3209a('0x18')](_0xf3209a('0x1'),{'options':{'where':{'VoiceQueueId':_0x594ec0,'ListId':_0x1d4033,'ContactId':_0x4ea5bd}},'log':_0xf3209a('0x1')});};},exports['getContactDialer']=function(_0x33086e,_0x433571,_0x3cbabd,_0x13afaa){return function(){const _0x199e6e=a1102_0x41e0;return client['Request'](_0x199e6e('0x7'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x33086e,'active':![],'scheduledat':{[Op[_0x199e6e('0x23')]]:moment()[_0x199e6e('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},[Op['or']]:[{'UserId':null},{'UserId':{[Op['in']]:_0x433571}}]},'order':[['priority',_0x199e6e('0x1d')],['scheduledat',_0x13afaa],['id',_0x199e6e('0xd')]],'raw':!![],'limit':_0x3cbabd},'log':_0x199e6e('0x7')});};},exports[_0x55fe37('0x27')]=function(_0x296b1f,_0x153f97,_0x28bdd1){return function(){const _0xa3e118=a1102_0x41e0;return client['Request'](_0xa3e118('0x7'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x296b1f,'active':![],'scheduledat':{[Op[_0xa3e118('0x23')]]:moment()[_0xa3e118('0x6')](_0xa3e118('0x12'))}},'include':[{'model':_0xa3e118('0xe'),'as':'Contact'}],'order':[[_0xa3e118('0x0'),'DESC'],[_0xa3e118('0xf'),_0x28bdd1],['id',_0xa3e118('0xd')]],'raw':!![],'limit':_0x153f97},'log':_0xa3e118('0x20')});};},exports['moveContactManagedDialer']=function(_0x86ee45,_0x4a0e1c){return function(){const _0x412a99=a1102_0x41e0;return _0x86ee45[_0x412a99('0x1a')]=_0x86ee45[_0x412a99('0x1c')],client[_0x412a99('0x18')](_0x412a99('0x11'),{'body':_0x86ee45,'options':{'where':{'ContactId':_0x86ee45[_0x412a99('0x1b')],'ListId':_0x86ee45[_0x412a99('0x21')],'VoiceQueueId':_0x86ee45[_0x412a99('0x26')],'CampaignId':_0x86ee45[_0x412a99('0x5')],'active':_0x4a0e1c?undefined:!![]}},'log':_0x412a99('0x11')});};},exports['countReScheduled']=function(_0x446af4){return function(){const _0xe27e4a=a1102_0x41e0;return client[_0xe27e4a('0x18')]('CountReScheduled',{'options':{'where':{'VoiceQueueId':_0x446af4['id']?_0x446af4['id']||null:null}},'log':_0xe27e4a('0x14')});};},exports['getContactPreview']=function(_0x1b7dcb){return function(){const _0x3c2363=a1102_0x41e0;return client['Request'](_0x3c2363('0xb'),{'options':{'where':{'id':_0x1b7dcb},'include':[{'model':_0x3c2363('0xe'),'as':'Contact'},{'model':'User','as':_0x3c2363('0x1f'),'attributes':['id','name']},{'model':_0x3c2363('0x2'),'as':'Queue','attributes':['id',_0x3c2363('0x19')]}],'raw':!![]},'log':_0x3c2363('0x24')});};},exports[_0x55fe37('0xa')]=function(_0x7712d6,_0x38f864,_0x4c0608){return function(){const _0x2e80a2=a1102_0x41e0;return client[_0x2e80a2('0x18')]('UpdateCmHopper',{'body':_0x7712d6,'options':{'where':{'id':_0x38f864},'limit':_0x4c0608},'log':_0x2e80a2('0x8')});};},exports[_0x55fe37('0x17')]=function(_0x49071d,_0x368e3f){return function(){const _0x18fa5a=a1102_0x41e0;return client[_0x18fa5a('0x18')](_0x18fa5a('0x3'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x49071d,'active':![],'recallme':!![],'scheduledat':{[Op[_0x18fa5a('0x23')]]:moment()[_0x18fa5a('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},'UserId':{[Op['in']]:_0x368e3f}},'order':[['priority','DESC'],['scheduledat',_0x18fa5a('0x1d')],['id',_0x18fa5a('0xd')]],'include':[{'model':_0x18fa5a('0xe'),'as':_0x18fa5a('0x15')},{'model':_0x18fa5a('0x4'),'as':_0x18fa5a('0x1f'),'attributes':['id','name',_0x18fa5a('0x9')]}],'group':_0x18fa5a('0x10'),'raw':!![]},'log':_0x18fa5a('0x7')});};};