Built motion from commit (unavailable).|2.5.4
[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 _0xe07f=['CmContact','Contact','getCmHopper','updateContacts','UpdateCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','ContactId','ListId','VoiceQueueId','CampaignId','rescheduleContact','destroyContact','DestroyCmHopper','scheduledat','GetContactDialer','priority','DESC','ASC','GetContactDialerIvr','moveContactManagedDialer','queue','MoveContactManagedDialer','countReScheduled','CountReScheduled','getContactPreview','GetCmHopperPreview','Agent','name','Queue','getContactRecallMe','voicePause','../client','lodash','getContacts','Request'];(function(_0x1519cc,_0x518831){var _0x1d574d=function(_0x33bfc8){while(--_0x33bfc8){_0x1519cc['push'](_0x1519cc['shift']());}};_0x1d574d(++_0x518831);}(_0xe07f,0x1d0));var _0xfe07=function(_0xafc7da,_0x20ac2d){_0xafc7da=_0xafc7da-0x0;var _0x42a683=_0xe07f[_0xafc7da];return _0x42a683;};'use strict';var client=require(_0xfe07('0x0'));var moment=require('moment');var _=require(_0xfe07('0x1'));exports[_0xfe07('0x2')]=function(_0x578da0,_0x3740f1){return function(){return client[_0xfe07('0x3')]('GetCmHopper',{'options':{'where':{'VoiceQueueId':_0x578da0},'include':[{'model':_0xfe07('0x4'),'as':_0xfe07('0x5')}],'limit':_0x3740f1,'raw':![]},'log':_0xfe07('0x6')});};};exports[_0xfe07('0x7')]=function(_0x1f5d1d,_0x3aeed2,_0xb804c5){return function(){return client['Request'](_0xfe07('0x8'),{'body':_0x1f5d1d,'options':{'where':{'VoiceQueueId':_0x3aeed2,'scheduledat':{'$lte':moment()[_0xfe07('0x9')](_0xfe07('0xa'))}},'limit':_0xb804c5},'log':_0xfe07('0x8')});};};exports['rescheduleContact']=function(_0x297ddb){return function(){return client[_0xfe07('0x3')](_0xfe07('0x8'),{'body':_0x297ddb,'options':{'where':{'ContactId':_0x297ddb[_0xfe07('0xb')],'ListId':_0x297ddb[_0xfe07('0xc')],'VoiceQueueId':_0x297ddb[_0xfe07('0xd')],'CampaignId':_0x297ddb[_0xfe07('0xe')]}},'log':_0xfe07('0xf')});};};exports[_0xfe07('0x10')]=function(_0x237480,_0x1fe31f,_0x378d70){return function(){return client['Request'](_0xfe07('0x11'),{'options':{'where':{'VoiceQueueId':_0x237480,'ListId':_0x1fe31f,'ContactId':_0x378d70}},'log':_0xfe07('0x11')});};};exports['getContactDialer']=function(_0x441b1d,_0x433c3b,_0x24150b,_0x5c539a){return function(){return client[_0xfe07('0x3')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x441b1d,'active':![],'scheduledat':{'$lte':moment()[_0xfe07('0x9')](_0xfe07('0xa'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x433c3b}}]},'order':[['priority','DESC'],[_0xfe07('0x12'),_0x5c539a],['id','ASC']],'raw':!![],'limit':_0x24150b},'log':_0xfe07('0x13')});};};exports['getContactDialerIvr']=function(_0x5196a6,_0x47d708,_0x2f7755){return function(){return client['Request'](_0xfe07('0x13'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x5196a6,'active':![],'scheduledat':{'$lte':moment()[_0xfe07('0x9')](_0xfe07('0xa'))}},'include':[{'model':'CmContact','as':'Contact'}],'order':[[_0xfe07('0x14'),_0xfe07('0x15')],[_0xfe07('0x12'),_0x2f7755],['id',_0xfe07('0x16')]],'raw':!![],'limit':_0x47d708},'log':_0xfe07('0x17')});};};exports[_0xfe07('0x18')]=function(_0x5110b2,_0x5c0644){return function(){_0x5110b2['campaign']=_0x5110b2[_0xfe07('0x19')];return client[_0xfe07('0x3')](_0xfe07('0x1a'),{'body':_0x5110b2,'options':{'where':{'ContactId':_0x5110b2['ContactId'],'ListId':_0x5110b2[_0xfe07('0xc')],'VoiceQueueId':_0x5110b2[_0xfe07('0xd')],'CampaignId':_0x5110b2[_0xfe07('0xe')],'active':_0x5c0644?undefined:!![]}},'log':_0xfe07('0x1a')});};};exports[_0xfe07('0x1b')]=function(_0x5a984b){return function(){return client[_0xfe07('0x3')](_0xfe07('0x1c'),{'options':{'where':{'VoiceQueueId':_0x5a984b['id']?_0x5a984b['id']||null:null}},'log':_0xfe07('0x1b')});};};exports[_0xfe07('0x1d')]=function(_0x18e477){return function(){return client[_0xfe07('0x3')](_0xfe07('0x1e'),{'options':{'where':{'id':_0x18e477},'include':[{'model':_0xfe07('0x4'),'as':_0xfe07('0x5')},{'model':'User','as':_0xfe07('0x1f'),'attributes':['id',_0xfe07('0x20')]},{'model':'VoiceQueue','as':_0xfe07('0x21'),'attributes':['id',_0xfe07('0x20')]}],'raw':!![]},'log':_0xfe07('0x6')});};};exports['unlockContact']=function(_0x4b5712,_0x16edca,_0x16694c){return function(){return client[_0xfe07('0x3')]('UpdateCmHopper',{'body':_0x4b5712,'options':{'where':{'id':_0x16edca},'limit':_0x16694c},'log':_0xfe07('0x8')});};};exports[_0xfe07('0x22')]=function(_0x478860,_0x3eb7c3){return function(){return client['Request']('GetContactRecallMe',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x478860,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0xfe07('0x9')](_0xfe07('0xa'))},'UserId':{'$in':_0x3eb7c3}},'order':[[_0xfe07('0x14'),'DESC'],['scheduledat','DESC'],['id','ASC']],'include':[{'model':'CmContact','as':_0xfe07('0x5')},{'model':'User','as':_0xfe07('0x1f'),'attributes':['id',_0xfe07('0x20'),_0xfe07('0x23')]}],'group':'db.CmHopper.UserId','raw':!![]},'log':_0xfe07('0x13')});};};