Built motion from commit b0a9a629.|2.6.33
[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 _0x9b00=['YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','GetVoiceQueueHopperHistory','startOf','endOf','day','getCampaignHopperHistory','GetCampaignHopperHistory','ivr','moment','createHistory','campaign','queue','CreateCmHopperHistory','Request','AvgHandleTime','minutes','format'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x9b00,0x99));var _0x09b0=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x9b00[_0x432682];return _0x463d05;};'use strict';var client=require('../client');var moment=require(_0x09b0('0x0'));exports[_0x09b0('0x1')]=function(_0x5bf569){_0x5bf569[_0x09b0('0x2')]=_0x5bf569[_0x09b0('0x3')];return client['Request'](_0x09b0('0x4'),{'body':_0x5bf569,'log':_0x09b0('0x4')});};exports['avgHandleTime']=function(_0xb4e3a4){return client[_0x09b0('0x5')](_0x09b0('0x6'),{'options':{'where':{'endtime':{'$between':[moment()['subtract'](_0xb4e3a4,_0x09b0('0x7'))[_0x09b0('0x8')](_0x09b0('0x9')),moment()[_0x09b0('0x8')](_0x09b0('0x9'))]}},'raw':![]},'log':_0x09b0('0xa')});};exports['getVoiceQueueHopperHistory']=function(){return function(){return client[_0x09b0('0x5')](_0x09b0('0xb'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x09b0('0xc')]('day')[_0x09b0('0x8')](_0x09b0('0x9')),moment()[_0x09b0('0xd')](_0x09b0('0xe'))[_0x09b0('0x8')](_0x09b0('0x9'))]},'campaigntype':'queue'},'raw':![]},'log':_0x09b0('0xb')});};};exports[_0x09b0('0xf')]=function(){return function(){return client[_0x09b0('0x5')](_0x09b0('0x10'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x09b0('0xc')](_0x09b0('0xe'))[_0x09b0('0x8')](_0x09b0('0x9')),moment()['endOf'](_0x09b0('0xe'))['format'](_0x09b0('0x9'))]},'campaigntype':_0x09b0('0x11')},'raw':![]},'log':_0x09b0('0x10')});};};