Built motion from commit 0c5f406c.|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 _0x22da=['voicePause','db.CmHopper.UserId','resetActiveCalls','ResetActiveCalls','handlePreviewRecallNotifications','getContacts','Request','CmContact','Contact','getCmHopper','updateContacts','UpdateCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','ListId','VoiceQueueId','CampaignId','rescheduleContact','DestroyCmHopper','getContactDialer','GetContactDialer','DESC','scheduledat','ASC','getContactDialerIvr','priority','GetContactDialerIvr','moveContactManagedDialer','queue','MoveContactManagedDialer','countReScheduled','CountReScheduled','getContactPreview','GetCmHopperPreview','Agent','name','VoiceQueue','Queue','unlockContact','GetContactRecallMe','User'];(function(_0x2211ed,_0x1bca0b){var _0x4d78cc=function(_0x467b59){while(--_0x467b59){_0x2211ed['push'](_0x2211ed['shift']());}};_0x4d78cc(++_0x1bca0b);}(_0x22da,0x80));var _0xa22d=function(_0x1936c9,_0x5ce09e){_0x1936c9=_0x1936c9-0x0;var _0x452608=_0x22da[_0x1936c9];return _0x452608;};'use strict';var client=require('../client');var moment=require('moment');exports[_0xa22d('0x0')]=function(_0x3813ac,_0x3d295f){return function(){return client[_0xa22d('0x1')]('GetCmHopper',{'options':{'where':{'VoiceQueueId':_0x3813ac},'include':[{'model':_0xa22d('0x2'),'as':_0xa22d('0x3')}],'limit':_0x3d295f,'raw':![]},'log':_0xa22d('0x4')});};};exports[_0xa22d('0x5')]=function(_0x547fbd,_0x4007bd,_0x9bc0eb){return function(){return client['Request'](_0xa22d('0x6'),{'body':_0x547fbd,'options':{'where':{'VoiceQueueId':_0x4007bd,'scheduledat':{'$lte':moment()[_0xa22d('0x7')](_0xa22d('0x8'))}},'limit':_0x9bc0eb},'log':_0xa22d('0x6')});};};exports['rescheduleContact']=function(_0x5a72a9){return client[_0xa22d('0x1')](_0xa22d('0x6'),{'body':_0x5a72a9,'options':{'where':{'ContactId':_0x5a72a9['ContactId'],'ListId':_0x5a72a9[_0xa22d('0x9')],'VoiceQueueId':_0x5a72a9[_0xa22d('0xa')],'CampaignId':_0x5a72a9[_0xa22d('0xb')]}},'log':_0xa22d('0xc')});};exports['destroyContact']=function(_0x5d25b1,_0x1da4c0,_0x278d64){return function(){return client['Request'](_0xa22d('0xd'),{'options':{'where':{'VoiceQueueId':_0x5d25b1,'ListId':_0x1da4c0,'ContactId':_0x278d64}},'log':'DestroyCmHopper'});};};exports[_0xa22d('0xe')]=function(_0x3e49f4,_0x34d2d3,_0x537591,_0x174a3f){return client[_0xa22d('0x1')](_0xa22d('0xf'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x3e49f4,'active':![],'scheduledat':{'$lte':moment()[_0xa22d('0x7')](_0xa22d('0x8'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x34d2d3}}]},'order':[['priority',_0xa22d('0x10')],[_0xa22d('0x11'),_0x174a3f],['id',_0xa22d('0x12')]],'raw':!![],'limit':_0x537591},'log':_0xa22d('0xf')});};exports[_0xa22d('0x13')]=function(_0x2159e1,_0x1814f3,_0x5e56a6){return client[_0xa22d('0x1')](_0xa22d('0xf'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x2159e1,'active':![],'scheduledat':{'$lte':moment()[_0xa22d('0x7')](_0xa22d('0x8'))}},'include':[{'model':_0xa22d('0x2'),'as':_0xa22d('0x3')}],'order':[[_0xa22d('0x14'),_0xa22d('0x10')],['scheduledat',_0x5e56a6],['id',_0xa22d('0x12')]],'raw':!![],'limit':_0x1814f3},'log':_0xa22d('0x15')});};exports[_0xa22d('0x16')]=function(_0x4ed606,_0x4c0aed){_0x4ed606['campaign']=_0x4ed606[_0xa22d('0x17')];return client[_0xa22d('0x1')](_0xa22d('0x18'),{'body':_0x4ed606,'options':{'where':{'ContactId':_0x4ed606['ContactId'],'ListId':_0x4ed606[_0xa22d('0x9')],'VoiceQueueId':_0x4ed606[_0xa22d('0xa')],'CampaignId':_0x4ed606[_0xa22d('0xb')],'active':_0x4c0aed?undefined:!![]}},'log':'MoveContactManagedDialer'});};exports[_0xa22d('0x19')]=function(_0x1088ea){return client['Request'](_0xa22d('0x1a'),{'options':{'where':{'VoiceQueueId':_0x1088ea['id']?_0x1088ea['id']||null:null}},'log':_0xa22d('0x19')});};exports[_0xa22d('0x1b')]=function(_0x2de6fe){return function(){return client[_0xa22d('0x1')](_0xa22d('0x1c'),{'options':{'where':{'id':_0x2de6fe},'include':[{'model':_0xa22d('0x2'),'as':'Contact'},{'model':'User','as':_0xa22d('0x1d'),'attributes':['id',_0xa22d('0x1e')]},{'model':_0xa22d('0x1f'),'as':_0xa22d('0x20'),'attributes':['id',_0xa22d('0x1e')]}],'raw':!![]},'log':_0xa22d('0x4')});};};exports[_0xa22d('0x21')]=function(_0x1934f7,_0x447a72,_0x31789f){return client[_0xa22d('0x1')]('UpdateCmHopper',{'body':_0x1934f7,'options':{'where':{'id':_0x447a72},'limit':_0x31789f},'log':_0xa22d('0x6')});};exports['getContactRecallMe']=function(_0x550dd7,_0x1d7b33){return function(){return client[_0xa22d('0x1')](_0xa22d('0x22'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x550dd7,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0xa22d('0x7')](_0xa22d('0x8'))},'UserId':{'$in':_0x1d7b33}},'order':[[_0xa22d('0x14'),_0xa22d('0x10')],[_0xa22d('0x11'),'DESC'],['id',_0xa22d('0x12')]],'include':[{'model':_0xa22d('0x2'),'as':_0xa22d('0x3')},{'model':_0xa22d('0x23'),'as':_0xa22d('0x1d'),'attributes':['id',_0xa22d('0x1e'),_0xa22d('0x24')]}],'group':_0xa22d('0x25'),'raw':!![]},'log':_0xa22d('0xf')});};};exports[_0xa22d('0x26')]=function(_0x54907d,_0x18f4bc){return client[_0xa22d('0x1')](_0xa22d('0x27'),{'body':_0x54907d,'options':_0x18f4bc||{},'log':_0xa22d('0x27')});};exports[_0xa22d('0x28')]=function(_0x2b5d71,_0x5e832b,_0x35ea3a){return function(){return client[_0xa22d('0x1')]('CmHopperHandlePreviewRecallNotifications',{'body':{'where':{'voiceQueueIds':_0x2b5d71,'interval':_0x5e832b,'availableAgentsIds':_0x35ea3a}},'log':_0xa22d('0x28')});};};