Built motion from commit 129fb4d95212661e48f0db455e75d668addbaddf. Version 3.0.0...
[motion-next.git] / server / api / cmHopper / cmHopper.rpc.js
index 5a72e30..807710a 100644 (file)
@@ -1 +1 @@
-const a139_0x1b5f=['destroy','raw','rpc','DestroyCmHopper','where','`scheduledat`\x20>=\x20','CountReScheduled','CreateCmHopper','LOCK','findAll','\x22%s\x22','limit','sequelize','CmHopper','format','includes','GetContactRecallMe','order','Contact','body','GetCmHopperPreview','CmHopperFinal','CmContact','User','catch','map','UserId','info','MoveContactManagedDialer','GetCmHopper','options','create','Agent','UPDATE','\x20,\x201,\x20null','moment','util','ShowCmHopper','update','include','message','YYYY-MM-DD\x20HH:mm:ss','attributes','length','voicePause','model','transaction','GetContactDialer','debug','../../config/logger','UpdateCmHopper','push','../../mysqldb','stringify','then','keys','error','describe'];(function(_0x2c7c2a,_0x1b5f38){const _0x111e7e=function(_0x16f38e){while(--_0x16f38e){_0x2c7c2a['push'](_0x2c7c2a['shift']());}};_0x111e7e(++_0x1b5f38);}(a139_0x1b5f,0x104));const a139_0x111e=function(_0x2c7c2a,_0x1b5f38){_0x2c7c2a=_0x2c7c2a-0x0;let _0x111e7e=a139_0x1b5f[_0x2c7c2a];return _0x111e7e;};const _0x448b1c=a139_0x111e;'use strict';const _=require('lodash'),util=require(_0x448b1c('0x8')),moment=require(_0x448b1c('0x7')),db=require(_0x448b1c('0x18'))['db'],logger=require(_0x448b1c('0x15'))(_0x448b1c('0x20')),{literal,fn}=require(_0x448b1c('0x2a'));exports['GetCmHopper']=function(_0x16f38e){const _0x27363c=this;return new Promise(function(_0x113dcd,_0xb47fb0){const _0x1fa30f=a139_0x111e;return db[_0x1fa30f('0x2b')]['findAll']({'raw':_0x16f38e['options']?_0x16f38e[_0x1fa30f('0x2')]['raw']===undefined?!![]:![]:!![],'where':_0x16f38e[_0x1fa30f('0x2')]?_0x16f38e[_0x1fa30f('0x2')][_0x1fa30f('0x22')]||null:null,'attributes':_0x16f38e['options']?_0x16f38e['options'][_0x1fa30f('0xe')]||null:null,'limit':_0x16f38e[_0x1fa30f('0x2')]?_0x16f38e[_0x1fa30f('0x2')][_0x1fa30f('0x29')]||null:null,'include':_0x16f38e[_0x1fa30f('0x2')]?_0x16f38e[_0x1fa30f('0x2')]['include']?_[_0x1fa30f('0x37')](_0x16f38e[_0x1fa30f('0x2')]['include'],function(_0x1beeb9){const _0x2a7751=_0x1fa30f;return{'model':db[_0x1beeb9['model']],'as':_0x1beeb9['as'],'attributes':_0x1beeb9[_0x2a7751('0xe')],'include':_0x1beeb9[_0x2a7751('0xb')]?_['map'](_0x1beeb9[_0x2a7751('0xb')],function(_0xcab0ac){const _0x35f1af=_0x2a7751;return{'model':db[_0xcab0ac[_0x35f1af('0x11')]],'as':_0xcab0ac['as'],'attributes':_0xcab0ac[_0x35f1af('0xe')],'include':_0xcab0ac['include']?_[_0x35f1af('0x37')](_0xcab0ac[_0x35f1af('0xb')],function(_0x463c59){const _0x3ebcfc=_0x35f1af;return{'model':db[_0x463c59[_0x3ebcfc('0x11')]],'as':_0x463c59['as'],'attributes':_0x463c59[_0x3ebcfc('0xe')]};}):[]};}):[]};}):[]:[]})[_0x1fa30f('0x1a')](function(_0x22c506){const _0x42d408=_0x1fa30f;logger[_0x42d408('0x39')](_0x42d408('0x1'),_0x16f38e),logger[_0x42d408('0x14')]('GetCmHopper',_0x16f38e,JSON[_0x42d408('0x19')](_0x22c506)),_0x113dcd(_0x22c506);})[_0x1fa30f('0x36')](function(_0x26955d){const _0x451e59=_0x1fa30f;logger['error'](_0x451e59('0x1'),_0x26955d[_0x451e59('0xc')],_0x16f38e),_0xb47fb0(_0x27363c[_0x451e59('0x1c')](0x1f4,_0x26955d[_0x451e59('0xc')]));});});},exports[_0x448b1c('0x9')]=function(_0x31d2c9){const _0x3ce297=this;return new Promise(function(_0x97e8f8,_0x1d1e76){const _0x1db4b8=a139_0x111e;return db[_0x1db4b8('0x2b')]['findOne']({'raw':_0x31d2c9['options']?_0x31d2c9[_0x1db4b8('0x2')][_0x1db4b8('0x1f')]===undefined?!![]:![]:!![],'where':_0x31d2c9[_0x1db4b8('0x2')]?_0x31d2c9[_0x1db4b8('0x2')][_0x1db4b8('0x22')]||null:null,'attributes':_0x31d2c9['options']?_0x31d2c9[_0x1db4b8('0x2')][_0x1db4b8('0xe')]||null:null,'include':_0x31d2c9['options']?_0x31d2c9[_0x1db4b8('0x2')][_0x1db4b8('0xb')]?_[_0x1db4b8('0x37')](_0x31d2c9[_0x1db4b8('0x2')]['include'],function(_0x77f626){const _0x48e483=_0x1db4b8;return{'model':db[_0x77f626[_0x48e483('0x11')]],'as':_0x77f626['as'],'attributes':_0x77f626[_0x48e483('0xe')],'include':_0x77f626[_0x48e483('0xb')]?_['map'](_0x77f626[_0x48e483('0xb')],function(_0x367f77){const _0x419697=_0x48e483;return{'model':db[_0x367f77['model']],'as':_0x367f77['as'],'attributes':_0x367f77[_0x419697('0xe')],'include':_0x367f77[_0x419697('0xb')]?_[_0x419697('0x37')](_0x367f77['include'],function(_0x2ce30e){const _0x3aee1a=_0x419697;return{'model':db[_0x2ce30e['model']],'as':_0x2ce30e['as'],'attributes':_0x2ce30e[_0x3aee1a('0xe')]};}):[]};}):[]};}):[]:[]})[_0x1db4b8('0x1a')](function(_0xc69804){const _0x4b8be4=_0x1db4b8;logger[_0x4b8be4('0x39')](_0x4b8be4('0x9'),_0x31d2c9),logger[_0x4b8be4('0x14')]('ShowCmHopper',_0x31d2c9,JSON['stringify'](_0xc69804)),_0x97e8f8(_0xc69804);})[_0x1db4b8('0x36')](function(_0x29dd08){const _0x3e7412=_0x1db4b8;logger['error'](_0x3e7412('0x9'),_0x29dd08['message'],_0x31d2c9),_0x1d1e76(_0x3ce297[_0x3e7412('0x1c')](0x1f4,_0x29dd08[_0x3e7412('0xc')]));});});},exports[_0x448b1c('0x25')]=function(_0x1dd57e){const _0x55498f=this;return new Promise(function(_0x31ee91,_0x1499ae){const _0x453721=a139_0x111e;return db['CmHopper']['create'](_0x1dd57e['body'],{'raw':_0x1dd57e[_0x453721('0x2')]?_0x1dd57e[_0x453721('0x2')][_0x453721('0x1f')]===undefined?!![]:![]:!![]})[_0x453721('0x1a')](function(_0x46f0ac){const _0x1bd2ec=_0x453721;logger[_0x1bd2ec('0x39')](_0x1bd2ec('0x25'),_0x1dd57e),logger[_0x1bd2ec('0x14')]('CreateCmHopper',_0x1dd57e,JSON[_0x1bd2ec('0x19')](_0x46f0ac)),_0x31ee91(_0x46f0ac);})['catch'](function(_0x473593){const _0x48875d=_0x453721;logger[_0x48875d('0x1c')](_0x48875d('0x25'),_0x473593[_0x48875d('0xc')],_0x1dd57e),_0x1499ae(_0x55498f[_0x48875d('0x1c')](0x1f4,_0x473593['message']));});});},exports[_0x448b1c('0x16')]=function(_0x3efd5f){const _0x4ea55b=this;return new Promise(function(_0x7fa0a3,_0x13d79e){const _0x7c017c=a139_0x111e;return db[_0x7c017c('0x2b')][_0x7c017c('0xa')](_0x3efd5f[_0x7c017c('0x31')],{'raw':_0x3efd5f[_0x7c017c('0x2')]?_0x3efd5f[_0x7c017c('0x2')][_0x7c017c('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3efd5f[_0x7c017c('0x2')]?_0x3efd5f[_0x7c017c('0x2')][_0x7c017c('0x22')]||null:null,'attributes':_0x3efd5f['options']?_0x3efd5f[_0x7c017c('0x2')][_0x7c017c('0xe')]||null:null,'limit':_0x3efd5f[_0x7c017c('0x2')]?_0x3efd5f['options'][_0x7c017c('0x29')]||null:null})[_0x7c017c('0x1a')](function(_0x5275fc){const _0x3dacef=_0x7c017c;logger[_0x3dacef('0x39')](_0x3dacef('0x16'),_0x3efd5f),logger['debug'](_0x3dacef('0x16'),_0x3efd5f,JSON[_0x3dacef('0x19')](_0x5275fc)),_0x7fa0a3(_0x5275fc);})[_0x7c017c('0x36')](function(_0x40b3c8){const _0x5700d9=_0x7c017c;logger[_0x5700d9('0x1c')]('UpdateCmHopper',_0x40b3c8[_0x5700d9('0xc')],_0x3efd5f),_0x13d79e(_0x4ea55b[_0x5700d9('0x1c')](0x1f4,_0x40b3c8[_0x5700d9('0xc')]));});});},exports['DestroyCmHopper']=function(_0xe2981f){const _0x20bf3d=this;return new Promise(function(_0x7adb3a,_0x478eda){const _0x29b129=a139_0x111e;return db[_0x29b129('0x2b')][_0x29b129('0x1e')]({'where':_0xe2981f[_0x29b129('0x2')]?_0xe2981f['options']['where']||null:null})[_0x29b129('0x1a')](function(_0x150a48){const _0x46d906=_0x29b129;logger[_0x46d906('0x39')](_0x46d906('0x21'),_0xe2981f),logger[_0x46d906('0x14')]('DestroyCmHopper',_0xe2981f,JSON[_0x46d906('0x19')](_0x150a48)),_0x7adb3a(_0x150a48);})['catch'](function(_0x11c5a9){const _0x350679=_0x29b129;logger[_0x350679('0x1c')](_0x350679('0x21'),_0x11c5a9[_0x350679('0xc')],_0xe2981f),_0x478eda(_0x20bf3d['error'](0x1f4,_0x11c5a9[_0x350679('0xc')]));});});},exports[_0x448b1c('0x13')]=function(_0x134832){const _0x248063=this;return new Promise(function(_0x354130,_0x5023f8){const _0x416cdc=a139_0x111e;return db[_0x416cdc('0x34')][_0x416cdc('0x1d')]()[_0x416cdc('0x1a')](function(_0xa9438a){const _0x305770=_0x416cdc;return db[_0x305770('0x2a')]['transaction'](function(_0x38b0f3){const _0x4d8b33=_0x305770;return db[_0x4d8b33('0x2b')][_0x4d8b33('0x27')]({'where':_0x134832[_0x4d8b33('0x2')]?_0x134832[_0x4d8b33('0x2')][_0x4d8b33('0x22')]||null:null,'attributes':_0x134832[_0x4d8b33('0x2')]?_0x134832[_0x4d8b33('0x2')][_0x4d8b33('0xe')]||null:null,'limit':_0x134832[_0x4d8b33('0x2')]?_0x134832[_0x4d8b33('0x2')]['limit']||null:null,'order':_0x134832['options']?_0x134832[_0x4d8b33('0x2')][_0x4d8b33('0x2f')]||null:null,'transaction':_0x38b0f3,'lock':_0x38b0f3[_0x4d8b33('0x26')][_0x4d8b33('0x5')],'include':[{'model':db[_0x4d8b33('0x34')],'as':_0x4d8b33('0x30'),'attributes':_[_0x4d8b33('0x1b')](_0xa9438a)},{'model':db[_0x4d8b33('0x35')],'as':_0x4d8b33('0x4'),'attributes':['id','name',_0x4d8b33('0x10')]}]})[_0x4d8b33('0x1a')](function(_0x376ebf){const _0x4a3eef=_0x4d8b33,_0x521270=[],_0x37068a=[];for(let _0x3ec197=0x0;_0x3ec197<_0x376ebf[_0x4a3eef('0xf')];_0x3ec197+=0x1){!_0x37068a[_0x4a3eef('0x2d')](_0x376ebf[_0x3ec197][_0x4a3eef('0x38')])&&(_0x37068a['push'](_0x376ebf[_0x3ec197][_0x4a3eef('0x38')]),_0x521270[_0x4a3eef('0x17')](_0x376ebf[_0x3ec197][_0x4a3eef('0xa')](_0x134832['body'],{'transaction':_0x38b0f3})));}return Promise['all'](_0x521270);});})['then'](function(_0x579765){const _0x4a3e7e=_0x305770;logger['info'](_0x4a3e7e('0x13'),_0x134832),logger[_0x4a3e7e('0x14')](_0x4a3e7e('0x13'),_0x134832,JSON[_0x4a3e7e('0x19')](_0x579765)),_0x354130(_0x579765);})[_0x305770('0x36')](function(_0x17c416){const _0x964398=_0x305770;logger[_0x964398('0x1c')]('GetContactDialer',_0x17c416[_0x964398('0xc')],_0x134832),_0x5023f8(_0x248063[_0x964398('0x1c')](0x1f4,_0x17c416[_0x964398('0xc')]));});});});},exports[_0x448b1c('0x0')]=function(_0x51e7bb){const _0x262e57=this;return new Promise(function(_0x21ab77,_0x32fa3a){const _0x4e21c2=a139_0x111e;return db[_0x4e21c2('0x2a')]['transaction'](function(_0x45b7bd){const _0x38f13d=_0x4e21c2;return db[_0x38f13d('0x33')][_0x38f13d('0x3')](_0x51e7bb['body'],{'raw':_0x51e7bb[_0x38f13d('0x2')]?_0x51e7bb[_0x38f13d('0x2')][_0x38f13d('0x1f')]===undefined?!![]:![]:!![],'transaction':_0x45b7bd})[_0x38f13d('0x1a')](function(){const _0x3b0936=_0x38f13d;return db[_0x3b0936('0x2b')][_0x3b0936('0x1e')]({'where':_0x51e7bb[_0x3b0936('0x2')]?_0x51e7bb[_0x3b0936('0x2')][_0x3b0936('0x22')]||null:null,'transaction':_0x45b7bd});});})[_0x4e21c2('0x1a')](function(_0x401c68){const _0x3d56d5=_0x4e21c2;logger[_0x3d56d5('0x39')](_0x3d56d5('0x0'),_0x51e7bb),logger['debug'](_0x3d56d5('0x0'),_0x51e7bb,JSON[_0x3d56d5('0x19')](_0x401c68)),_0x21ab77(_0x401c68);})[_0x4e21c2('0x36')](function(_0x44667b){const _0x3a20f7=_0x4e21c2;logger[_0x3a20f7('0x1c')]('MoveContactManagedDialer',_0x44667b[_0x3a20f7('0xc')],_0x51e7bb),_0x32fa3a(_0x262e57[_0x3a20f7('0x1c')](0x1f4,_0x44667b[_0x3a20f7('0xc')]));});});},exports[_0x448b1c('0x24')]=function(_0x39f3ef){const _0x3aca07=this;return new Promise(function(_0x5de6d3,_0x3a96ce){const _0xe0677b=a139_0x111e;return db[_0xe0677b('0x2b')][_0xe0677b('0x27')]({'raw':_0x39f3ef[_0xe0677b('0x2')]?_0x39f3ef[_0xe0677b('0x2')]['raw']===undefined?!![]:![]:!![],'where':_0x39f3ef[_0xe0677b('0x2')]?_0x39f3ef['options']['where']||null:null,'attributes':[[fn('COUNT',fn('IF',literal(_0xe0677b('0x23')+util[_0xe0677b('0x2c')](_0xe0677b('0x28'),moment()[_0xe0677b('0x2c')](_0xe0677b('0xd')))+_0xe0677b('0x6')))),'contactsRescheduled']]})[_0xe0677b('0x1a')](function(_0x2aef60){const _0x387c38=_0xe0677b;logger[_0x387c38('0x39')](_0x387c38('0x24'),_0x39f3ef),logger[_0x387c38('0x14')](_0x387c38('0x24'),_0x39f3ef,JSON[_0x387c38('0x19')](_0x2aef60)),_0x5de6d3(_0x2aef60);})[_0xe0677b('0x36')](function(_0x9c8d93){const _0x3b5535=_0xe0677b;logger[_0x3b5535('0x1c')](_0x3b5535('0x24'),_0x9c8d93[_0x3b5535('0xc')],_0x39f3ef),_0x3a96ce(_0x3aca07[_0x3b5535('0x1c')](0x1f4,_0x9c8d93[_0x3b5535('0xc')]));});});},exports[_0x448b1c('0x2e')]=function(_0x58035e){const _0xf361ff=this;return new Promise(function(_0xb43039,_0x2d354c){const _0x21c419=a139_0x111e;return db[_0x21c419('0x34')][_0x21c419('0x1d')]()[_0x21c419('0x1a')](function(){const _0x17acb3=_0x21c419;return db['sequelize'][_0x17acb3('0x12')](function(_0x7d0829){const _0x5da739=_0x17acb3;return db[_0x5da739('0x2b')][_0x5da739('0x27')]({'where':_0x58035e[_0x5da739('0x2')]?_0x58035e[_0x5da739('0x2')][_0x5da739('0x22')]||null:null,'attributes':_0x58035e[_0x5da739('0x2')]?_0x58035e['options'][_0x5da739('0xe')]||null:null,'limit':0x1,'order':_0x58035e[_0x5da739('0x2')]?_0x58035e[_0x5da739('0x2')][_0x5da739('0x2f')]||null:null,'group':db[_0x5da739('0x2b')][_0x5da739('0x38')],'transaction':_0x7d0829,'lock':_0x7d0829[_0x5da739('0x26')][_0x5da739('0x5')],'include':_0x58035e[_0x5da739('0x2')]?_0x58035e['options']['include']?_[_0x5da739('0x37')](_0x58035e[_0x5da739('0x2')][_0x5da739('0xb')],function(_0x342222){const _0x28a69e=_0x5da739;return{'model':db[_0x342222[_0x28a69e('0x11')]],'as':_0x342222['as'],'attributes':_0x342222[_0x28a69e('0xe')],'include':_0x342222[_0x28a69e('0xb')]?_[_0x28a69e('0x37')](_0x342222['include'],function(_0x144d37){const _0xe46782=_0x28a69e;return{'model':db[_0x144d37['model']],'as':_0x144d37['as'],'attributes':_0x144d37[_0xe46782('0xe')],'include':_0x144d37[_0xe46782('0xb')]?_['map'](_0x144d37[_0xe46782('0xb')],function(_0x5ff613){const _0x41d7d6=_0xe46782;return{'model':db[_0x5ff613['model']],'as':_0x5ff613['as'],'attributes':_0x5ff613[_0x41d7d6('0xe')]};}):[]};}):[]};}):[]:[]})[_0x5da739('0x1a')](function(_0x4c5163){const _0x1cc021=_0x5da739,_0x159702=[];for(let _0x5caa6c=0x0;_0x5caa6c<_0x4c5163[_0x1cc021('0xf')];_0x5caa6c+=0x1){_0x159702[_0x1cc021('0x17')](_0x4c5163[_0x5caa6c][_0x1cc021('0xa')](_0x58035e[_0x1cc021('0x31')],{'transaction':_0x7d0829}));}return Promise['all'](_0x159702);});})['then'](function(_0x46422b){const _0x58f943=_0x17acb3;logger['info'](_0x58f943('0x2e'),_0x58035e),logger[_0x58f943('0x14')](_0x58f943('0x2e'),_0x58035e,JSON[_0x58f943('0x19')](_0x46422b)),_0xb43039(_0x46422b);})['catch'](function(_0x210b0f){const _0x1158c5=_0x17acb3;logger[_0x1158c5('0x1c')](_0x1158c5('0x2e'),_0x210b0f[_0x1158c5('0xc')],_0x58035e),_0x2d354c(_0xf361ff['error'](0x1f4,_0x210b0f[_0x1158c5('0xc')]));});});});},exports[_0x448b1c('0x32')]=function(_0xd2a4d0){const _0xaf480e=this;return new Promise(function(_0x3a341a,_0x1ed549){const _0x575292=a139_0x111e;db[_0x575292('0x34')]['describe']()['then'](function(_0x1f3c52){const _0x2ef511=_0x575292;return db[_0x2ef511('0x2b')]['findAll']({'raw':_0xd2a4d0['options']?_0xd2a4d0[_0x2ef511('0x2')][_0x2ef511('0x1f')]===undefined?!![]:![]:!![],'where':_0xd2a4d0[_0x2ef511('0x2')]?_0xd2a4d0[_0x2ef511('0x2')][_0x2ef511('0x22')]||null:null,'attributes':_0xd2a4d0[_0x2ef511('0x2')]?_0xd2a4d0[_0x2ef511('0x2')]['attributes']||null:null,'limit':_0xd2a4d0[_0x2ef511('0x2')]?_0xd2a4d0['options'][_0x2ef511('0x29')]||null:null,'include':_0xd2a4d0[_0x2ef511('0x2')]?_0xd2a4d0[_0x2ef511('0x2')][_0x2ef511('0xb')]?_[_0x2ef511('0x37')](_0xd2a4d0[_0x2ef511('0x2')][_0x2ef511('0xb')],function(_0x40f942){const _0x17fd3e=_0x2ef511;return{'model':db[_0x40f942[_0x17fd3e('0x11')]],'as':_0x40f942['as'],'attributes':_0x40f942['as']===_0x17fd3e('0x30')?_[_0x17fd3e('0x1b')](_0x1f3c52):_0x40f942[_0x17fd3e('0xe')],'include':_0x40f942[_0x17fd3e('0xb')]?_[_0x17fd3e('0x37')](_0x40f942[_0x17fd3e('0xb')],function(_0x3126be){const _0x1186b0=_0x17fd3e;return{'model':db[_0x3126be[_0x1186b0('0x11')]],'as':_0x3126be['as'],'attributes':_0x3126be[_0x1186b0('0xe')],'include':_0x3126be[_0x1186b0('0xb')]?_[_0x1186b0('0x37')](_0x3126be[_0x1186b0('0xb')],function(_0x9f9ce5){const _0x39693f=_0x1186b0;return{'model':db[_0x9f9ce5[_0x39693f('0x11')]],'as':_0x9f9ce5['as'],'attributes':_0x9f9ce5[_0x39693f('0xe')]};}):[]};}):[]};}):[]:[]})[_0x2ef511('0x1a')](function(_0x56f332){const _0x4dbc6c=_0x2ef511;logger[_0x4dbc6c('0x39')](_0x4dbc6c('0x1'),_0xd2a4d0),logger['debug'](_0x4dbc6c('0x1'),_0xd2a4d0,JSON[_0x4dbc6c('0x19')](_0x56f332)),_0x3a341a(_0x56f332);})['catch'](function(_0x5e39e1){const _0x564bd7=_0x2ef511;logger[_0x564bd7('0x1c')]('GetCmHopper',_0x5e39e1['message'],_0xd2a4d0),_0x1ed549(_0xaf480e['error'](0x1f4,_0x5e39e1[_0x564bd7('0xc')]));});});});};
\ No newline at end of file
+const a167_0x243c=['UpdateCmHopper','options','catch','CountReScheduled','\x20,\x201,\x20null','transaction','keys','stringify','push','Agent','sequelize','UserId','model','User','../../mysqldb','findAll','raw','debug','voicePause','COUNT','body','info','GetContactDialer','UPDATE','CreateCmHopper','\x22%s\x22','map','order','describe','name','moment','create','message','destroy','rpc','ShowCmHopper','CmHopper','GetCmHopper','LOCK','error','findOne','contactsRescheduled','DestroyCmHopper','GetCmHopperPreview','MoveContactManagedDialer','include','limit','update','CmContact','attributes','then','CmHopperFinal','where','GetContactRecallMe','YYYY-MM-DD\x20HH:mm:ss','length','util','all'];(function(_0x1432c2,_0x3e8d07){const _0x243c8a=function(_0xa22a60){while(--_0xa22a60){_0x1432c2['push'](_0x1432c2['shift']());}};_0x243c8a(++_0x3e8d07);}(a167_0x243c,0x16d));const a167_0xa22a=function(_0x1432c2,_0x3e8d07){_0x1432c2=_0x1432c2-0xe7;let _0x243c8a=a167_0x243c[_0x1432c2];return _0x243c8a;};const a167_0x4d3b81=a167_0xa22a;'use strict';const _=require('lodash'),util=require(a167_0x4d3b81(0x10e)),moment=require(a167_0x4d3b81(0xf4)),db=require(a167_0x4d3b81(0x11e))['db'],logger=require('../../config/logger')(a167_0x4d3b81(0xf8)),{literal,fn}=require(a167_0x4d3b81(0x11a));exports[a167_0x4d3b81(0xfb)]=function(_0x91184c){const _0x29a32c=this;return new Promise(function(_0x35b300,_0x470966){const _0x4fb404=a167_0xa22a;return db[_0x4fb404(0xfa)][_0x4fb404(0x11f)]({'raw':_0x91184c[_0x4fb404(0x111)]?_0x91184c['options'][_0x4fb404(0x120)]===undefined?!![]:![]:!![],'where':_0x91184c[_0x4fb404(0x111)]?_0x91184c['options']['where']||null:null,'attributes':_0x91184c[_0x4fb404(0x111)]?_0x91184c[_0x4fb404(0x111)][_0x4fb404(0x107)]||null:null,'limit':_0x91184c[_0x4fb404(0x111)]?_0x91184c[_0x4fb404(0x111)][_0x4fb404(0x104)]||null:null,'include':_0x91184c[_0x4fb404(0x111)]?_0x91184c[_0x4fb404(0x111)][_0x4fb404(0x103)]?_[_0x4fb404(0xf0)](_0x91184c[_0x4fb404(0x111)][_0x4fb404(0x103)],function(_0x1a1f99){const _0x295be0=_0x4fb404;return{'model':db[_0x1a1f99[_0x295be0(0x11c)]],'as':_0x1a1f99['as'],'attributes':_0x1a1f99[_0x295be0(0x107)],'include':_0x1a1f99[_0x295be0(0x103)]?_['map'](_0x1a1f99[_0x295be0(0x103)],function(_0x9c3055){const _0xe5b438=_0x295be0;return{'model':db[_0x9c3055[_0xe5b438(0x11c)]],'as':_0x9c3055['as'],'attributes':_0x9c3055[_0xe5b438(0x107)],'include':_0x9c3055[_0xe5b438(0x103)]?_[_0xe5b438(0xf0)](_0x9c3055['include'],function(_0x97a75c){return{'model':db[_0x97a75c['model']],'as':_0x97a75c['as'],'attributes':_0x97a75c['attributes']};}):[]};}):[]};}):[]:[]})[_0x4fb404(0x108)](function(_0x444754){const _0x536393=_0x4fb404;logger[_0x536393(0xeb)](_0x536393(0xfb),_0x91184c),logger[_0x536393(0xe7)](_0x536393(0xfb),_0x91184c,JSON[_0x536393(0x117)](_0x444754)),_0x35b300(_0x444754);})['catch'](function(_0x1e2c22){const _0x48ad01=_0x4fb404;logger[_0x48ad01(0xfd)](_0x48ad01(0xfb),_0x1e2c22[_0x48ad01(0xf6)],_0x91184c),_0x470966(_0x29a32c[_0x48ad01(0xfd)](0x1f4,_0x1e2c22[_0x48ad01(0xf6)]));});});},exports[a167_0x4d3b81(0xf9)]=function(_0x559ef1){const _0x637402=this;return new Promise(function(_0x1eedfc,_0x400ed9){const _0x2df0c9=a167_0xa22a;return db[_0x2df0c9(0xfa)][_0x2df0c9(0xfe)]({'raw':_0x559ef1[_0x2df0c9(0x111)]?_0x559ef1[_0x2df0c9(0x111)][_0x2df0c9(0x120)]===undefined?!![]:![]:!![],'where':_0x559ef1[_0x2df0c9(0x111)]?_0x559ef1[_0x2df0c9(0x111)]['where']||null:null,'attributes':_0x559ef1[_0x2df0c9(0x111)]?_0x559ef1[_0x2df0c9(0x111)]['attributes']||null:null,'include':_0x559ef1[_0x2df0c9(0x111)]?_0x559ef1[_0x2df0c9(0x111)]['include']?_['map'](_0x559ef1[_0x2df0c9(0x111)][_0x2df0c9(0x103)],function(_0x365854){const _0x22d658=_0x2df0c9;return{'model':db[_0x365854[_0x22d658(0x11c)]],'as':_0x365854['as'],'attributes':_0x365854[_0x22d658(0x107)],'include':_0x365854[_0x22d658(0x103)]?_[_0x22d658(0xf0)](_0x365854[_0x22d658(0x103)],function(_0x1f8bc7){const _0x47e619=_0x22d658;return{'model':db[_0x1f8bc7[_0x47e619(0x11c)]],'as':_0x1f8bc7['as'],'attributes':_0x1f8bc7[_0x47e619(0x107)],'include':_0x1f8bc7[_0x47e619(0x103)]?_['map'](_0x1f8bc7[_0x47e619(0x103)],function(_0xda8a3c){const _0x2fdade=_0x47e619;return{'model':db[_0xda8a3c['model']],'as':_0xda8a3c['as'],'attributes':_0xda8a3c[_0x2fdade(0x107)]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c5dad){const _0x449c47=_0x2df0c9;logger[_0x449c47(0xeb)]('ShowCmHopper',_0x559ef1),logger[_0x449c47(0xe7)](_0x449c47(0xf9),_0x559ef1,JSON[_0x449c47(0x117)](_0x4c5dad)),_0x1eedfc(_0x4c5dad);})['catch'](function(_0x5f203e){const _0x5b7637=_0x2df0c9;logger['error']('ShowCmHopper',_0x5f203e[_0x5b7637(0xf6)],_0x559ef1),_0x400ed9(_0x637402[_0x5b7637(0xfd)](0x1f4,_0x5f203e[_0x5b7637(0xf6)]));});});},exports[a167_0x4d3b81(0xee)]=function(_0x809ff3){const _0x5d759d=this;return new Promise(function(_0x1b6209,_0x292863){const _0x22c116=a167_0xa22a;return db[_0x22c116(0xfa)]['create'](_0x809ff3['body'],{'raw':_0x809ff3[_0x22c116(0x111)]?_0x809ff3[_0x22c116(0x111)]['raw']===undefined?!![]:![]:!![]})[_0x22c116(0x108)](function(_0x4676af){const _0x509a1d=_0x22c116;logger[_0x509a1d(0xeb)](_0x509a1d(0xee),_0x809ff3),logger[_0x509a1d(0xe7)](_0x509a1d(0xee),_0x809ff3,JSON[_0x509a1d(0x117)](_0x4676af)),_0x1b6209(_0x4676af);})[_0x22c116(0x112)](function(_0x6ce556){const _0x40ab1f=_0x22c116;logger[_0x40ab1f(0xfd)](_0x40ab1f(0xee),_0x6ce556[_0x40ab1f(0xf6)],_0x809ff3),_0x292863(_0x5d759d[_0x40ab1f(0xfd)](0x1f4,_0x6ce556[_0x40ab1f(0xf6)]));});});},exports['UpdateCmHopper']=function(_0x3139ba){const _0x3d8a90=this;return new Promise(function(_0x22d313,_0x7422fa){const _0x8953d7=a167_0xa22a;return db[_0x8953d7(0xfa)][_0x8953d7(0x105)](_0x3139ba[_0x8953d7(0xea)],{'raw':_0x3139ba[_0x8953d7(0x111)]?_0x3139ba[_0x8953d7(0x111)][_0x8953d7(0x120)]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3139ba[_0x8953d7(0x111)]?_0x3139ba[_0x8953d7(0x111)]['where']||null:null,'attributes':_0x3139ba[_0x8953d7(0x111)]?_0x3139ba[_0x8953d7(0x111)][_0x8953d7(0x107)]||null:null,'limit':_0x3139ba[_0x8953d7(0x111)]?_0x3139ba[_0x8953d7(0x111)][_0x8953d7(0x104)]||null:null})['then'](function(_0x443b22){const _0x5c844a=_0x8953d7;logger[_0x5c844a(0xeb)]('UpdateCmHopper',_0x3139ba),logger[_0x5c844a(0xe7)](_0x5c844a(0x110),_0x3139ba,JSON[_0x5c844a(0x117)](_0x443b22)),_0x22d313(_0x443b22);})[_0x8953d7(0x112)](function(_0x5b4124){const _0x4185b5=_0x8953d7;logger[_0x4185b5(0xfd)](_0x4185b5(0x110),_0x5b4124[_0x4185b5(0xf6)],_0x3139ba),_0x7422fa(_0x3d8a90[_0x4185b5(0xfd)](0x1f4,_0x5b4124[_0x4185b5(0xf6)]));});});},exports[a167_0x4d3b81(0x100)]=function(_0x4c2baa){const _0x368f42=this;return new Promise(function(_0x3aecaf,_0x2825f7){const _0x4b4289=a167_0xa22a;return db[_0x4b4289(0xfa)][_0x4b4289(0xf7)]({'where':_0x4c2baa[_0x4b4289(0x111)]?_0x4c2baa[_0x4b4289(0x111)][_0x4b4289(0x10a)]||null:null})[_0x4b4289(0x108)](function(_0x2a586b){const _0x1d83bf=_0x4b4289;logger[_0x1d83bf(0xeb)]('DestroyCmHopper',_0x4c2baa),logger['debug'](_0x1d83bf(0x100),_0x4c2baa,JSON['stringify'](_0x2a586b)),_0x3aecaf(_0x2a586b);})[_0x4b4289(0x112)](function(_0x3c2423){const _0x568b4c=_0x4b4289;logger['error'](_0x568b4c(0x100),_0x3c2423[_0x568b4c(0xf6)],_0x4c2baa),_0x2825f7(_0x368f42['error'](0x1f4,_0x3c2423[_0x568b4c(0xf6)]));});});},exports['GetContactDialer']=function(_0x966f10){const _0x2c7d6b=this;return new Promise(function(_0x1aba5d,_0x272558){const _0x465562=a167_0xa22a;return db[_0x465562(0x106)][_0x465562(0xf2)]()[_0x465562(0x108)](function(_0x30bd01){const _0x556fee=_0x465562;return db[_0x556fee(0x11a)]['transaction'](function(_0x26ed18){const _0x3d9ff0=_0x556fee;return db[_0x3d9ff0(0xfa)][_0x3d9ff0(0x11f)]({'where':_0x966f10[_0x3d9ff0(0x111)]?_0x966f10[_0x3d9ff0(0x111)][_0x3d9ff0(0x10a)]||null:null,'attributes':_0x966f10['options']?_0x966f10['options'][_0x3d9ff0(0x107)]||null:null,'limit':_0x966f10['options']?_0x966f10[_0x3d9ff0(0x111)]['limit']||null:null,'order':_0x966f10['options']?_0x966f10['options'][_0x3d9ff0(0xf1)]||null:null,'transaction':_0x26ed18,'lock':_0x26ed18[_0x3d9ff0(0xfc)]['UPDATE'],'include':[{'model':db[_0x3d9ff0(0x106)],'as':'Contact','attributes':_[_0x3d9ff0(0x116)](_0x30bd01)},{'model':db[_0x3d9ff0(0x11d)],'as':_0x3d9ff0(0x119),'attributes':['id',_0x3d9ff0(0xf3),_0x3d9ff0(0xe8)]}]})[_0x3d9ff0(0x108)](function(_0x4c4f3b){const _0x577d96=_0x3d9ff0,_0x1af4f4=[],_0x2be015=[];for(let _0x3a4cfb=0x0;_0x3a4cfb<_0x4c4f3b['length'];_0x3a4cfb+=0x1){!_0x2be015['includes'](_0x4c4f3b[_0x3a4cfb]['UserId'])&&(_0x2be015[_0x577d96(0x118)](_0x4c4f3b[_0x3a4cfb][_0x577d96(0x11b)]),_0x1af4f4[_0x577d96(0x118)](_0x4c4f3b[_0x3a4cfb][_0x577d96(0x105)](_0x966f10['body'],{'transaction':_0x26ed18})));}return Promise[_0x577d96(0x10f)](_0x1af4f4);});})[_0x556fee(0x108)](function(_0x407f6e){const _0x12b689=_0x556fee;logger['info'](_0x12b689(0xec),_0x966f10),logger[_0x12b689(0xe7)](_0x12b689(0xec),_0x966f10,JSON['stringify'](_0x407f6e)),_0x1aba5d(_0x407f6e);})['catch'](function(_0x3dc981){const _0x37f845=_0x556fee;logger[_0x37f845(0xfd)](_0x37f845(0xec),_0x3dc981['message'],_0x966f10),_0x272558(_0x2c7d6b[_0x37f845(0xfd)](0x1f4,_0x3dc981[_0x37f845(0xf6)]));});});});},exports[a167_0x4d3b81(0x102)]=function(_0x37c4a3){const _0x269e1a=this;return new Promise(function(_0xef90e4,_0xdd6a97){const _0x115512=a167_0xa22a;return db[_0x115512(0x11a)][_0x115512(0x115)](function(_0x6c178b){const _0x5f00b5=_0x115512;return db[_0x5f00b5(0x109)][_0x5f00b5(0xf5)](_0x37c4a3[_0x5f00b5(0xea)],{'raw':_0x37c4a3[_0x5f00b5(0x111)]?_0x37c4a3[_0x5f00b5(0x111)]['raw']===undefined?!![]:![]:!![],'transaction':_0x6c178b})['then'](function(){const _0x5b0d5d=_0x5f00b5;return db[_0x5b0d5d(0xfa)]['destroy']({'where':_0x37c4a3[_0x5b0d5d(0x111)]?_0x37c4a3['options'][_0x5b0d5d(0x10a)]||null:null,'transaction':_0x6c178b});});})[_0x115512(0x108)](function(_0xa918f0){const _0x1751e6=_0x115512;logger[_0x1751e6(0xeb)](_0x1751e6(0x102),_0x37c4a3),logger[_0x1751e6(0xe7)](_0x1751e6(0x102),_0x37c4a3,JSON[_0x1751e6(0x117)](_0xa918f0)),_0xef90e4(_0xa918f0);})[_0x115512(0x112)](function(_0x4c0045){const _0x12a4b0=_0x115512;logger[_0x12a4b0(0xfd)](_0x12a4b0(0x102),_0x4c0045[_0x12a4b0(0xf6)],_0x37c4a3),_0xdd6a97(_0x269e1a[_0x12a4b0(0xfd)](0x1f4,_0x4c0045[_0x12a4b0(0xf6)]));});});},exports[a167_0x4d3b81(0x113)]=function(_0x40d8a7){const _0xa5159b=this;return new Promise(function(_0x199430,_0xf7be84){const _0x402d33=a167_0xa22a;return db[_0x402d33(0xfa)][_0x402d33(0x11f)]({'raw':_0x40d8a7[_0x402d33(0x111)]?_0x40d8a7['options']['raw']===undefined?!![]:![]:!![],'where':_0x40d8a7[_0x402d33(0x111)]?_0x40d8a7[_0x402d33(0x111)][_0x402d33(0x10a)]||null:null,'attributes':[[fn(_0x402d33(0xe9),fn('IF',literal('`scheduledat`\x20>=\x20'+util['format'](_0x402d33(0xef),moment()['format'](_0x402d33(0x10c)))+_0x402d33(0x114)))),_0x402d33(0xff)]]})[_0x402d33(0x108)](function(_0xe87f73){const _0xcb538b=_0x402d33;logger[_0xcb538b(0xeb)](_0xcb538b(0x113),_0x40d8a7),logger[_0xcb538b(0xe7)](_0xcb538b(0x113),_0x40d8a7,JSON[_0xcb538b(0x117)](_0xe87f73)),_0x199430(_0xe87f73);})[_0x402d33(0x112)](function(_0x4c01d6){const _0x5df53c=_0x402d33;logger[_0x5df53c(0xfd)]('CountReScheduled',_0x4c01d6[_0x5df53c(0xf6)],_0x40d8a7),_0xf7be84(_0xa5159b[_0x5df53c(0xfd)](0x1f4,_0x4c01d6[_0x5df53c(0xf6)]));});});},exports[a167_0x4d3b81(0x10b)]=function(_0x3ec58c){const _0x1c5b7e=this;return new Promise(function(_0x3e7b26,_0x4c095a){const _0x32df5e=a167_0xa22a;return db[_0x32df5e(0x106)][_0x32df5e(0xf2)]()[_0x32df5e(0x108)](function(){const _0x15ae48=_0x32df5e;return db['sequelize']['transaction'](function(_0x1a9896){const _0x6287ac=a167_0xa22a;return db['CmHopper'][_0x6287ac(0x11f)]({'where':_0x3ec58c['options']?_0x3ec58c['options'][_0x6287ac(0x10a)]||null:null,'attributes':_0x3ec58c[_0x6287ac(0x111)]?_0x3ec58c[_0x6287ac(0x111)]['attributes']||null:null,'limit':0x1,'order':_0x3ec58c[_0x6287ac(0x111)]?_0x3ec58c[_0x6287ac(0x111)][_0x6287ac(0xf1)]||null:null,'group':db['CmHopper'][_0x6287ac(0x11b)],'transaction':_0x1a9896,'lock':_0x1a9896[_0x6287ac(0xfc)][_0x6287ac(0xed)],'include':_0x3ec58c[_0x6287ac(0x111)]?_0x3ec58c['options'][_0x6287ac(0x103)]?_['map'](_0x3ec58c[_0x6287ac(0x111)][_0x6287ac(0x103)],function(_0x53e9f4){const _0x4dc102=_0x6287ac;return{'model':db[_0x53e9f4[_0x4dc102(0x11c)]],'as':_0x53e9f4['as'],'attributes':_0x53e9f4[_0x4dc102(0x107)],'include':_0x53e9f4[_0x4dc102(0x103)]?_[_0x4dc102(0xf0)](_0x53e9f4[_0x4dc102(0x103)],function(_0x5d16d8){const _0x19e010=_0x4dc102;return{'model':db[_0x5d16d8[_0x19e010(0x11c)]],'as':_0x5d16d8['as'],'attributes':_0x5d16d8[_0x19e010(0x107)],'include':_0x5d16d8[_0x19e010(0x103)]?_[_0x19e010(0xf0)](_0x5d16d8[_0x19e010(0x103)],function(_0xe4c84b){const _0x584a1d=_0x19e010;return{'model':db[_0xe4c84b[_0x584a1d(0x11c)]],'as':_0xe4c84b['as'],'attributes':_0xe4c84b[_0x584a1d(0x107)]};}):[]};}):[]};}):[]:[]})['then'](function(_0x106eef){const _0x5ade07=_0x6287ac,_0x5eab4d=[];for(let _0x1a1678=0x0;_0x1a1678<_0x106eef[_0x5ade07(0x10d)];_0x1a1678+=0x1){_0x5eab4d[_0x5ade07(0x118)](_0x106eef[_0x1a1678][_0x5ade07(0x105)](_0x3ec58c[_0x5ade07(0xea)],{'transaction':_0x1a9896}));}return Promise[_0x5ade07(0x10f)](_0x5eab4d);});})[_0x15ae48(0x108)](function(_0x4c44e8){const _0x294549=_0x15ae48;logger['info'](_0x294549(0x10b),_0x3ec58c),logger['debug'](_0x294549(0x10b),_0x3ec58c,JSON['stringify'](_0x4c44e8)),_0x3e7b26(_0x4c44e8);})[_0x15ae48(0x112)](function(_0x4e4bad){const _0x830ee0=_0x15ae48;logger[_0x830ee0(0xfd)](_0x830ee0(0x10b),_0x4e4bad[_0x830ee0(0xf6)],_0x3ec58c),_0x4c095a(_0x1c5b7e[_0x830ee0(0xfd)](0x1f4,_0x4e4bad[_0x830ee0(0xf6)]));});});});},exports[a167_0x4d3b81(0x101)]=function(_0x387aa3){const _0x308dae=this;return new Promise(function(_0x1ac22a,_0x1f98a3){const _0x11c93b=a167_0xa22a;db['CmContact']['describe']()[_0x11c93b(0x108)](function(_0xb6f2f4){const _0x458396=_0x11c93b;return db[_0x458396(0xfa)][_0x458396(0x11f)]({'raw':_0x387aa3[_0x458396(0x111)]?_0x387aa3[_0x458396(0x111)][_0x458396(0x120)]===undefined?!![]:![]:!![],'where':_0x387aa3[_0x458396(0x111)]?_0x387aa3['options'][_0x458396(0x10a)]||null:null,'attributes':_0x387aa3[_0x458396(0x111)]?_0x387aa3['options']['attributes']||null:null,'limit':_0x387aa3[_0x458396(0x111)]?_0x387aa3[_0x458396(0x111)][_0x458396(0x104)]||null:null,'include':_0x387aa3['options']?_0x387aa3['options'][_0x458396(0x103)]?_[_0x458396(0xf0)](_0x387aa3['options'][_0x458396(0x103)],function(_0x574870){const _0x14d2aa=_0x458396;return{'model':db[_0x574870[_0x14d2aa(0x11c)]],'as':_0x574870['as'],'attributes':_0x574870['as']==='Contact'?_[_0x14d2aa(0x116)](_0xb6f2f4):_0x574870['attributes'],'include':_0x574870[_0x14d2aa(0x103)]?_[_0x14d2aa(0xf0)](_0x574870[_0x14d2aa(0x103)],function(_0x7716ea){const _0x264458=_0x14d2aa;return{'model':db[_0x7716ea[_0x264458(0x11c)]],'as':_0x7716ea['as'],'attributes':_0x7716ea['attributes'],'include':_0x7716ea[_0x264458(0x103)]?_[_0x264458(0xf0)](_0x7716ea[_0x264458(0x103)],function(_0x413ab1){return{'model':db[_0x413ab1['model']],'as':_0x413ab1['as'],'attributes':_0x413ab1['attributes']};}):[]};}):[]};}):[]:[]})[_0x458396(0x108)](function(_0x2537ff){const _0x21551f=_0x458396;logger[_0x21551f(0xeb)](_0x21551f(0xfb),_0x387aa3),logger[_0x21551f(0xe7)]('GetCmHopper',_0x387aa3,JSON[_0x21551f(0x117)](_0x2537ff)),_0x1ac22a(_0x2537ff);})[_0x458396(0x112)](function(_0x5e1275){const _0x539233=_0x458396;logger[_0x539233(0xfd)]('GetCmHopper',_0x5e1275['message'],_0x387aa3),_0x1f98a3(_0x308dae['error'](0x1f4,_0x5e1275[_0x539233(0xf6)]));});});});};
\ No newline at end of file