27b9a464ed6c5488437cd69f5b00e2e5b5432ec5
[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 _0xaacc=['YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','Request','GetVoiceQueueHopperHistory','startOf','day','endOf','getCampaignHopperHistory','GetCampaignHopperHistory','ivr','../client','createHistory','queue','avgHandleTime','AvgHandleTime','minutes','format'];(function(_0x562ac9,_0x38ca3c){var _0x329e5b=function(_0x1fff3f){while(--_0x1fff3f){_0x562ac9['push'](_0x562ac9['shift']());}};_0x329e5b(++_0x38ca3c);}(_0xaacc,0x14f));var _0xcaac=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0xaacc[_0x5c9307];return _0x373e29;};'use strict';var client=require(_0xcaac('0x0'));var moment=require('moment');exports[_0xcaac('0x1')]=function(_0x5780ea){_0x5780ea['campaign']=_0x5780ea[_0xcaac('0x2')];return client['Request']('CreateCmHopperHistory',{'body':_0x5780ea,'log':'CreateCmHopperHistory'});};exports[_0xcaac('0x3')]=function(_0x4f4d2e){return client['Request'](_0xcaac('0x4'),{'options':{'where':{'endtime':{'$between':[moment()['subtract'](_0x4f4d2e,_0xcaac('0x5'))[_0xcaac('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xcaac('0x6')](_0xcaac('0x7'))]}},'raw':![]},'log':_0xcaac('0x8')});};exports[_0xcaac('0x9')]=function(){return function(){return client[_0xcaac('0xa')](_0xcaac('0xb'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xcaac('0xc')](_0xcaac('0xd'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xcaac('0xe')](_0xcaac('0xd'))[_0xcaac('0x6')](_0xcaac('0x7'))]},'campaigntype':_0xcaac('0x2')},'raw':![]},'log':_0xcaac('0xb')});};};exports[_0xcaac('0xf')]=function(){return function(){return client[_0xcaac('0xa')](_0xcaac('0x10'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xcaac('0xd'))[_0xcaac('0x6')](_0xcaac('0x7')),moment()[_0xcaac('0xe')](_0xcaac('0xd'))[_0xcaac('0x6')](_0xcaac('0x7'))]},'campaigntype':_0xcaac('0x11')},'raw':![]},'log':'GetCampaignHopperHistory'});};};