Built motion from commit 936e8062.|2.5.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 _0xb900=['GetCampaignHopperHistory','ivr','moment','createHistory','CreateCmHopperHistory','avgHandleTime','Request','format','YYYY-MM-DD\x20HH:mm:ss','getVoiceQueueHopperHistory','startOf','day','endOf','queue','getCampaignHopperHistory'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb900,0x89));var _0x0b90=function(_0x2b530d,_0x2f3410){_0x2b530d=_0x2b530d-0x0;var _0x585e2a=_0xb900[_0x2b530d];return _0x585e2a;};'use strict';var client=require('../client');var moment=require(_0x0b90('0x0'));exports[_0x0b90('0x1')]=function(_0x4b9ccb){return function(){_0x4b9ccb['campaign']=_0x4b9ccb['queue'];return client['Request'](_0x0b90('0x2'),{'body':_0x4b9ccb,'log':_0x0b90('0x2')});};};exports[_0x0b90('0x3')]=function(_0x2e5ab0){return function(){return client[_0x0b90('0x4')]('AvgHandleTime',{'options':{'where':{'endtime':{'$between':[moment()['subtract'](_0x2e5ab0,'minutes')[_0x0b90('0x5')](_0x0b90('0x6')),moment()[_0x0b90('0x5')](_0x0b90('0x6'))]}},'raw':![]},'log':'GetCmHopperHistory'});};};exports[_0x0b90('0x7')]=function(_0x2dc95f){return function(){return client[_0x0b90('0x4')]('GetVoiceQueueHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0x0b90('0x8')](_0x0b90('0x9'))[_0x0b90('0x5')](_0x0b90('0x6')),moment()[_0x0b90('0xa')](_0x0b90('0x9'))['format'](_0x0b90('0x6'))]},'campaigntype':_0x0b90('0xb')},'raw':![]},'log':'GetVoiceQueueHopperHistory'});};};exports[_0x0b90('0xc')]=function(_0x292436){return function(){return client[_0x0b90('0x4')](_0x0b90('0xd'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0b90('0x8')](_0x0b90('0x9'))['format'](_0x0b90('0x6')),moment()[_0x0b90('0xa')](_0x0b90('0x9'))['format'](_0x0b90('0x6'))]},'campaigntype':_0x0b90('0xe')},'raw':![]},'log':_0x0b90('0xd')});};};