Built motion from commit (unavailable).|2.5.26
[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 _0x7dcd=['CountReScheduled','getContactPreview','GetCmHopperPreview','User','name','Queue','unlockContact','getContactRecallMe','GetContactRecallMe','scheduledat','../client','moment','Request','GetCmHopper','CmContact','Contact','getCmHopper','UpdateCmHopper','format','rescheduleContact','ContactId','VoiceQueueId','DestroyCmHopper','getContactDialer','GetContactDialer','YYYY-MM-DD\x20HH:mm:ss','priority','DESC','ASC','getContactDialerIvr','GetContactDialerIvr','campaign','MoveContactManagedDialer','ListId','CampaignId','countReScheduled'];(function(_0x1708e0,_0x428eca){var _0x2fa917=function(_0x407ac3){while(--_0x407ac3){_0x1708e0['push'](_0x1708e0['shift']());}};_0x2fa917(++_0x428eca);}(_0x7dcd,0x1ba));var _0xd7dc=function(_0x5c846d,_0x5c02ce){_0x5c846d=_0x5c846d-0x0;var _0xd064e4=_0x7dcd[_0x5c846d];return _0xd064e4;};'use strict';var client=require(_0xd7dc('0x0'));var moment=require(_0xd7dc('0x1'));var _=require('lodash');exports['getContacts']=function(_0x187d8f,_0x28a1cc){return function(){return client[_0xd7dc('0x2')](_0xd7dc('0x3'),{'options':{'where':{'VoiceQueueId':_0x187d8f},'include':[{'model':_0xd7dc('0x4'),'as':_0xd7dc('0x5')}],'limit':_0x28a1cc,'raw':![]},'log':_0xd7dc('0x6')});};};exports['updateContacts']=function(_0x4e6d9b,_0xd42d9a,_0x4d58ca){return function(){return client['Request'](_0xd7dc('0x7'),{'body':_0x4e6d9b,'options':{'where':{'VoiceQueueId':_0xd42d9a,'scheduledat':{'$lte':moment()[_0xd7dc('0x8')]('YYYY-MM-DD\x20HH:mm:ss')}},'limit':_0x4d58ca},'log':_0xd7dc('0x7')});};};exports[_0xd7dc('0x9')]=function(_0x11caf2){return function(){return client['Request'](_0xd7dc('0x7'),{'body':_0x11caf2,'options':{'where':{'ContactId':_0x11caf2[_0xd7dc('0xa')],'ListId':_0x11caf2['ListId'],'VoiceQueueId':_0x11caf2[_0xd7dc('0xb')],'CampaignId':_0x11caf2['CampaignId']}},'log':_0xd7dc('0x9')});};};exports['destroyContact']=function(_0x3968af,_0x56fc4,_0xfb0149){return function(){return client[_0xd7dc('0x2')](_0xd7dc('0xc'),{'options':{'where':{'VoiceQueueId':_0x3968af,'ListId':_0x56fc4,'ContactId':_0xfb0149}},'log':_0xd7dc('0xc')});};};exports[_0xd7dc('0xd')]=function(_0x35b453,_0x27f578,_0x37a5ab,_0x1f1d69){return function(){return client[_0xd7dc('0x2')](_0xd7dc('0xe'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x35b453,'active':![],'scheduledat':{'$lte':moment()['format'](_0xd7dc('0xf'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x27f578}}]},'order':[[_0xd7dc('0x10'),_0xd7dc('0x11')],['scheduledat',_0x1f1d69],['id',_0xd7dc('0x12')]],'raw':!![],'limit':_0x37a5ab},'log':_0xd7dc('0xe')});};};exports[_0xd7dc('0x13')]=function(_0x2c8c51,_0x3462c4,_0x52ce15){return function(){return client[_0xd7dc('0x2')](_0xd7dc('0xe'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x2c8c51,'active':![],'scheduledat':{'$lte':moment()[_0xd7dc('0x8')]('YYYY-MM-DD\x20HH:mm:ss')}},'include':[{'model':'CmContact','as':_0xd7dc('0x5')}],'order':[['priority',_0xd7dc('0x11')],['scheduledat',_0x52ce15],['id',_0xd7dc('0x12')]],'raw':!![],'limit':_0x3462c4},'log':_0xd7dc('0x14')});};};exports['moveContactManagedDialer']=function(_0x26cfe2,_0x1b18c1){return function(){_0x26cfe2[_0xd7dc('0x15')]=_0x26cfe2['queue'];return client[_0xd7dc('0x2')](_0xd7dc('0x16'),{'body':_0x26cfe2,'options':{'where':{'ContactId':_0x26cfe2[_0xd7dc('0xa')],'ListId':_0x26cfe2[_0xd7dc('0x17')],'VoiceQueueId':_0x26cfe2[_0xd7dc('0xb')],'CampaignId':_0x26cfe2[_0xd7dc('0x18')],'active':_0x1b18c1?undefined:!![]}},'log':_0xd7dc('0x16')});};};exports[_0xd7dc('0x19')]=function(_0x40cabf){return function(){return client['Request'](_0xd7dc('0x1a'),{'options':{'where':{'VoiceQueueId':_0x40cabf['id']?_0x40cabf['id']||null:null}},'log':_0xd7dc('0x19')});};};exports[_0xd7dc('0x1b')]=function(_0x12a84d){return function(){return client['Request'](_0xd7dc('0x1c'),{'options':{'where':{'id':_0x12a84d},'include':[{'model':_0xd7dc('0x4'),'as':_0xd7dc('0x5')},{'model':_0xd7dc('0x1d'),'as':'Agent','attributes':['id',_0xd7dc('0x1e')]},{'model':'VoiceQueue','as':_0xd7dc('0x1f'),'attributes':['id',_0xd7dc('0x1e')]}],'raw':!![]},'log':_0xd7dc('0x6')});};};exports[_0xd7dc('0x20')]=function(_0x648bad,_0xe9d19a,_0x113114){return function(){return client[_0xd7dc('0x2')](_0xd7dc('0x7'),{'body':_0x648bad,'options':{'where':{'id':_0xe9d19a},'limit':_0x113114},'log':'UpdateCmHopper'});};};exports[_0xd7dc('0x21')]=function(_0x37daaa,_0x4ba046){return function(){return client['Request'](_0xd7dc('0x22'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x37daaa,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0xd7dc('0x8')](_0xd7dc('0xf'))},'UserId':{'$in':_0x4ba046}},'order':[['priority',_0xd7dc('0x11')],[_0xd7dc('0x23'),_0xd7dc('0x11')],['id','ASC']],'include':[{'model':_0xd7dc('0x4'),'as':_0xd7dc('0x5')},{'model':_0xd7dc('0x1d'),'as':'Agent','attributes':['id',_0xd7dc('0x1e'),'voicePause']}],'group':'db.CmHopper.UserId','raw':!![]},'log':_0xd7dc('0xe')});};};