Built motion from commit 64440dd5.|2.6.29
[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 _0x0fcd=['resetActiveCalls','ResetActiveCalls','handlePreviewRecallNotifications','moment','getContacts','Request','GetCmHopper','Contact','getCmHopper','updateContacts','format','UpdateCmHopper','rescheduleContact','ContactId','CampaignId','destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','priority','DESC','scheduledat','YYYY-MM-DD\x20HH:mm:ss','CmContact','ASC','GetContactDialerIvr','moveContactManagedDialer','campaign','queue','MoveContactManagedDialer','countReScheduled','CountReScheduled','getContactPreview','User','Agent','name','VoiceQueue','Queue','unlockContact','getContactRecallMe','voicePause','db.CmHopper.UserId'];(function(_0x19b2b9,_0x2a47a3){var _0x189fb1=function(_0x3d7f8e){while(--_0x3d7f8e){_0x19b2b9['push'](_0x19b2b9['shift']());}};_0x189fb1(++_0x2a47a3);}(_0x0fcd,0x129));var _0xd0fc=function(_0x361896,_0x4132a9){_0x361896=_0x361896-0x0;var _0x4d25ff=_0x0fcd[_0x361896];return _0x4d25ff;};'use strict';var client=require('../client');var moment=require(_0xd0fc('0x0'));exports[_0xd0fc('0x1')]=function(_0x187811,_0x7d13c6){return function(){return client[_0xd0fc('0x2')](_0xd0fc('0x3'),{'options':{'where':{'VoiceQueueId':_0x187811},'include':[{'model':'CmContact','as':_0xd0fc('0x4')}],'limit':_0x7d13c6,'raw':![]},'log':_0xd0fc('0x5')});};};exports[_0xd0fc('0x6')]=function(_0x34a8d1,_0x5507ff,_0x32b1c5){return function(){return client['Request']('UpdateCmHopper',{'body':_0x34a8d1,'options':{'where':{'VoiceQueueId':_0x5507ff,'scheduledat':{'$lte':moment()[_0xd0fc('0x7')]('YYYY-MM-DD\x20HH:mm:ss')}},'limit':_0x32b1c5},'log':_0xd0fc('0x8')});};};exports[_0xd0fc('0x9')]=function(_0x41dfd8){return client['Request'](_0xd0fc('0x8'),{'body':_0x41dfd8,'options':{'where':{'ContactId':_0x41dfd8[_0xd0fc('0xa')],'ListId':_0x41dfd8['ListId'],'VoiceQueueId':_0x41dfd8['VoiceQueueId'],'CampaignId':_0x41dfd8[_0xd0fc('0xb')]}},'log':_0xd0fc('0x9')});};exports[_0xd0fc('0xc')]=function(_0x4c2177,_0x342fbb,_0x4e296a){return function(){return client[_0xd0fc('0x2')](_0xd0fc('0xd'),{'options':{'where':{'VoiceQueueId':_0x4c2177,'ListId':_0x342fbb,'ContactId':_0x4e296a}},'log':'DestroyCmHopper'});};};exports[_0xd0fc('0xe')]=function(_0x44958b,_0x2f1c7a,_0x4e7feb,_0x2f5405){return client[_0xd0fc('0x2')](_0xd0fc('0xf'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x44958b,'active':![],'scheduledat':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'$or':[{'UserId':null},{'UserId':{'$in':_0x2f1c7a}}]},'order':[[_0xd0fc('0x10'),_0xd0fc('0x11')],[_0xd0fc('0x12'),_0x2f5405],['id','ASC']],'raw':!![],'limit':_0x4e7feb},'log':'GetContactDialer'});};exports['getContactDialerIvr']=function(_0x53e28d,_0x1b7752,_0x4ced92){return client[_0xd0fc('0x2')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x53e28d,'active':![],'scheduledat':{'$lte':moment()[_0xd0fc('0x7')](_0xd0fc('0x13'))}},'include':[{'model':_0xd0fc('0x14'),'as':'Contact'}],'order':[['priority',_0xd0fc('0x11')],['scheduledat',_0x4ced92],['id',_0xd0fc('0x15')]],'raw':!![],'limit':_0x1b7752},'log':_0xd0fc('0x16')});};exports[_0xd0fc('0x17')]=function(_0xb5c2fc,_0x43d092){_0xb5c2fc[_0xd0fc('0x18')]=_0xb5c2fc[_0xd0fc('0x19')];return client['Request'](_0xd0fc('0x1a'),{'body':_0xb5c2fc,'options':{'where':{'ContactId':_0xb5c2fc[_0xd0fc('0xa')],'ListId':_0xb5c2fc['ListId'],'VoiceQueueId':_0xb5c2fc['VoiceQueueId'],'CampaignId':_0xb5c2fc[_0xd0fc('0xb')],'active':_0x43d092?undefined:!![]}},'log':_0xd0fc('0x1a')});};exports[_0xd0fc('0x1b')]=function(_0x2633f0){return client[_0xd0fc('0x2')](_0xd0fc('0x1c'),{'options':{'where':{'VoiceQueueId':_0x2633f0['id']?_0x2633f0['id']||null:null}},'log':_0xd0fc('0x1b')});};exports[_0xd0fc('0x1d')]=function(_0x11e6cb){return function(){return client[_0xd0fc('0x2')]('GetCmHopperPreview',{'options':{'where':{'id':_0x11e6cb},'include':[{'model':_0xd0fc('0x14'),'as':_0xd0fc('0x4')},{'model':_0xd0fc('0x1e'),'as':_0xd0fc('0x1f'),'attributes':['id',_0xd0fc('0x20')]},{'model':_0xd0fc('0x21'),'as':_0xd0fc('0x22'),'attributes':['id',_0xd0fc('0x20')]}],'raw':!![]},'log':_0xd0fc('0x5')});};};exports[_0xd0fc('0x23')]=function(_0xda57f0,_0x161311,_0x111700){return client[_0xd0fc('0x2')](_0xd0fc('0x8'),{'body':_0xda57f0,'options':{'where':{'id':_0x161311},'limit':_0x111700},'log':_0xd0fc('0x8')});};exports[_0xd0fc('0x24')]=function(_0x31f367,_0x1806f1){return function(){return client[_0xd0fc('0x2')]('GetContactRecallMe',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x31f367,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0xd0fc('0x7')](_0xd0fc('0x13'))},'UserId':{'$in':_0x1806f1}},'order':[[_0xd0fc('0x10'),_0xd0fc('0x11')],[_0xd0fc('0x12'),_0xd0fc('0x11')],['id',_0xd0fc('0x15')]],'include':[{'model':'CmContact','as':_0xd0fc('0x4')},{'model':_0xd0fc('0x1e'),'as':'Agent','attributes':['id','name',_0xd0fc('0x25')]}],'group':_0xd0fc('0x26'),'raw':!![]},'log':_0xd0fc('0xf')});};};exports[_0xd0fc('0x27')]=function(_0x353319,_0x5686aa){return client[_0xd0fc('0x2')](_0xd0fc('0x28'),{'body':_0x353319,'options':_0x5686aa||{},'log':_0xd0fc('0x28')});};exports[_0xd0fc('0x29')]=function(_0x3283ab,_0x27d9bc,_0x1aa8d5){return function(){return client[_0xd0fc('0x2')]('CmHopperHandlePreviewRecallNotifications',{'body':{'where':{'voiceQueueIds':_0x3283ab,'interval':_0x27d9bc,'availableAgentsIds':_0x1aa8d5}},'log':_0xd0fc('0x29')});};};