d6f2e7953d5e9d8fb885852585cf677000222b07
[motion-next.git] / server / api / cmHopperHistory / cmHopperHistory.rpc.js
1 const a154_0x12d1=['AvgHandleTime','outboundNoAnswerCallsDay','debug','create','CreateCmHopperHistory','outboundCongestionCallsDay','campaign','GetVoiceQueueHopperHistory','options','COUNT','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','error','body','`state`\x20=\x2020,\x201,\x20null','predictiveIntervalTotalCalls','catch','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','raw','outboundAnswerCallsDay','then','CmHopperHistory','predictiveIntervalAvgHoldtime','`state`\x20=\x2012,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','message','`state`\x20=\x2013,\x201,\x20null','name','where','rpc','outboundReCallsDay','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalDroppedCallsCallersExit','../../mysqldb','../../config/logger','`state`\x20=\x204,\x201,\x20null','GetCampaignHopperHistory','outboundRejectCallsDay','stringify','ivrAnswerCallsDay','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalAvgTalktime','outboundDropCallsDayCallersExit','`state`\x20=\x2014,\x201,\x20null','outboundUnknownCallsDay','outboundNoSuchCallsDay','findAll','`state`\x20=\x2011,\x201,\x20null','`state`\x20=\x200,\x201,\x20null','info'];(function(_0x3fb537,_0x12d1f2){const _0x433e2f=function(_0x4f2660){while(--_0x4f2660){_0x3fb537['push'](_0x3fb537['shift']());}};_0x433e2f(++_0x12d1f2);}(a154_0x12d1,0x11e));const a154_0x433e=function(_0x3fb537,_0x12d1f2){_0x3fb537=_0x3fb537-0x0;let _0x433e2f=a154_0x12d1[_0x3fb537];return _0x433e2f;};const _0x437692=a154_0x433e;'use strict';const db=require(_0x437692('0xf'))['db'],{fn,literal,col}=require('sequelize'),logger=require(_0x437692('0x10'))(_0x437692('0xb'));exports[_0x437692('0x24')]=function(_0x4f2660){const _0x311f5e=this;return new Promise(function(_0x133634,_0x5bce63){const _0x1f5f07=a154_0x433e;return db[_0x1f5f07('0x1')][_0x1f5f07('0x23')](_0x4f2660[_0x1f5f07('0x2d')],{'raw':_0x4f2660[_0x1f5f07('0x28')]?_0x4f2660[_0x1f5f07('0x28')][_0x1f5f07('0x33')]===undefined?!![]:![]:!![]})[_0x1f5f07('0x0')](function(_0x4ec84a){const _0x5ea61d=_0x1f5f07;logger[_0x5ea61d('0x1f')](_0x5ea61d('0x24'),_0x4f2660),logger[_0x5ea61d('0x22')](_0x5ea61d('0x24'),_0x4f2660,JSON[_0x5ea61d('0x14')](_0x4ec84a)),_0x133634(_0x4ec84a);})['catch'](function(_0x47d1a0){const _0x53aa83=_0x1f5f07;logger[_0x53aa83('0x2c')](_0x53aa83('0x24'),_0x47d1a0[_0x53aa83('0x7')],_0x4f2660),_0x5bce63(_0x311f5e['error'](0x1f4,_0x47d1a0[_0x53aa83('0x7')]));});});},exports[_0x437692('0x20')]=function(_0x3746da){const _0x461555=this;return new Promise(function(_0x484ca3,_0x5e7c46){const _0x18eb63=a154_0x433e;return db[_0x18eb63('0x1')][_0x18eb63('0x1c')]({'raw':_0x3746da[_0x18eb63('0x28')]?_0x3746da[_0x18eb63('0x28')][_0x18eb63('0x33')]===undefined?!![]:![]:!![],'where':_0x3746da[_0x18eb63('0x28')]?_0x3746da['options'][_0x18eb63('0xa')]||null:null,'attributes':[[fn(_0x18eb63('0x29'),col('id')),_0x18eb63('0x2f')],[fn(_0x18eb63('0x29'),fn('IF',literal(_0x18eb63('0x11')))),'predictiveIntervalAnsweredCalls'],[fn(_0x18eb63('0x29'),fn('IF',literal(_0x18eb63('0x16')))),_0x18eb63('0x4')],[fn(_0x18eb63('0x29'),fn('IF',literal(_0x18eb63('0x1d')))),_0x18eb63('0xe')],[fn('AVG',fn('IF',literal(_0x18eb63('0xd')))),_0x18eb63('0x2')],[fn('AVG',fn('IF',literal('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x18eb63('0x17')]]})[_0x18eb63('0x0')](function(_0x50a1ed){const _0x5286f4=_0x18eb63;logger[_0x5286f4('0x1f')](_0x5286f4('0x20'),_0x3746da),logger[_0x5286f4('0x22')](_0x5286f4('0x20'),_0x3746da,JSON['stringify'](_0x50a1ed)),_0x484ca3(_0x50a1ed);})[_0x18eb63('0x30')](function(_0x4206a4){const _0xd0466b=_0x18eb63;logger[_0xd0466b('0x2c')](_0xd0466b('0x20'),_0x4206a4[_0xd0466b('0x7')],_0x3746da),_0x5e7c46(_0x461555[_0xd0466b('0x2c')](0x1f4,_0x4206a4[_0xd0466b('0x7')]));});});},exports[_0x437692('0x27')]=function(_0x496380){const _0x315e2c=this;return new Promise(function(_0xfacce5,_0x42e097){const _0x479af2=a154_0x433e;return db['CmHopperHistory'][_0x479af2('0x1c')]({'raw':_0x496380[_0x479af2('0x28')]?_0x496380[_0x479af2('0x28')][_0x479af2('0x33')]===undefined?!![]:![]:!![],'where':_0x496380[_0x479af2('0x28')]?_0x496380[_0x479af2('0x28')][_0x479af2('0xa')]||null:null,'attributes':[[_0x479af2('0x26'),_0x479af2('0x9')],[fn(_0x479af2('0x29'),fn('IF',literal(_0x479af2('0x1e')))),_0x479af2('0x1b')],[fn(_0x479af2('0x29'),fn('IF',literal('`state`\x20=\x203,\x201,\x20null'))),_0x479af2('0x21')],[fn(_0x479af2('0x29'),fn('IF',literal(_0x479af2('0x11')))),_0x479af2('0x34')],[fn('COUNT',fn('IF',literal(_0x479af2('0x6')))),'outboundBusyCallsDay'],[fn(_0x479af2('0x29'),fn('IF',literal(_0x479af2('0x2a')))),_0x479af2('0x25')],[fn(_0x479af2('0x29'),fn('IF',literal('`state`\x20=\x2010\x20,\x201,\x20null'))),'outboundDropCallsDayTimeout'],[fn('COUNT',fn('IF',literal(_0x479af2('0x2b')))),_0x479af2('0x18')],[fn(_0x479af2('0x29'),fn('IF',literal(_0x479af2('0x3')))),_0x479af2('0x1a')],[fn('COUNT',fn('IF',literal(_0x479af2('0x8')))),_0x479af2('0x32')],[fn(_0x479af2('0x29'),fn('IF',literal(_0x479af2('0x19')))),'outboundOriginateFailureCallsDay'],[fn(_0x479af2('0x29'),fn('IF',literal('`state`\x20=\x2018,\x201,\x20null'))),_0x479af2('0x13')],[fn('COUNT',fn('IF',literal('`state`\x20=\x2016,\x201,\x20null'))),_0x479af2('0x31')],[fn(_0x479af2('0x29'),fn('IF',literal(_0x479af2('0x2e')))),_0x479af2('0x13')],[fn(_0x479af2('0x29'),fn('IF',literal(_0x479af2('0x5')))),_0x479af2('0xc')]],'group':[_0x479af2('0x26')]})[_0x479af2('0x0')](function(_0x26a766){const _0x560b16=_0x479af2;logger['info'](_0x560b16('0x27'),_0x496380),logger[_0x560b16('0x22')](_0x560b16('0x27'),_0x496380,JSON[_0x560b16('0x14')](_0x26a766)),_0xfacce5(_0x26a766);})[_0x479af2('0x30')](function(_0x29f37a){const _0x5cf363=_0x479af2;logger['error']('GetVoiceQueueHopperHistory',_0x29f37a[_0x5cf363('0x7')],_0x496380),_0x42e097(_0x315e2c[_0x5cf363('0x2c')](0x1f4,_0x29f37a[_0x5cf363('0x7')]));});});},exports[_0x437692('0x12')]=function(_0x19dc2c){const _0x1125e3=this;return new Promise(function(_0x2231c2,_0x4cd8eb){const _0x2dfa36=a154_0x433e;return db[_0x2dfa36('0x1')][_0x2dfa36('0x1c')]({'raw':_0x19dc2c[_0x2dfa36('0x28')]?_0x19dc2c[_0x2dfa36('0x28')][_0x2dfa36('0x33')]===undefined?!![]:![]:!![],'where':_0x19dc2c[_0x2dfa36('0x28')]?_0x19dc2c['options'][_0x2dfa36('0xa')]||null:null,'attributes':[['campaign',_0x2dfa36('0x9')],[fn(_0x2dfa36('0x29'),col('id')),'ivrTotalCallsDays'],[fn('COUNT',fn('IF',literal(_0x2dfa36('0x11')))),_0x2dfa36('0x15')]],'group':[_0x2dfa36('0x26')]})['then'](function(_0x107515){const _0x45d5c6=_0x2dfa36;logger[_0x45d5c6('0x1f')](_0x45d5c6('0x12'),_0x19dc2c),logger['debug'](_0x45d5c6('0x12'),_0x19dc2c,JSON[_0x45d5c6('0x14')](_0x107515)),_0x2231c2(_0x107515);})[_0x2dfa36('0x30')](function(_0x27c220){const _0x592e85=_0x2dfa36;logger[_0x592e85('0x2c')]('GetCampaignHopperHistory',_0x27c220[_0x592e85('0x7')],_0x19dc2c),_0x4cd8eb(_0x1125e3['error'](0x1f4,_0x27c220['message']));});});};