79a72a38a5fe04eb65487c9eba9dca0beab2cc4b
[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 _0x330c=['YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf','day','endOf','getCampaignHopperHistory','ivr','GetCampaignHopperHistory','../client','moment','createHistory','queue','Request','CreateCmHopperHistory','avgHandleTime','minutes','format'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x330c,0x186));var _0xc330=function(_0x3b6d35,_0x413679){_0x3b6d35=_0x3b6d35-0x0;var _0x5d20c1=_0x330c[_0x3b6d35];return _0x5d20c1;};'use strict';var client=require(_0xc330('0x0'));var moment=require(_0xc330('0x1'));exports[_0xc330('0x2')]=function(_0x3fadcd){_0x3fadcd['campaign']=_0x3fadcd[_0xc330('0x3')];return client[_0xc330('0x4')](_0xc330('0x5'),{'body':_0x3fadcd,'log':_0xc330('0x5')});};exports[_0xc330('0x6')]=function(_0x3f7cec){return client['Request']('AvgHandleTime',{'options':{'where':{'endtime':{'$between':[moment()['subtract'](_0x3f7cec,_0xc330('0x7'))[_0xc330('0x8')](_0xc330('0x9')),moment()[_0xc330('0x8')](_0xc330('0x9'))]}},'raw':![]},'log':_0xc330('0xa')});};exports[_0xc330('0xb')]=function(){return function(){return client['Request'](_0xc330('0xc'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xc330('0xd')](_0xc330('0xe'))['format'](_0xc330('0x9')),moment()[_0xc330('0xf')](_0xc330('0xe'))[_0xc330('0x8')](_0xc330('0x9'))]},'campaigntype':_0xc330('0x3')},'raw':![]},'log':_0xc330('0xc')});};};exports[_0xc330('0x10')]=function(){return function(){return client[_0xc330('0x4')]('GetCampaignHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xc330('0xe'))[_0xc330('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xc330('0xf')](_0xc330('0xe'))[_0xc330('0x8')](_0xc330('0x9'))]},'campaigntype':_0xc330('0x11')},'raw':![]},'log':_0xc330('0x12')});};};