Built motion from commit df3e9871f6bcc3432fec345b2f4facbd4dba8b5c. Version 3.0.0...
[motion-next.git] / server / api / cmHopperFinal / cmHopperFinal.controller.js
index a01bc44..2e82fa9 100644 (file)
@@ -1 +1 @@
-const a147_0x5b3c=['Campaign','NOW()','VoiceQueueId','send','ANY_VALUE(ListId)','`state`\x20=\x208,\x201,\x20null','ListId','busyContacts','`state`\x20=\x2019,\x201,\x20null','fromQuery','dropContacts','intersection','moveContactsIvrCampaignHopperFinal','undefined','query','reCallContacts','name','../../config/logger','offset','squel','index','cm_hopper','VoiceQueueId\x20=\x20?','filter','error','CampaignId\x20=\x20?','createdAt','calleridnum\x20NOT\x20IN\x20(?)','type','set','where','select','like','`state`\x20=\x2011\x20,\x201,\x20null','group','include','options','pick','`state`\x20=\x205,\x201,\x20null','params','ANY_VALUE(VoiceQueueId)','`state`\x20=\x2010\x20,\x201,\x20null','answeringMachine','order','CampaignId','rawAttributes','calleridnum','field','noSuchContacts','count','ContactId','abandonedContacts','phone','filters','moveContactsQueueCampaignHopperFinal','fields','uniqueid','sort','limit','../../mysqldb','`state`\x20=\x203,\x201,\x20null','attributes','model','toString','checkContactHopper','VoiceQueue','ANY_VALUE(calleridnum)','map','CmHopperFinal','ANY_VALUE(ContactId)','state','fieldName','update','keys','body','from','merge','lodash','findAll','stack','countContactsIvrCampaignHopperFinal','nolimit','../../components/parsers/qs','describe','sequelize','scheduledAt','noAnswerContacts','catch','cm_hopper_final','then','show','COUNT','json','key','status','findOne','congestionContacts','updatedAt','state\x20=\x204','state\x20=\x20?','into','includeAll','length','calleridnum\x20IS\x20NOT\x20NULL','insert','api','countContactsQueueCampaignHopperFinal'];(function(_0x3edf5c,_0x5b3c87){const _0x69a51c=function(_0x3321b4){while(--_0x3321b4){_0x3edf5c['push'](_0x3edf5c['shift']());}};_0x69a51c(++_0x5b3c87);}(a147_0x5b3c,0xf6));const a147_0x69a5=function(_0x3edf5c,_0x5b3c87){_0x3edf5c=_0x3edf5c-0x0;let _0x69a51c=a147_0x5b3c[_0x3edf5c];return _0x69a51c;};const _0x333322=a147_0x69a5;'use strict';const _=require(_0x333322('0x2d')),squel=require(_0x333322('0x5e')),qs=require(_0x333322('0x32')),logger=require(_0x333322('0x5c'))(_0x333322('0x49')),db=require(_0x333322('0x1b'))['db'],{Op,fn,literal}=require(_0x333322('0x34'));function respondWithResult(_0x3321b4,_0x358c48){return _0x358c48=_0x358c48||0xc8,function(_0x3311f3){const _0x515d98=a147_0x69a5;if(_0x3311f3)return _0x3321b4[_0x515d98('0x3e')](_0x358c48)[_0x515d98('0x3c')](_0x3311f3);};}function respondWithFilteredResult(_0x209811,_0x3adc4b){return function(_0x54e960){const _0x5e0c20=a147_0x69a5;if(_0x54e960){const _0x4d9c90=_0x54e960[_0x5e0c20('0x11')],_0x1c7367=_0x3adc4b[_0x5e0c20('0x5d')];let _0x4928e7=_0x3adc4b['offset']+_0x3adc4b[_0x5e0c20('0x1a')],_0x4a3674;return _0x4928e7>=_0x4d9c90?(_0x4928e7=_0x4d9c90,_0x4a3674=0xc8):_0x4a3674=0xce,_0x209811[_0x5e0c20('0x3e')](_0x4a3674),_0x209811[_0x5e0c20('0x68')]('Content-Range',_0x1c7367+'-'+_0x4928e7+'/'+_0x4d9c90)[_0x5e0c20('0x3c')](_0x54e960);}return null;};}function saveUpdates(_0x3e5de8){return function(_0x41142c){const _0x2f13ed=a147_0x69a5;if(_0x41142c)return _0x41142c[_0x2f13ed('0x28')](_0x3e5de8)[_0x2f13ed('0x39')](function(_0x12c3fa){return _0x12c3fa;});return null;};}function handleEntityNotFound(_0x34140b){return function(_0x25bc4e){return!_0x25bc4e&&_0x34140b['sendStatus'](0x194),_0x25bc4e;};}function handleError(_0x3b7c96,_0x5a77a5){return _0x5a77a5=_0x5a77a5||0x1f4,function(_0x5dfc40){const _0x5305ad=a147_0x69a5;logger[_0x5305ad('0x63')](_0x5dfc40[_0x5305ad('0x2f')]),_0x5dfc40[_0x5305ad('0x5b')]&&delete _0x5dfc40[_0x5305ad('0x5b')],_0x3b7c96[_0x5305ad('0x3e')](_0x5a77a5)[_0x5305ad('0x4e')](_0x5dfc40);};}exports[_0x333322('0x5f')]=function(_0x294878,_0x49213f){const _0x37ebb5=_0x333322;let _0x5c23ac={};const _0x2fb794={},_0x30113b={'count':0x0,'rows':[]},_0x21e4dc=_[_0x37ebb5('0x23')](db[_0x37ebb5('0x24')][_0x37ebb5('0xd')],function(_0x4547b3){const _0x534b2f=_0x37ebb5;return{'name':_0x4547b3[_0x534b2f('0x27')],'type':_0x4547b3[_0x534b2f('0x67')][_0x534b2f('0x3d')]};});_0x2fb794[_0x37ebb5('0x1e')]=_[_0x37ebb5('0x23')](_0x21e4dc,_0x37ebb5('0x5b')),_0x2fb794[_0x37ebb5('0x59')]=_[_0x37ebb5('0x29')](_0x294878['query']),_0x2fb794[_0x37ebb5('0x15')]=_[_0x37ebb5('0x56')](_0x2fb794[_0x37ebb5('0x1e')],_0x2fb794[_0x37ebb5('0x59')]),_0x5c23ac['attributes']=_[_0x37ebb5('0x56')](_0x2fb794[_0x37ebb5('0x1e')],qs[_0x37ebb5('0x17')](_0x294878[_0x37ebb5('0x59')][_0x37ebb5('0x17')])),_0x5c23ac['attributes']=_0x5c23ac[_0x37ebb5('0x1d')][_0x37ebb5('0x46')]?_0x5c23ac[_0x37ebb5('0x1d')]:_0x2fb794[_0x37ebb5('0x1e')];typeof _0x294878[_0x37ebb5('0x59')][_0x37ebb5('0x31')]===_0x37ebb5('0x58')&&(_0x5c23ac['limit']=qs[_0x37ebb5('0x1a')](_0x294878['query']['limit']),_0x5c23ac[_0x37ebb5('0x5d')]=qs[_0x37ebb5('0x5d')](_0x294878[_0x37ebb5('0x59')][_0x37ebb5('0x5d')]));_0x5c23ac[_0x37ebb5('0xb')]=qs[_0x37ebb5('0x19')](_0x294878[_0x37ebb5('0x59')][_0x37ebb5('0x19')]),_0x5c23ac[_0x37ebb5('0x69')]=qs[_0x37ebb5('0x15')](_[_0x37ebb5('0x5')](_0x294878[_0x37ebb5('0x59')],_0x2fb794['filters']),_0x21e4dc);_0x294878['query']['filter']&&(_0x5c23ac[_0x37ebb5('0x69')]=_[_0x37ebb5('0x2c')](_0x5c23ac[_0x37ebb5('0x69')],{[Op['or']]:_[_0x37ebb5('0x23')](_0x21e4dc,function(_0x129c50){const _0x15054a=_0x37ebb5;if(_0x129c50[_0x15054a('0x67')]!=='VIRTUAL'){const _0x54535e={};return _0x54535e[_0x129c50['name']]={[Op[_0x15054a('0x0')]]:'%'+_0x294878[_0x15054a('0x59')][_0x15054a('0x62')]+'%'},_0x54535e;}})}));_0x5c23ac=_[_0x37ebb5('0x2c')]({},_0x5c23ac,_0x294878[_0x37ebb5('0x4')]);const _0x253c86={'where':_0x5c23ac[_0x37ebb5('0x69')]};return db[_0x37ebb5('0x24')][_0x37ebb5('0x11')](_0x253c86)['then'](function(_0x2d9366){const _0x1cdafc=_0x37ebb5;return _0x30113b[_0x1cdafc('0x11')]=_0x2d9366,_0x294878[_0x1cdafc('0x59')][_0x1cdafc('0x45')]&&(_0x5c23ac[_0x1cdafc('0x3')]=[{'all':!![]}]),db[_0x1cdafc('0x24')][_0x1cdafc('0x2e')](_0x5c23ac);})['then'](function(_0x2b3df0){return _0x30113b['rows']=_0x2b3df0,_0x30113b;})[_0x37ebb5('0x39')](respondWithFilteredResult(_0x49213f,_0x5c23ac))['catch'](handleError(_0x49213f,null));},exports[_0x333322('0x3a')]=function(_0x2642cd,_0x25f35a){const _0x32d889=_0x333322;let _0x4ec163={'raw':!![],'where':{'id':_0x2642cd['params']['id']}};const _0x4a795d={};return _0x4a795d['model']=_[_0x32d889('0x29')](db['CmHopperFinal'][_0x32d889('0xd')]),_0x4a795d[_0x32d889('0x59')]=_[_0x32d889('0x29')](_0x2642cd[_0x32d889('0x59')]),_0x4a795d[_0x32d889('0x15')]=_[_0x32d889('0x56')](_0x4a795d[_0x32d889('0x1e')],_0x4a795d[_0x32d889('0x59')]),_0x4ec163['attributes']=_[_0x32d889('0x56')](_0x4a795d[_0x32d889('0x1e')],qs['fields'](_0x2642cd[_0x32d889('0x59')][_0x32d889('0x17')])),_0x4ec163[_0x32d889('0x1d')]=_0x4ec163[_0x32d889('0x1d')][_0x32d889('0x46')]?_0x4ec163[_0x32d889('0x1d')]:_0x4a795d['model'],_0x2642cd['query'][_0x32d889('0x45')]&&(_0x4ec163[_0x32d889('0x3')]=[{'all':!![]}]),_0x4ec163=_[_0x32d889('0x2c')]({},_0x4ec163,_0x2642cd[_0x32d889('0x4')]),db[_0x32d889('0x24')][_0x32d889('0x3f')](_0x4ec163)[_0x32d889('0x39')](handleEntityNotFound(_0x25f35a,null))[_0x32d889('0x39')](respondWithResult(_0x25f35a,null))['catch'](handleError(_0x25f35a,null));},exports[_0x333322('0x33')]=function(_0x386b07,_0x53012a){const _0x4acaa1=_0x333322;return db[_0x4acaa1('0x24')][_0x4acaa1('0x33')]()['then'](respondWithResult(_0x53012a,null))[_0x4acaa1('0x37')](handleError(_0x53012a,null));},exports[_0x333322('0x28')]=function(_0x3c179b,_0x1a5640){const _0x15d129=_0x333322;return _0x3c179b[_0x15d129('0x2a')][_0x15d129('0x18')]&&delete _0x3c179b[_0x15d129('0x2a')][_0x15d129('0x18')],db['CmHopperFinal'][_0x15d129('0x3f')]({'where':{'uniqueid':_0x3c179b['params']['id']}})[_0x15d129('0x39')](handleEntityNotFound(_0x1a5640,null))[_0x15d129('0x39')](saveUpdates(_0x3c179b[_0x15d129('0x2a')],null))['then'](respondWithResult(_0x1a5640,null))[_0x15d129('0x37')](handleError(_0x1a5640,null));},exports[_0x333322('0x4a')]=function(_0x866818,_0x7476bc){const _0x72bec6=_0x333322;return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x866818[_0x72bec6('0x7')]['id']},'attributes':[[fn(_0x72bec6('0x3b'),fn('IF',literal('`state`\x20=\x200,\x201,\x20null'))),_0x72bec6('0x10')],[fn('COUNT',fn('IF',literal(_0x72bec6('0x1c')))),_0x72bec6('0x36')],[fn(_0x72bec6('0x3b'),fn('IF',literal(_0x72bec6('0x6')))),_0x72bec6('0x52')],[fn(_0x72bec6('0x3b'),fn('IF',literal(_0x72bec6('0x50')))),_0x72bec6('0x40')],[fn(_0x72bec6('0x3b'),fn('IF',literal('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x72bec6('0x55')],[fn(_0x72bec6('0x3b'),fn('IF',literal(_0x72bec6('0x1')))),'abandonedContacts'],[fn(_0x72bec6('0x3b'),fn('IF',literal('`state`\x20=\x2022,\x201,\x20null'))),_0x72bec6('0x5a')],[fn('COUNT',fn('IF',literal('`state`\x20=\x2019,\x201,\x20null'))),_0x72bec6('0xa')]]})[_0x72bec6('0x39')](handleEntityNotFound(_0x7476bc,null))[_0x72bec6('0x39')](respondWithResult(_0x7476bc,null))['catch'](handleError(_0x7476bc,null));},exports[_0x333322('0x30')]=function(_0x56f507,_0x4616a9){const _0x571952=_0x333322;return db['CmHopperFinal'][_0x571952('0x2e')]({'raw':![],'where':{'CampaignId':_0x56f507['params']['id']},'attributes':[[fn('COUNT',fn('IF',literal('`state`\x20=\x200,\x201,\x20null'))),_0x571952('0x10')],[fn(_0x571952('0x3b'),fn('IF',literal(_0x571952('0x1c')))),_0x571952('0x36')],[fn(_0x571952('0x3b'),fn('IF',literal(_0x571952('0x6')))),'busyContacts'],[fn('COUNT',fn('IF',literal('`state`\x20=\x208,\x201,\x20null'))),_0x571952('0x40')],[fn(_0x571952('0x3b'),fn('IF',literal(_0x571952('0x9')))),_0x571952('0x55')],[fn(_0x571952('0x3b'),fn('IF',literal('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x571952('0x13')],[fn(_0x571952('0x3b'),fn('IF',literal('`state`\x20=\x2022,\x201,\x20null'))),_0x571952('0x5a')],[fn(_0x571952('0x3b'),fn('IF',literal(_0x571952('0x53')))),_0x571952('0xa')]]})['then'](handleEntityNotFound(_0x4616a9,null))[_0x571952('0x39')](respondWithResult(_0x4616a9,null))[_0x571952('0x37')](handleError(_0x4616a9,null));},exports[_0x333322('0x16')]=function(_0x218c11,_0x3e3b04){const _0x22f0ff=_0x333322;return db[_0x22f0ff('0x21')][_0x22f0ff('0x3f')]({'where':{'id':_0x218c11[_0x22f0ff('0x7')]['id']}})['then'](handleEntityNotFound(_0x3e3b04,null))[_0x22f0ff('0x39')](function(_0xbf2052){const _0x4178d9=_0x22f0ff;let _0x5b851f;if(_0xbf2052)return _0x5b851f=squel[_0x4178d9('0x48')]()[_0x4178d9('0x44')](_0x4178d9('0x60'))[_0x4178d9('0x54')]([_0x4178d9('0x14'),'scheduledAt',_0x4178d9('0x12'),_0x4178d9('0x51'),'VoiceQueueId','createdAt',_0x4178d9('0x41')],squel[_0x4178d9('0x6a')]()[_0x4178d9('0xf')](_0x4178d9('0x22'),'phone')[_0x4178d9('0xf')](_0x4178d9('0x4c'),_0x4178d9('0x35'))[_0x4178d9('0xf')](_0x4178d9('0x25'),'ContactId')[_0x4178d9('0xf')]('ANY_VALUE(ListId)',_0x4178d9('0x51'))['field'](_0x4178d9('0x8'),_0x4178d9('0x4d'))[_0x4178d9('0xf')](_0x4178d9('0x4c'),_0x4178d9('0x65'))[_0x4178d9('0xf')]('NOW()',_0x4178d9('0x41'))[_0x4178d9('0x2b')]('cm_hopper_final')[_0x4178d9('0x69')](_0x4178d9('0x61'),_0x218c11[_0x4178d9('0x7')]['id'][_0x4178d9('0x1f')]())[_0x4178d9('0x69')](_0x4178d9('0x43'),_0x218c11['body'][_0x4178d9('0x26')][_0x4178d9('0x1f')]())[_0x4178d9('0x69')](_0x4178d9('0x47'))[_0x4178d9('0x69')](_0x4178d9('0x66'),squel[_0x4178d9('0x6a')]()[_0x4178d9('0xf')](_0x4178d9('0x14'))[_0x4178d9('0x2b')](_0x4178d9('0x60'))['where'](_0x4178d9('0x61'),_0x218c11['params']['id']['toString']()))[_0x4178d9('0x69')](_0x4178d9('0x66'),squel['select']()[_0x4178d9('0xf')]('calleridnum')['from'](_0x4178d9('0x38'))[_0x4178d9('0x69')](_0x4178d9('0x61'),_0x218c11[_0x4178d9('0x7')]['id'][_0x4178d9('0x1f')]())[_0x4178d9('0x69')](_0x4178d9('0x42')))['group'](_0x4178d9('0x12')))['toString'](),db[_0x4178d9('0x34')]['query'](_0x5b851f);return[];})[_0x22f0ff('0x39')](respondWithResult(_0x3e3b04,null))['catch'](handleError(_0x3e3b04,null));},exports[_0x333322('0x57')]=function(_0x251392,_0x1b079b){const _0x31bb99=_0x333322;return db[_0x31bb99('0x4b')][_0x31bb99('0x3f')]({'where':{'id':_0x251392[_0x31bb99('0x7')]['id']}})['then'](handleEntityNotFound(_0x1b079b,null))['then'](function(_0x3035ba){const _0x1ee60a=_0x31bb99;let _0x2c1d8c;if(_0x3035ba)return _0x2c1d8c=squel[_0x1ee60a('0x48')]()[_0x1ee60a('0x44')]('cm_hopper')[_0x1ee60a('0x54')]([_0x1ee60a('0x14'),_0x1ee60a('0x35'),_0x1ee60a('0x12'),_0x1ee60a('0x51'),_0x1ee60a('0xc'),_0x1ee60a('0x65'),_0x1ee60a('0x41')],squel['select']()[_0x1ee60a('0xf')](_0x1ee60a('0x22'),_0x1ee60a('0x14'))['field']('NOW()',_0x1ee60a('0x35'))[_0x1ee60a('0xf')](_0x1ee60a('0x25'),_0x1ee60a('0x12'))[_0x1ee60a('0xf')](_0x1ee60a('0x4f'),_0x1ee60a('0x51'))['field']('ANY_VALUE(CampaignId)',_0x1ee60a('0xc'))[_0x1ee60a('0xf')](_0x1ee60a('0x4c'),_0x1ee60a('0x65'))[_0x1ee60a('0xf')](_0x1ee60a('0x4c'),'updatedAt')['from']('cm_hopper_final')[_0x1ee60a('0x69')]('CampaignId\x20=\x20?',_0x251392[_0x1ee60a('0x7')]['id'][_0x1ee60a('0x1f')]())[_0x1ee60a('0x69')](_0x1ee60a('0x43'),_0x251392['body']['state'][_0x1ee60a('0x1f')]())[_0x1ee60a('0x69')](_0x1ee60a('0x47'))[_0x1ee60a('0x69')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x1ee60a('0xf')]('phone')[_0x1ee60a('0x2b')](_0x1ee60a('0x60'))[_0x1ee60a('0x69')](_0x1ee60a('0x64'),_0x251392[_0x1ee60a('0x7')]['id']['toString']()))[_0x1ee60a('0x69')](_0x1ee60a('0x66'),squel[_0x1ee60a('0x6a')]()['field'](_0x1ee60a('0xe'))[_0x1ee60a('0x2b')](_0x1ee60a('0x38'))[_0x1ee60a('0x69')](_0x1ee60a('0x64'),_0x251392[_0x1ee60a('0x7')]['id'][_0x1ee60a('0x1f')]())[_0x1ee60a('0x69')](_0x1ee60a('0x42')))[_0x1ee60a('0x2')](_0x1ee60a('0x12')))[_0x1ee60a('0x1f')](),db['sequelize'][_0x1ee60a('0x59')](_0x2c1d8c);return[];})[_0x31bb99('0x39')](respondWithResult(_0x1b079b,null))[_0x31bb99('0x37')](handleError(_0x1b079b,null));},exports[_0x333322('0x20')]=function(_0x1988e6,_0x32a768){const _0x2f19c4=_0x333322;return db['CmHopper'][_0x2f19c4('0x3f')]({'where':{'VoiceQueueId':_0x1988e6[_0x2f19c4('0x2a')][_0x2f19c4('0x4d')],'CampaignId':_0x1988e6[_0x2f19c4('0x2a')][_0x2f19c4('0xc')],'ContactId':_0x1988e6[_0x2f19c4('0x2a')][_0x2f19c4('0x12')]}})['then'](handleEntityNotFound(_0x32a768,null))['then'](function(_0x1b2899){if(_0x1b2899)return _0x1b2899;return null;})['then'](respondWithResult(_0x32a768,null))[_0x2f19c4('0x37')](handleError(_0x32a768,null));};
\ No newline at end of file
+const a147_0x1fce=['scheduledAt','createdAt','set','../../mysqldb','query','params','catch','calleridnum\x20IS\x20NOT\x20NULL','VoiceQueueId\x20=\x20?','moveContactsIvrCampaignHopperFinal','field','send','dropContacts','busyContacts','name','calleridnum','`state`\x20=\x2019,\x201,\x20null','state\x20=\x20?','count','model','sort','`state`\x20=\x205,\x201,\x20null','describe','answeringMachine','state\x20=\x204','state','`state`\x20=\x203,\x201,\x20null','order','sendStatus','`state`\x20=\x200,\x201,\x20null','show','includeAll','fromQuery','attributes','rawAttributes','where','updatedAt','options','findOne','status','congestionContacts','intersection','phone','insert','`state`\x20=\x2010\x20,\x201,\x20null','noAnswerContacts','findAll','ANY_VALUE(ContactId)','`state`\x20=\x2011\x20,\x201,\x20null','VoiceQueue','type','noSuchContacts','CmHopperFinal','ANY_VALUE(calleridnum)','rows','countContactsQueueCampaignHopperFinal','ANY_VALUE(ListId)','pick','ANY_VALUE(CampaignId)','COUNT','cm_hopper','NOW()','group','abandonedContacts','length','index','`state`\x20=\x2022,\x201,\x20null','stack','countContactsIvrCampaignHopperFinal','CmHopper','from','sequelize','moveContactsQueueCampaignHopperFinal','VoiceQueueId','ContactId','like','select','then','filters','map','fields','include','merge','`state`\x20=\x208,\x201,\x20null','reCallContacts','json','uniqueid','calleridnum\x20NOT\x20IN\x20(?)','ListId','Content-Range','../../config/logger','checkContactHopper','update','keys','CampaignId','lodash','filter','Campaign','offset','limit','toString','body','cm_hopper_final'];(function(_0x172a92,_0x1fce4c){const _0xb47650=function(_0x1e9bfe){while(--_0x1e9bfe){_0x172a92['push'](_0x172a92['shift']());}};_0xb47650(++_0x1fce4c);}(a147_0x1fce,0x123));const a147_0xb476=function(_0x172a92,_0x1fce4c){_0x172a92=_0x172a92-0x0;let _0xb47650=a147_0x1fce[_0x172a92];return _0xb47650;};const _0x2ee6b2=a147_0xb476;'use strict';const _=require(_0x2ee6b2('0xa')),squel=require('squel'),qs=require('../../components/parsers/qs'),logger=require(_0x2ee6b2('0x5'))('api'),db=require(_0x2ee6b2('0x15'))['db'],{Op,fn,literal}=require('sequelize');function respondWithResult(_0x1e9bfe,_0x12c123){return _0x12c123=_0x12c123||0xc8,function(_0x8c4483){const _0x3a7540=a147_0xb476;if(_0x8c4483)return _0x1e9bfe[_0x3a7540('0x39')](_0x12c123)[_0x3a7540('0x0')](_0x8c4483);};}function respondWithFilteredResult(_0xb1ca61,_0x103cf3){return function(_0x450d0e){const _0x318235=a147_0xb476;if(_0x450d0e){const _0x490b63=_0x450d0e[_0x318235('0x24')],_0x438f5c=_0x103cf3[_0x318235('0xd')];let _0x197370=_0x103cf3[_0x318235('0xd')]+_0x103cf3[_0x318235('0xe')],_0x35cdd4;return _0x197370>=_0x490b63?(_0x197370=_0x490b63,_0x35cdd4=0xc8):_0x35cdd4=0xce,_0xb1ca61[_0x318235('0x39')](_0x35cdd4),_0xb1ca61[_0x318235('0x14')](_0x318235('0x4'),_0x438f5c+'-'+_0x197370+'/'+_0x490b63)[_0x318235('0x0')](_0x450d0e);}return null;};}function saveUpdates(_0x44a647){return function(_0x5c5401){const _0x1408a0=a147_0xb476;if(_0x5c5401)return _0x5c5401[_0x1408a0('0x7')](_0x44a647)['then'](function(_0x21d394){return _0x21d394;});return null;};}function handleEntityNotFound(_0xea9b86){return function(_0x2d2146){const _0x9b4f6d=a147_0xb476;return!_0x2d2146&&_0xea9b86[_0x9b4f6d('0x2e')](0x194),_0x2d2146;};}function handleError(_0x74cad1,_0x128f2b){return _0x128f2b=_0x128f2b||0x1f4,function(_0x3bb794){const _0x78d17c=a147_0xb476;logger['error'](_0x3bb794[_0x78d17c('0x55')]),_0x3bb794[_0x78d17c('0x20')]&&delete _0x3bb794[_0x78d17c('0x20')],_0x74cad1[_0x78d17c('0x39')](_0x128f2b)[_0x78d17c('0x1d')](_0x3bb794);};}exports[_0x2ee6b2('0x53')]=function(_0x17298d,_0x3b10f4){const _0x165b5a=_0x2ee6b2;let _0x4f9cc1={};const _0x41c8f9={},_0xb76e68={'count':0x0,'rows':[]},_0x3c9c4c=_[_0x165b5a('0x61')](db[_0x165b5a('0x46')]['rawAttributes'],function(_0x49a9f6){const _0x28a4b5=_0x165b5a;return{'name':_0x49a9f6['fieldName'],'type':_0x49a9f6[_0x28a4b5('0x44')]['key']};});_0x41c8f9[_0x165b5a('0x25')]=_[_0x165b5a('0x61')](_0x3c9c4c,_0x165b5a('0x20')),_0x41c8f9[_0x165b5a('0x16')]=_[_0x165b5a('0x8')](_0x17298d['query']),_0x41c8f9[_0x165b5a('0x60')]=_[_0x165b5a('0x3b')](_0x41c8f9['model'],_0x41c8f9[_0x165b5a('0x16')]),_0x4f9cc1['attributes']=_['intersection'](_0x41c8f9[_0x165b5a('0x25')],qs[_0x165b5a('0x62')](_0x17298d[_0x165b5a('0x16')]['fields'])),_0x4f9cc1[_0x165b5a('0x33')]=_0x4f9cc1[_0x165b5a('0x33')][_0x165b5a('0x52')]?_0x4f9cc1[_0x165b5a('0x33')]:_0x41c8f9[_0x165b5a('0x25')];typeof _0x17298d[_0x165b5a('0x16')]['nolimit']==='undefined'&&(_0x4f9cc1[_0x165b5a('0xe')]=qs[_0x165b5a('0xe')](_0x17298d[_0x165b5a('0x16')][_0x165b5a('0xe')]),_0x4f9cc1[_0x165b5a('0xd')]=qs['offset'](_0x17298d[_0x165b5a('0x16')][_0x165b5a('0xd')]));_0x4f9cc1[_0x165b5a('0x2d')]=qs[_0x165b5a('0x26')](_0x17298d[_0x165b5a('0x16')][_0x165b5a('0x26')]),_0x4f9cc1['where']=qs[_0x165b5a('0x60')](_[_0x165b5a('0x4b')](_0x17298d[_0x165b5a('0x16')],_0x41c8f9[_0x165b5a('0x60')]),_0x3c9c4c);_0x17298d['query'][_0x165b5a('0xb')]&&(_0x4f9cc1[_0x165b5a('0x35')]=_[_0x165b5a('0x64')](_0x4f9cc1['where'],{[Op['or']]:_[_0x165b5a('0x61')](_0x3c9c4c,function(_0x1873d9){const _0x3070da=_0x165b5a;if(_0x1873d9['type']!=='VIRTUAL'){const _0x5bdf3d={};return _0x5bdf3d[_0x1873d9[_0x3070da('0x20')]]={[Op[_0x3070da('0x5d')]]:'%'+_0x17298d[_0x3070da('0x16')][_0x3070da('0xb')]+'%'},_0x5bdf3d;}})}));_0x4f9cc1=_[_0x165b5a('0x64')]({},_0x4f9cc1,_0x17298d[_0x165b5a('0x37')]);const _0x8e2d33={'where':_0x4f9cc1['where']};return db[_0x165b5a('0x46')][_0x165b5a('0x24')](_0x8e2d33)[_0x165b5a('0x5f')](function(_0x52c923){const _0x2dc26b=_0x165b5a;return _0xb76e68['count']=_0x52c923,_0x17298d[_0x2dc26b('0x16')][_0x2dc26b('0x31')]&&(_0x4f9cc1[_0x2dc26b('0x63')]=[{'all':!![]}]),db[_0x2dc26b('0x46')][_0x2dc26b('0x40')](_0x4f9cc1);})[_0x165b5a('0x5f')](function(_0x560db8){const _0xc7df4e=_0x165b5a;return _0xb76e68[_0xc7df4e('0x48')]=_0x560db8,_0xb76e68;})[_0x165b5a('0x5f')](respondWithFilteredResult(_0x3b10f4,_0x4f9cc1))[_0x165b5a('0x18')](handleError(_0x3b10f4,null));},exports[_0x2ee6b2('0x30')]=function(_0x35868a,_0x11cc6b){const _0x3cdc75=_0x2ee6b2;let _0x40d738={'raw':!![],'where':{'id':_0x35868a[_0x3cdc75('0x17')]['id']}};const _0x324639={};return _0x324639[_0x3cdc75('0x25')]=_[_0x3cdc75('0x8')](db['CmHopperFinal'][_0x3cdc75('0x34')]),_0x324639[_0x3cdc75('0x16')]=_[_0x3cdc75('0x8')](_0x35868a[_0x3cdc75('0x16')]),_0x324639['filters']=_['intersection'](_0x324639[_0x3cdc75('0x25')],_0x324639[_0x3cdc75('0x16')]),_0x40d738[_0x3cdc75('0x33')]=_[_0x3cdc75('0x3b')](_0x324639[_0x3cdc75('0x25')],qs[_0x3cdc75('0x62')](_0x35868a[_0x3cdc75('0x16')][_0x3cdc75('0x62')])),_0x40d738[_0x3cdc75('0x33')]=_0x40d738['attributes'][_0x3cdc75('0x52')]?_0x40d738[_0x3cdc75('0x33')]:_0x324639[_0x3cdc75('0x25')],_0x35868a['query'][_0x3cdc75('0x31')]&&(_0x40d738[_0x3cdc75('0x63')]=[{'all':!![]}]),_0x40d738=_[_0x3cdc75('0x64')]({},_0x40d738,_0x35868a[_0x3cdc75('0x37')]),db[_0x3cdc75('0x46')][_0x3cdc75('0x38')](_0x40d738)[_0x3cdc75('0x5f')](handleEntityNotFound(_0x11cc6b,null))[_0x3cdc75('0x5f')](respondWithResult(_0x11cc6b,null))[_0x3cdc75('0x18')](handleError(_0x11cc6b,null));},exports[_0x2ee6b2('0x28')]=function(_0x132f44,_0x34d4cc){const _0x1c6309=_0x2ee6b2;return db[_0x1c6309('0x46')]['describe']()['then'](respondWithResult(_0x34d4cc,null))[_0x1c6309('0x18')](handleError(_0x34d4cc,null));},exports[_0x2ee6b2('0x7')]=function(_0x3b1fa7,_0x2efd7b){const _0x4888b6=_0x2ee6b2;return _0x3b1fa7[_0x4888b6('0x10')][_0x4888b6('0x1')]&&delete _0x3b1fa7[_0x4888b6('0x10')][_0x4888b6('0x1')],db['CmHopperFinal']['findOne']({'where':{'uniqueid':_0x3b1fa7[_0x4888b6('0x17')]['id']}})['then'](handleEntityNotFound(_0x2efd7b,null))[_0x4888b6('0x5f')](saveUpdates(_0x3b1fa7[_0x4888b6('0x10')],null))[_0x4888b6('0x5f')](respondWithResult(_0x2efd7b,null))['catch'](handleError(_0x2efd7b,null));},exports[_0x2ee6b2('0x49')]=function(_0x17f63e,_0x58dd40){const _0x2b09eb=_0x2ee6b2;return db[_0x2b09eb('0x46')][_0x2b09eb('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x17f63e[_0x2b09eb('0x17')]['id']},'attributes':[[fn(_0x2b09eb('0x4d'),fn('IF',literal(_0x2b09eb('0x2f')))),_0x2b09eb('0x45')],[fn(_0x2b09eb('0x4d'),fn('IF',literal(_0x2b09eb('0x2c')))),_0x2b09eb('0x3f')],[fn(_0x2b09eb('0x4d'),fn('IF',literal(_0x2b09eb('0x27')))),_0x2b09eb('0x1f')],[fn(_0x2b09eb('0x4d'),fn('IF',literal(_0x2b09eb('0x65')))),_0x2b09eb('0x3a')],[fn(_0x2b09eb('0x4d'),fn('IF',literal(_0x2b09eb('0x3e')))),_0x2b09eb('0x1e')],[fn(_0x2b09eb('0x4d'),fn('IF',literal(_0x2b09eb('0x42')))),_0x2b09eb('0x51')],[fn(_0x2b09eb('0x4d'),fn('IF',literal('`state`\x20=\x2022,\x201,\x20null'))),_0x2b09eb('0x66')],[fn(_0x2b09eb('0x4d'),fn('IF',literal(_0x2b09eb('0x22')))),_0x2b09eb('0x29')]]})[_0x2b09eb('0x5f')](handleEntityNotFound(_0x58dd40,null))[_0x2b09eb('0x5f')](respondWithResult(_0x58dd40,null))[_0x2b09eb('0x18')](handleError(_0x58dd40,null));},exports[_0x2ee6b2('0x56')]=function(_0x42e711,_0x126135){const _0x227a64=_0x2ee6b2;return db[_0x227a64('0x46')][_0x227a64('0x40')]({'raw':![],'where':{'CampaignId':_0x42e711[_0x227a64('0x17')]['id']},'attributes':[[fn(_0x227a64('0x4d'),fn('IF',literal(_0x227a64('0x2f')))),_0x227a64('0x45')],[fn(_0x227a64('0x4d'),fn('IF',literal(_0x227a64('0x2c')))),_0x227a64('0x3f')],[fn(_0x227a64('0x4d'),fn('IF',literal(_0x227a64('0x27')))),'busyContacts'],[fn(_0x227a64('0x4d'),fn('IF',literal(_0x227a64('0x65')))),_0x227a64('0x3a')],[fn('COUNT',fn('IF',literal('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x227a64('0x1e')],[fn('COUNT',fn('IF',literal(_0x227a64('0x42')))),_0x227a64('0x51')],[fn(_0x227a64('0x4d'),fn('IF',literal(_0x227a64('0x54')))),_0x227a64('0x66')],[fn('COUNT',fn('IF',literal(_0x227a64('0x22')))),'answeringMachine']]})[_0x227a64('0x5f')](handleEntityNotFound(_0x126135,null))[_0x227a64('0x5f')](respondWithResult(_0x126135,null))[_0x227a64('0x18')](handleError(_0x126135,null));},exports[_0x2ee6b2('0x5a')]=function(_0x218697,_0x15164b){const _0x1943ce=_0x2ee6b2;return db[_0x1943ce('0x43')]['findOne']({'where':{'id':_0x218697[_0x1943ce('0x17')]['id']}})[_0x1943ce('0x5f')](handleEntityNotFound(_0x15164b,null))[_0x1943ce('0x5f')](function(_0x34b919){const _0x8e098c=_0x1943ce;let _0x42bb74;if(_0x34b919)return _0x42bb74=squel['insert']()['into'](_0x8e098c('0x4e'))[_0x8e098c('0x32')]([_0x8e098c('0x3c'),_0x8e098c('0x12'),'ContactId',_0x8e098c('0x3'),_0x8e098c('0x5b'),'createdAt',_0x8e098c('0x36')],squel[_0x8e098c('0x5e')]()[_0x8e098c('0x1c')](_0x8e098c('0x47'),_0x8e098c('0x3c'))[_0x8e098c('0x1c')](_0x8e098c('0x4f'),'scheduledAt')[_0x8e098c('0x1c')](_0x8e098c('0x41'),'ContactId')[_0x8e098c('0x1c')](_0x8e098c('0x4a'),_0x8e098c('0x3'))['field']('ANY_VALUE(VoiceQueueId)',_0x8e098c('0x5b'))[_0x8e098c('0x1c')](_0x8e098c('0x4f'),_0x8e098c('0x13'))[_0x8e098c('0x1c')](_0x8e098c('0x4f'),_0x8e098c('0x36'))[_0x8e098c('0x58')](_0x8e098c('0x11'))[_0x8e098c('0x35')](_0x8e098c('0x1a'),_0x218697[_0x8e098c('0x17')]['id'][_0x8e098c('0xf')]())[_0x8e098c('0x35')](_0x8e098c('0x23'),_0x218697[_0x8e098c('0x10')][_0x8e098c('0x2b')][_0x8e098c('0xf')]())[_0x8e098c('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x8e098c('0x35')](_0x8e098c('0x2'),squel[_0x8e098c('0x5e')]()['field'](_0x8e098c('0x3c'))['from'](_0x8e098c('0x4e'))[_0x8e098c('0x35')](_0x8e098c('0x1a'),_0x218697[_0x8e098c('0x17')]['id'][_0x8e098c('0xf')]()))[_0x8e098c('0x35')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x8e098c('0x5e')]()[_0x8e098c('0x1c')]('calleridnum')[_0x8e098c('0x58')](_0x8e098c('0x11'))[_0x8e098c('0x35')](_0x8e098c('0x1a'),_0x218697[_0x8e098c('0x17')]['id']['toString']())[_0x8e098c('0x35')](_0x8e098c('0x2a')))['group'](_0x8e098c('0x5c')))['toString'](),db['sequelize']['query'](_0x42bb74);return[];})['then'](respondWithResult(_0x15164b,null))[_0x1943ce('0x18')](handleError(_0x15164b,null));},exports[_0x2ee6b2('0x1b')]=function(_0x39c50f,_0x301eb0){const _0x442e15=_0x2ee6b2;return db[_0x442e15('0xc')][_0x442e15('0x38')]({'where':{'id':_0x39c50f[_0x442e15('0x17')]['id']}})['then'](handleEntityNotFound(_0x301eb0,null))[_0x442e15('0x5f')](function(_0x4ac6ac){const _0x30f3e4=_0x442e15;let _0x1c6280;if(_0x4ac6ac)return _0x1c6280=squel[_0x30f3e4('0x3d')]()['into']('cm_hopper')[_0x30f3e4('0x32')]([_0x30f3e4('0x3c'),_0x30f3e4('0x12'),_0x30f3e4('0x5c'),'ListId',_0x30f3e4('0x9'),_0x30f3e4('0x13'),'updatedAt'],squel['select']()[_0x30f3e4('0x1c')](_0x30f3e4('0x47'),_0x30f3e4('0x3c'))[_0x30f3e4('0x1c')]('NOW()',_0x30f3e4('0x12'))[_0x30f3e4('0x1c')](_0x30f3e4('0x41'),_0x30f3e4('0x5c'))[_0x30f3e4('0x1c')](_0x30f3e4('0x4a'),_0x30f3e4('0x3'))[_0x30f3e4('0x1c')](_0x30f3e4('0x4c'),_0x30f3e4('0x9'))[_0x30f3e4('0x1c')]('NOW()',_0x30f3e4('0x13'))['field'](_0x30f3e4('0x4f'),_0x30f3e4('0x36'))[_0x30f3e4('0x58')](_0x30f3e4('0x11'))[_0x30f3e4('0x35')]('CampaignId\x20=\x20?',_0x39c50f[_0x30f3e4('0x17')]['id'][_0x30f3e4('0xf')]())['where'](_0x30f3e4('0x23'),_0x39c50f['body'][_0x30f3e4('0x2b')][_0x30f3e4('0xf')]())[_0x30f3e4('0x35')](_0x30f3e4('0x19'))[_0x30f3e4('0x35')](_0x30f3e4('0x2'),squel[_0x30f3e4('0x5e')]()[_0x30f3e4('0x1c')](_0x30f3e4('0x3c'))[_0x30f3e4('0x58')]('cm_hopper')[_0x30f3e4('0x35')]('CampaignId\x20=\x20?',_0x39c50f[_0x30f3e4('0x17')]['id'][_0x30f3e4('0xf')]()))[_0x30f3e4('0x35')](_0x30f3e4('0x2'),squel['select']()['field'](_0x30f3e4('0x21'))[_0x30f3e4('0x58')](_0x30f3e4('0x11'))[_0x30f3e4('0x35')]('CampaignId\x20=\x20?',_0x39c50f['params']['id'][_0x30f3e4('0xf')]())[_0x30f3e4('0x35')]('state\x20=\x204'))[_0x30f3e4('0x50')](_0x30f3e4('0x5c')))[_0x30f3e4('0xf')](),db[_0x30f3e4('0x59')][_0x30f3e4('0x16')](_0x1c6280);return[];})[_0x442e15('0x5f')](respondWithResult(_0x301eb0,null))[_0x442e15('0x18')](handleError(_0x301eb0,null));},exports[_0x2ee6b2('0x6')]=function(_0x6a721c,_0x28cdf){const _0x1ddcae=_0x2ee6b2;return db[_0x1ddcae('0x57')]['findOne']({'where':{'VoiceQueueId':_0x6a721c[_0x1ddcae('0x10')][_0x1ddcae('0x5b')],'CampaignId':_0x6a721c['body'][_0x1ddcae('0x9')],'ContactId':_0x6a721c['body']['ContactId']}})[_0x1ddcae('0x5f')](handleEntityNotFound(_0x28cdf,null))[_0x1ddcae('0x5f')](function(_0x1f1237){if(_0x1f1237)return _0x1f1237;return null;})[_0x1ddcae('0x5f')](respondWithResult(_0x28cdf,null))['catch'](handleError(_0x28cdf,null));};
\ No newline at end of file