7f82657e9dbb7412b4c242ba9ea1dabb6ea4a883
[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 _0x7061=['campaign','queue','Request','CreateCmHopperHistory','AvgHandleTime','subtract','minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','startOf','endOf','day','GetVoiceQueueHopperHistory','getCampaignHopperHistory','ivr','../client','moment'];(function(_0x200661,_0xc8d664){var _0x2b4b91=function(_0x176e9e){while(--_0x176e9e){_0x200661['push'](_0x200661['shift']());}};_0x2b4b91(++_0xc8d664);}(_0x7061,0x12e));var _0x1706=function(_0x5ef94b,_0x129e45){_0x5ef94b=_0x5ef94b-0x0;var _0x5d205a=_0x7061[_0x5ef94b];return _0x5d205a;};'use strict';var client=require(_0x1706('0x0'));var moment=require(_0x1706('0x1'));exports['createHistory']=function(_0x441d2b){_0x441d2b[_0x1706('0x2')]=_0x441d2b[_0x1706('0x3')];return client[_0x1706('0x4')](_0x1706('0x5'),{'body':_0x441d2b,'log':_0x1706('0x5')});};exports['avgHandleTime']=function(_0x4fdb72){return client[_0x1706('0x4')](_0x1706('0x6'),{'options':{'where':{'endtime':{'$between':[moment()[_0x1706('0x7')](_0x4fdb72,_0x1706('0x8'))[_0x1706('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['format'](_0x1706('0xa'))]}},'raw':![]},'log':_0x1706('0xb')});};exports[_0x1706('0xc')]=function(){return function(){return client[_0x1706('0x4')]('GetVoiceQueueHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0x1706('0xd')]('day')[_0x1706('0x9')](_0x1706('0xa')),moment()[_0x1706('0xe')](_0x1706('0xf'))['format'](_0x1706('0xa'))]},'campaigntype':_0x1706('0x3')},'raw':![]},'log':_0x1706('0x10')});};};exports[_0x1706('0x11')]=function(){return function(){return client[_0x1706('0x4')]('GetCampaignHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0x1706('0xd')](_0x1706('0xf'))[_0x1706('0x9')](_0x1706('0xa')),moment()['endOf'](_0x1706('0xf'))[_0x1706('0x9')](_0x1706('0xa'))]},'campaigntype':_0x1706('0x12')},'raw':![]},'log':'GetCampaignHopperHistory'});};};