ec01db930a192a3788a92b76de40becd3136f060
[motion2.git] / server / services / ami / rpc / cmHopperHistory.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 _0x9466=['Request','subtract','minutes','format','YYYY-MM-DD\x20HH:mm:ss','getVoiceQueueHopperHistory','startOf','day','endOf','GetVoiceQueueHopperHistory','getCampaignHopperHistory','GetCampaignHopperHistory','ivr','moment','createHistory','queue','avgHandleTime'];(function(_0x2b6a8f,_0x294599){var _0x2d2036=function(_0x1ea077){while(--_0x1ea077){_0x2b6a8f['push'](_0x2b6a8f['shift']());}};_0x2d2036(++_0x294599);}(_0x9466,0x161));var _0x6946=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x9466[_0x19950b];return _0x3c6b41;};'use strict';var client=require('../client');var moment=require(_0x6946('0x0'));exports[_0x6946('0x1')]=function(_0x5dfc16){_0x5dfc16['campaign']=_0x5dfc16[_0x6946('0x2')];return client['Request']('CreateCmHopperHistory',{'body':_0x5dfc16,'log':'CreateCmHopperHistory'});};exports[_0x6946('0x3')]=function(_0x13499a){return client[_0x6946('0x4')]('AvgHandleTime',{'options':{'where':{'endtime':{'$between':[moment()[_0x6946('0x5')](_0x13499a,_0x6946('0x6'))[_0x6946('0x7')](_0x6946('0x8')),moment()[_0x6946('0x7')](_0x6946('0x8'))]}},'raw':![]},'log':'GetCmHopperHistory'});};exports[_0x6946('0x9')]=function(){return function(){return client[_0x6946('0x4')]('GetVoiceQueueHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0x6946('0xa')](_0x6946('0xb'))[_0x6946('0x7')](_0x6946('0x8')),moment()[_0x6946('0xc')](_0x6946('0xb'))['format'](_0x6946('0x8'))]},'campaigntype':'queue'},'raw':![]},'log':_0x6946('0xd')});};};exports[_0x6946('0xe')]=function(){return function(){return client[_0x6946('0x4')](_0x6946('0xf'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x6946('0xa')](_0x6946('0xb'))[_0x6946('0x7')](_0x6946('0x8')),moment()['endOf'](_0x6946('0xb'))[_0x6946('0x7')]('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0x6946('0x10')},'raw':![]},'log':_0x6946('0xf')});};};