ebfae80ea68cbfa94087c972a3a8651bc96e9e86
[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 _0xe2cf=['CreateCmHopperHistory','minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf','endOf','day','GetCampaignHopperHistory','ivr','moment','queue','Request'];(function(_0x4271f5,_0x114773){var _0x57b45f=function(_0x324bdd){while(--_0x324bdd){_0x4271f5['push'](_0x4271f5['shift']());}};_0x57b45f(++_0x114773);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x52ae40,_0x23c2bf){_0x52ae40=_0x52ae40-0x0;var _0xab6ed1=_0xe2cf[_0x52ae40];return _0xab6ed1;};'use strict';var client=require('../client');var moment=require(_0xfe2c('0x0'));exports['createHistory']=function(_0x11c3a4){return function(){_0x11c3a4['campaign']=_0x11c3a4[_0xfe2c('0x1')];return client[_0xfe2c('0x2')](_0xfe2c('0x3'),{'body':_0x11c3a4,'log':_0xfe2c('0x3')});};};exports['avgHandleTime']=function(_0xd40c31){return function(){return client[_0xfe2c('0x2')]('AvgHandleTime',{'options':{'where':{'endtime':{'$between':[moment()['subtract'](_0xd40c31,_0xfe2c('0x4'))[_0xfe2c('0x5')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['format'](_0xfe2c('0x6'))]}},'raw':![]},'log':_0xfe2c('0x7')});};};exports[_0xfe2c('0x8')]=function(_0x562414){return function(){return client['Request'](_0xfe2c('0x9'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xfe2c('0xa')]('day')[_0xfe2c('0x5')](_0xfe2c('0x6')),moment()[_0xfe2c('0xb')](_0xfe2c('0xc'))[_0xfe2c('0x5')](_0xfe2c('0x6'))]},'campaigntype':_0xfe2c('0x1')},'raw':![]},'log':'GetVoiceQueueHopperHistory'});};};exports['getCampaignHopperHistory']=function(_0x59ecf8){return function(){return client['Request'](_0xfe2c('0xd'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf']('day')[_0xfe2c('0x5')](_0xfe2c('0x6')),moment()[_0xfe2c('0xb')](_0xfe2c('0xc'))['format']('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0xfe2c('0xe')},'raw':![]},'log':_0xfe2c('0xd')});};};