3a4b61a01607ceaead0e7a1820dcf5f8c3c6a9ba
[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 _0x7f57=['format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf','day','endOf','getCampaignHopperHistory','GetCampaignHopperHistory','ivr','../client','createHistory','queue','Request','CreateCmHopperHistory','avgHandleTime','AvgHandleTime'];(function(_0x1433d0,_0x5af216){var _0x32ea37=function(_0x556f3a){while(--_0x556f3a){_0x1433d0['push'](_0x1433d0['shift']());}};_0x32ea37(++_0x5af216);}(_0x7f57,0x13d));var _0x77f5=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x7f57[_0x500419];return _0x241c1a;};'use strict';var client=require(_0x77f5('0x0'));var moment=require('moment');exports[_0x77f5('0x1')]=function(_0x5f206d){return function(){_0x5f206d['campaign']=_0x5f206d[_0x77f5('0x2')];return client[_0x77f5('0x3')]('CreateCmHopperHistory',{'body':_0x5f206d,'log':_0x77f5('0x4')});};};exports[_0x77f5('0x5')]=function(_0x29a0bc){return function(){return client[_0x77f5('0x3')](_0x77f5('0x6'),{'options':{'where':{'endtime':{'$between':[moment()['subtract'](_0x29a0bc,'minutes')[_0x77f5('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['format'](_0x77f5('0x8'))]}},'raw':![]},'log':_0x77f5('0x9')});};};exports[_0x77f5('0xa')]=function(_0x5b90f5){return function(){return client[_0x77f5('0x3')](_0x77f5('0xb'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x77f5('0xc')](_0x77f5('0xd'))[_0x77f5('0x7')](_0x77f5('0x8')),moment()[_0x77f5('0xe')](_0x77f5('0xd'))['format'](_0x77f5('0x8'))]},'campaigntype':'queue'},'raw':![]},'log':_0x77f5('0xb')});};};exports[_0x77f5('0xf')]=function(_0x47f89c){return function(){return client['Request'](_0x77f5('0x10'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x77f5('0xc')](_0x77f5('0xd'))['format'](_0x77f5('0x8')),moment()['endOf'](_0x77f5('0xd'))[_0x77f5('0x7')](_0x77f5('0x8'))]},'campaigntype':_0x77f5('0x11')},'raw':![]},'log':_0x77f5('0x10')});};};