Built motion from commit d9028345.|2.5.43
[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 _0x2f0a=['ListId','VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','getContactDialer','DESC','scheduledat','ASC','GetContactDialer','CmContact','Contact','priority','GetContactDialerIvr','moveContactManagedDialer','MoveContactManagedDialer','countReScheduled','CountReScheduled','getContactPreview','User','name','VoiceQueue','Queue','getContactRecallMe','GetContactRecallMe','db.CmHopper.UserId','resetActiveCalls','ResetActiveCalls','handlePreviewRecallNotifications','../client','moment','lodash','getContacts','GetCmHopper','getCmHopper','updateContacts','UpdateCmHopper','format','rescheduleContact','Request','ContactId'];(function(_0x1290c5,_0x39106e){var _0x74284c=function(_0x326bd8){while(--_0x326bd8){_0x1290c5['push'](_0x1290c5['shift']());}};_0x74284c(++_0x39106e);}(_0x2f0a,0x98));var _0xa2f0=function(_0xb3a824,_0x2ee7a8){_0xb3a824=_0xb3a824-0x0;var _0x542804=_0x2f0a[_0xb3a824];return _0x542804;};'use strict';var client=require(_0xa2f0('0x0'));var moment=require(_0xa2f0('0x1'));var _=require(_0xa2f0('0x2'));exports[_0xa2f0('0x3')]=function(_0x58bee4,_0x5d8763){return function(){return client['Request'](_0xa2f0('0x4'),{'options':{'where':{'VoiceQueueId':_0x58bee4},'include':[{'model':'CmContact','as':'Contact'}],'limit':_0x5d8763,'raw':![]},'log':_0xa2f0('0x5')});};};exports[_0xa2f0('0x6')]=function(_0x30e17f,_0x3ed2f8,_0x9b3ea0){return function(){return client['Request'](_0xa2f0('0x7'),{'body':_0x30e17f,'options':{'where':{'VoiceQueueId':_0x3ed2f8,'scheduledat':{'$lte':moment()[_0xa2f0('0x8')]('YYYY-MM-DD\x20HH:mm:ss')}},'limit':_0x9b3ea0},'log':_0xa2f0('0x7')});};};exports[_0xa2f0('0x9')]=function(_0x14fe82){return function(){return client[_0xa2f0('0xa')](_0xa2f0('0x7'),{'body':_0x14fe82,'options':{'where':{'ContactId':_0x14fe82[_0xa2f0('0xb')],'ListId':_0x14fe82[_0xa2f0('0xc')],'VoiceQueueId':_0x14fe82[_0xa2f0('0xd')],'CampaignId':_0x14fe82[_0xa2f0('0xe')]}},'log':_0xa2f0('0x9')});};};exports[_0xa2f0('0xf')]=function(_0x26c6b3,_0x325a0e,_0x3bee3f){return function(){return client[_0xa2f0('0xa')](_0xa2f0('0x10'),{'options':{'where':{'VoiceQueueId':_0x26c6b3,'ListId':_0x325a0e,'ContactId':_0x3bee3f}},'log':_0xa2f0('0x10')});};};exports[_0xa2f0('0x11')]=function(_0x5caee1,_0x56fb00,_0x4411db,_0x320aad){return function(){return client[_0xa2f0('0xa')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x5caee1,'active':![],'scheduledat':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'$or':[{'UserId':null},{'UserId':{'$in':_0x56fb00}}]},'order':[['priority',_0xa2f0('0x12')],[_0xa2f0('0x13'),_0x320aad],['id',_0xa2f0('0x14')]],'raw':!![],'limit':_0x4411db},'log':'GetContactDialer'});};};exports['getContactDialerIvr']=function(_0x4b0c4b,_0xe74cbd,_0x17565){return function(){return client[_0xa2f0('0xa')](_0xa2f0('0x15'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x4b0c4b,'active':![],'scheduledat':{'$lte':moment()[_0xa2f0('0x8')]('YYYY-MM-DD\x20HH:mm:ss')}},'include':[{'model':_0xa2f0('0x16'),'as':_0xa2f0('0x17')}],'order':[[_0xa2f0('0x18'),_0xa2f0('0x12')],['scheduledat',_0x17565],['id','ASC']],'raw':!![],'limit':_0xe74cbd},'log':_0xa2f0('0x19')});};};exports[_0xa2f0('0x1a')]=function(_0x381607,_0x5040f6){return function(){_0x381607['campaign']=_0x381607['queue'];return client['Request'](_0xa2f0('0x1b'),{'body':_0x381607,'options':{'where':{'ContactId':_0x381607[_0xa2f0('0xb')],'ListId':_0x381607['ListId'],'VoiceQueueId':_0x381607[_0xa2f0('0xd')],'CampaignId':_0x381607['CampaignId'],'active':_0x5040f6?undefined:!![]}},'log':_0xa2f0('0x1b')});};};exports[_0xa2f0('0x1c')]=function(_0x14a9e4){return function(){return client[_0xa2f0('0xa')](_0xa2f0('0x1d'),{'options':{'where':{'VoiceQueueId':_0x14a9e4['id']?_0x14a9e4['id']||null:null}},'log':_0xa2f0('0x1c')});};};exports[_0xa2f0('0x1e')]=function(_0x2c5f91){return function(){return client[_0xa2f0('0xa')]('GetCmHopperPreview',{'options':{'where':{'id':_0x2c5f91},'include':[{'model':'CmContact','as':_0xa2f0('0x17')},{'model':_0xa2f0('0x1f'),'as':'Agent','attributes':['id',_0xa2f0('0x20')]},{'model':_0xa2f0('0x21'),'as':_0xa2f0('0x22'),'attributes':['id','name']}],'raw':!![]},'log':_0xa2f0('0x5')});};};exports['unlockContact']=function(_0x10510c,_0x2b62ca,_0x5c9468){return function(){return client[_0xa2f0('0xa')](_0xa2f0('0x7'),{'body':_0x10510c,'options':{'where':{'id':_0x2b62ca},'limit':_0x5c9468},'log':'UpdateCmHopper'});};};exports[_0xa2f0('0x23')]=function(_0x2a41d9,_0x51e10a){return function(){return client['Request'](_0xa2f0('0x24'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x2a41d9,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0xa2f0('0x8')]('YYYY-MM-DD\x20HH:mm:ss')},'UserId':{'$in':_0x51e10a}},'order':[[_0xa2f0('0x18'),'DESC'],[_0xa2f0('0x13'),_0xa2f0('0x12')],['id',_0xa2f0('0x14')]],'include':[{'model':_0xa2f0('0x16'),'as':_0xa2f0('0x17')},{'model':_0xa2f0('0x1f'),'as':'Agent','attributes':['id',_0xa2f0('0x20'),'voicePause']}],'group':_0xa2f0('0x25'),'raw':!![]},'log':_0xa2f0('0x15')});};};exports[_0xa2f0('0x26')]=function(_0x1e90d0){return function(){return client[_0xa2f0('0xa')](_0xa2f0('0x27'),{'body':_0x1e90d0,'options':{},'log':_0xa2f0('0x27')});};};exports[_0xa2f0('0x28')]=function(_0x10c893,_0x31cfc3){return function(){return client['Request']('CmHopperHandlePreviewRecallNotifications',{'body':{'where':{'voiceQueueId':_0x10c893,'interval':_0x31cfc3}},'log':_0xa2f0('0x28')});};};