Built motion from commit (unavailable).|2.5.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 _0x17dd=['DESC','scheduledat','GetContactDialerIvr','campaign','queue','CampaignId','MoveContactManagedDialer','countReScheduled','CountReScheduled','getContactPreview','GetCmHopperPreview','User','Agent','name','Queue','unlockContact','getContactRecallMe','voicePause','../client','moment','lodash','getContacts','Request','GetCmHopper','CmContact','Contact','getCmHopper','format','UpdateCmHopper','ContactId','ListId','VoiceQueueId','DestroyCmHopper','getContactDialer','GetContactDialer','ASC','getContactDialerIvr','YYYY-MM-DD\x20HH:mm:ss','priority'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x17dd,0x198));var _0xd17d=function(_0x1f41bc,_0x1e5d00){_0x1f41bc=_0x1f41bc-0x0;var _0x492c61=_0x17dd[_0x1f41bc];return _0x492c61;};'use strict';var client=require(_0xd17d('0x0'));var moment=require(_0xd17d('0x1'));var _=require(_0xd17d('0x2'));exports[_0xd17d('0x3')]=function(_0x58067d,_0x410ec7){return function(){return client[_0xd17d('0x4')](_0xd17d('0x5'),{'options':{'where':{'VoiceQueueId':_0x58067d},'include':[{'model':_0xd17d('0x6'),'as':_0xd17d('0x7')}],'limit':_0x410ec7,'raw':![]},'log':_0xd17d('0x8')});};};exports['updateContacts']=function(_0x8a50f1,_0xa7089d,_0x30b307){return function(){return client[_0xd17d('0x4')]('UpdateCmHopper',{'body':_0x8a50f1,'options':{'where':{'VoiceQueueId':_0xa7089d,'scheduledat':{'$lte':moment()[_0xd17d('0x9')]('YYYY-MM-DD\x20HH:mm:ss')}},'limit':_0x30b307},'log':'UpdateCmHopper'});};};exports['rescheduleContact']=function(_0xc115de){return function(){return client[_0xd17d('0x4')](_0xd17d('0xa'),{'body':_0xc115de,'options':{'where':{'ContactId':_0xc115de[_0xd17d('0xb')],'ListId':_0xc115de[_0xd17d('0xc')],'VoiceQueueId':_0xc115de[_0xd17d('0xd')],'CampaignId':_0xc115de['CampaignId']}},'log':'rescheduleContact'});};};exports['destroyContact']=function(_0x2b1dad,_0x5ca48a,_0x4bc764){return function(){return client[_0xd17d('0x4')]('DestroyCmHopper',{'options':{'where':{'VoiceQueueId':_0x2b1dad,'ListId':_0x5ca48a,'ContactId':_0x4bc764}},'log':_0xd17d('0xe')});};};exports[_0xd17d('0xf')]=function(_0x804710,_0x4825d5,_0x1e0431,_0x1d6748){return function(){return client['Request'](_0xd17d('0x10'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x804710,'active':![],'scheduledat':{'$lte':moment()[_0xd17d('0x9')]('YYYY-MM-DD\x20HH:mm:ss')},'$or':[{'UserId':null},{'UserId':{'$in':_0x4825d5}}]},'order':[['priority','DESC'],['scheduledat',_0x1d6748],['id',_0xd17d('0x11')]],'raw':!![],'limit':_0x1e0431},'log':'GetContactDialer'});};};exports[_0xd17d('0x12')]=function(_0x56c457,_0x2d21d4,_0x4c904f){return function(){return client[_0xd17d('0x4')](_0xd17d('0x10'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x56c457,'active':![],'scheduledat':{'$lte':moment()[_0xd17d('0x9')](_0xd17d('0x13'))}},'include':[{'model':_0xd17d('0x6'),'as':'Contact'}],'order':[[_0xd17d('0x14'),_0xd17d('0x15')],[_0xd17d('0x16'),_0x4c904f],['id','ASC']],'raw':!![],'limit':_0x2d21d4},'log':_0xd17d('0x17')});};};exports['moveContactManagedDialer']=function(_0x213f7e,_0x56d64e){return function(){_0x213f7e[_0xd17d('0x18')]=_0x213f7e[_0xd17d('0x19')];return client[_0xd17d('0x4')]('MoveContactManagedDialer',{'body':_0x213f7e,'options':{'where':{'ContactId':_0x213f7e[_0xd17d('0xb')],'ListId':_0x213f7e[_0xd17d('0xc')],'VoiceQueueId':_0x213f7e['VoiceQueueId'],'CampaignId':_0x213f7e[_0xd17d('0x1a')],'active':_0x56d64e?undefined:!![]}},'log':_0xd17d('0x1b')});};};exports[_0xd17d('0x1c')]=function(_0x28f43b){return function(){return client['Request'](_0xd17d('0x1d'),{'options':{'where':{'VoiceQueueId':_0x28f43b['id']?_0x28f43b['id']||null:null}},'log':_0xd17d('0x1c')});};};exports[_0xd17d('0x1e')]=function(_0x6a079){return function(){return client[_0xd17d('0x4')](_0xd17d('0x1f'),{'options':{'where':{'id':_0x6a079},'include':[{'model':_0xd17d('0x6'),'as':_0xd17d('0x7')},{'model':_0xd17d('0x20'),'as':_0xd17d('0x21'),'attributes':['id',_0xd17d('0x22')]},{'model':'VoiceQueue','as':_0xd17d('0x23'),'attributes':['id',_0xd17d('0x22')]}],'raw':!![]},'log':_0xd17d('0x8')});};};exports[_0xd17d('0x24')]=function(_0xc93d8b,_0x2c2d1b,_0x2642ed){return function(){return client[_0xd17d('0x4')](_0xd17d('0xa'),{'body':_0xc93d8b,'options':{'where':{'id':_0x2c2d1b},'limit':_0x2642ed},'log':_0xd17d('0xa')});};};exports[_0xd17d('0x25')]=function(_0x414126,_0x889b93){return function(){return client[_0xd17d('0x4')]('GetContactRecallMe',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x414126,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()['format'](_0xd17d('0x13'))},'UserId':{'$in':_0x889b93}},'order':[[_0xd17d('0x14'),_0xd17d('0x15')],[_0xd17d('0x16'),_0xd17d('0x15')],['id',_0xd17d('0x11')]],'include':[{'model':_0xd17d('0x6'),'as':_0xd17d('0x7')},{'model':'User','as':_0xd17d('0x21'),'attributes':['id',_0xd17d('0x22'),_0xd17d('0x26')]}],'group':'db.CmHopper.UserId','raw':!![]},'log':_0xd17d('0x10')});};};