Built motion from commit f25620e4.|2.6.30
[motion2.git] / server / services / ami / rpc / cmHopper.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x0c23=['resetActiveCalls','ResetActiveCalls','handlePreviewRecallNotifications','../client','moment','getContacts','Request','GetCmHopper','Contact','getCmHopper','updateContacts','UpdateCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','ListId','VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','priority','DESC','scheduledat','ASC','getContactDialerIvr','CmContact','moveContactManagedDialer','campaign','queue','MoveContactManagedDialer','ContactId','countReScheduled','getContactPreview','GetCmHopperPreview','Agent','name','VoiceQueue','unlockContact','getContactRecallMe','GetContactRecallMe','User','voicePause','db.CmHopper.UserId'];(function(_0x4b602f,_0x29d7ba){var _0x283a73=function(_0x30b9d6){while(--_0x30b9d6){_0x4b602f['push'](_0x4b602f['shift']());}};_0x283a73(++_0x29d7ba);}(_0x0c23,0x13e));var _0x30c2=function(_0xadf660,_0x59f1dd){_0xadf660=_0xadf660-0x0;var _0xab229b=_0x0c23[_0xadf660];return _0xab229b;};'use strict';var client=require(_0x30c2('0x0'));var moment=require(_0x30c2('0x1'));exports[_0x30c2('0x2')]=function(_0x461cbb,_0x14066d){return function(){return client[_0x30c2('0x3')](_0x30c2('0x4'),{'options':{'where':{'VoiceQueueId':_0x461cbb},'include':[{'model':'CmContact','as':_0x30c2('0x5')}],'limit':_0x14066d,'raw':![]},'log':_0x30c2('0x6')});};};exports[_0x30c2('0x7')]=function(_0x2c453c,_0x28630b,_0x166e7a){return function(){return client['Request'](_0x30c2('0x8'),{'body':_0x2c453c,'options':{'where':{'VoiceQueueId':_0x28630b,'scheduledat':{'$lte':moment()[_0x30c2('0x9')](_0x30c2('0xa'))}},'limit':_0x166e7a},'log':_0x30c2('0x8')});};};exports[_0x30c2('0xb')]=function(_0x508c12){return client[_0x30c2('0x3')](_0x30c2('0x8'),{'body':_0x508c12,'options':{'where':{'ContactId':_0x508c12['ContactId'],'ListId':_0x508c12[_0x30c2('0xc')],'VoiceQueueId':_0x508c12[_0x30c2('0xd')],'CampaignId':_0x508c12[_0x30c2('0xe')]}},'log':_0x30c2('0xb')});};exports[_0x30c2('0xf')]=function(_0x17eb67,_0x526ba0,_0x4983f4){return function(){return client['Request'](_0x30c2('0x10'),{'options':{'where':{'VoiceQueueId':_0x17eb67,'ListId':_0x526ba0,'ContactId':_0x4983f4}},'log':_0x30c2('0x10')});};};exports[_0x30c2('0x11')]=function(_0x26d859,_0x396194,_0x1b94e3,_0x2712dc){return client['Request'](_0x30c2('0x12'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x26d859,'active':![],'scheduledat':{'$lte':moment()[_0x30c2('0x9')]('YYYY-MM-DD\x20HH:mm:ss')},'$or':[{'UserId':null},{'UserId':{'$in':_0x396194}}]},'order':[[_0x30c2('0x13'),_0x30c2('0x14')],[_0x30c2('0x15'),_0x2712dc],['id',_0x30c2('0x16')]],'raw':!![],'limit':_0x1b94e3},'log':_0x30c2('0x12')});};exports[_0x30c2('0x17')]=function(_0x170f58,_0x271d10,_0x1d6318){return client[_0x30c2('0x3')](_0x30c2('0x12'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x170f58,'active':![],'scheduledat':{'$lte':moment()[_0x30c2('0x9')]('YYYY-MM-DD\x20HH:mm:ss')}},'include':[{'model':_0x30c2('0x18'),'as':'Contact'}],'order':[['priority',_0x30c2('0x14')],[_0x30c2('0x15'),_0x1d6318],['id',_0x30c2('0x16')]],'raw':!![],'limit':_0x271d10},'log':'GetContactDialerIvr'});};exports[_0x30c2('0x19')]=function(_0x1d0b52,_0x124140){_0x1d0b52[_0x30c2('0x1a')]=_0x1d0b52[_0x30c2('0x1b')];return client[_0x30c2('0x3')](_0x30c2('0x1c'),{'body':_0x1d0b52,'options':{'where':{'ContactId':_0x1d0b52[_0x30c2('0x1d')],'ListId':_0x1d0b52['ListId'],'VoiceQueueId':_0x1d0b52['VoiceQueueId'],'CampaignId':_0x1d0b52[_0x30c2('0xe')],'active':_0x124140?undefined:!![]}},'log':_0x30c2('0x1c')});};exports[_0x30c2('0x1e')]=function(_0x16f218){return client[_0x30c2('0x3')]('CountReScheduled',{'options':{'where':{'VoiceQueueId':_0x16f218['id']?_0x16f218['id']||null:null}},'log':_0x30c2('0x1e')});};exports[_0x30c2('0x1f')]=function(_0x1a11b1){return function(){return client['Request'](_0x30c2('0x20'),{'options':{'where':{'id':_0x1a11b1},'include':[{'model':_0x30c2('0x18'),'as':_0x30c2('0x5')},{'model':'User','as':_0x30c2('0x21'),'attributes':['id',_0x30c2('0x22')]},{'model':_0x30c2('0x23'),'as':'Queue','attributes':['id',_0x30c2('0x22')]}],'raw':!![]},'log':_0x30c2('0x6')});};};exports[_0x30c2('0x24')]=function(_0x382b1b,_0x5f3634,_0x4d00f3){return client[_0x30c2('0x3')]('UpdateCmHopper',{'body':_0x382b1b,'options':{'where':{'id':_0x5f3634},'limit':_0x4d00f3},'log':_0x30c2('0x8')});};exports[_0x30c2('0x25')]=function(_0x208b54,_0x5227bb){return function(){return client[_0x30c2('0x3')](_0x30c2('0x26'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x208b54,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()['format'](_0x30c2('0xa'))},'UserId':{'$in':_0x5227bb}},'order':[[_0x30c2('0x13'),_0x30c2('0x14')],[_0x30c2('0x15'),_0x30c2('0x14')],['id',_0x30c2('0x16')]],'include':[{'model':_0x30c2('0x18'),'as':_0x30c2('0x5')},{'model':_0x30c2('0x27'),'as':_0x30c2('0x21'),'attributes':['id',_0x30c2('0x22'),_0x30c2('0x28')]}],'group':_0x30c2('0x29'),'raw':!![]},'log':_0x30c2('0x12')});};};exports[_0x30c2('0x2a')]=function(_0x474b91,_0xbff615){return client['Request']('ResetActiveCalls',{'body':_0x474b91,'options':_0xbff615||{},'log':_0x30c2('0x2b')});};exports['handlePreviewRecallNotifications']=function(_0x59bdde,_0x3c5117,_0x2557f3){return function(){return client['Request']('CmHopperHandlePreviewRecallNotifications',{'body':{'where':{'voiceQueueIds':_0x59bdde,'interval':_0x3c5117,'availableAgentsIds':_0x2557f3}},'log':_0x30c2('0x2c')});};};