Built motion from commit 5fcd269f5146f10cf3129722d518881dfac64576. Version 3.0.0...
[motion-next.git] / server / api / cmHopper / cmHopper.rpc.js
index 9a45b0e..edc8603 100644 (file)
@@ -1 +1 @@
-const a139_0x4a30=['body','describe','limit','util','Contact','include','order','update','GetCmHopper','ShowCmHopper','CmHopper','CreateCmHopper','findAll','GetContactDialer','info','destroy','contactsRescheduled','findOne','debug','rpc','CmHopperFinal','all','LOCK','sequelize','CountReScheduled','../../mysqldb','includes','attributes','catch','map','stringify','\x20,\x201,\x20null','message','lodash','UPDATE','CmContact','length','User','error','format','YYYY-MM-DD\x20HH:mm:ss','options','transaction','where','DestroyCmHopper','model','UserId','../../config/logger','UpdateCmHopper','push','moment','`scheduledat`\x20>=\x20','raw','Agent','GetContactRecallMe','name','create','voicePause','COUNT','then','MoveContactManagedDialer'];(function(_0xcf6e1e,_0x4a30d7){const _0x3ac3e0=function(_0x4fefff){while(--_0x4fefff){_0xcf6e1e['push'](_0xcf6e1e['shift']());}};_0x3ac3e0(++_0x4a30d7);}(a139_0x4a30,0x16e));const a139_0x3ac3=function(_0xcf6e1e,_0x4a30d7){_0xcf6e1e=_0xcf6e1e-0x0;let _0x3ac3e0=a139_0x4a30[_0xcf6e1e];return _0x3ac3e0;};const _0x35f05e=a139_0x3ac3;'use strict';const _=require(_0x35f05e('0x21')),util=require(_0x35f05e('0x3')),moment=require(_0x35f05e('0x32')),db=require(_0x35f05e('0x19'))['db'],logger=require(_0x35f05e('0x2f'))(_0x35f05e('0x13')),{literal,fn}=require(_0x35f05e('0x17'));exports[_0x35f05e('0x8')]=function(_0x4fefff){const _0x926731=this;return new Promise(function(_0x31b7ae,_0x127ee6){const _0x514785=a139_0x3ac3;return db[_0x514785('0xa')][_0x514785('0xc')]({'raw':_0x4fefff['options']?_0x4fefff[_0x514785('0x29')][_0x514785('0x34')]===undefined?!![]:![]:!![],'where':_0x4fefff[_0x514785('0x29')]?_0x4fefff[_0x514785('0x29')][_0x514785('0x2b')]||null:null,'attributes':_0x4fefff[_0x514785('0x29')]?_0x4fefff[_0x514785('0x29')][_0x514785('0x1b')]||null:null,'limit':_0x4fefff[_0x514785('0x29')]?_0x4fefff[_0x514785('0x29')][_0x514785('0x2')]||null:null,'include':_0x4fefff[_0x514785('0x29')]?_0x4fefff[_0x514785('0x29')][_0x514785('0x5')]?_[_0x514785('0x1d')](_0x4fefff['options']['include'],function(_0x3103d3){const _0x4d8a67=_0x514785;return{'model':db[_0x3103d3[_0x4d8a67('0x2d')]],'as':_0x3103d3['as'],'attributes':_0x3103d3[_0x4d8a67('0x1b')],'include':_0x3103d3['include']?_[_0x4d8a67('0x1d')](_0x3103d3['include'],function(_0x469802){const _0xfbb28d=_0x4d8a67;return{'model':db[_0x469802[_0xfbb28d('0x2d')]],'as':_0x469802['as'],'attributes':_0x469802[_0xfbb28d('0x1b')],'include':_0x469802[_0xfbb28d('0x5')]?_['map'](_0x469802[_0xfbb28d('0x5')],function(_0x32737e){const _0x5b4c17=_0xfbb28d;return{'model':db[_0x32737e[_0x5b4c17('0x2d')]],'as':_0x32737e['as'],'attributes':_0x32737e[_0x5b4c17('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x514785('0x3b')](function(_0x31bfdd){const _0x12f273=_0x514785;logger[_0x12f273('0xe')](_0x12f273('0x8'),_0x4fefff),logger[_0x12f273('0x12')](_0x12f273('0x8'),_0x4fefff,JSON[_0x12f273('0x1e')](_0x31bfdd)),_0x31b7ae(_0x31bfdd);})[_0x514785('0x1c')](function(_0x6b576b){const _0x525193=_0x514785;logger[_0x525193('0x26')](_0x525193('0x8'),_0x6b576b[_0x525193('0x20')],_0x4fefff),_0x127ee6(_0x926731[_0x525193('0x26')](0x1f4,_0x6b576b[_0x525193('0x20')]));});});},exports[_0x35f05e('0x9')]=function(_0x140955){const _0x1e9860=this;return new Promise(function(_0x1c9f90,_0x45dc46){const _0x3b222b=a139_0x3ac3;return db[_0x3b222b('0xa')][_0x3b222b('0x11')]({'raw':_0x140955[_0x3b222b('0x29')]?_0x140955[_0x3b222b('0x29')][_0x3b222b('0x34')]===undefined?!![]:![]:!![],'where':_0x140955['options']?_0x140955[_0x3b222b('0x29')][_0x3b222b('0x2b')]||null:null,'attributes':_0x140955[_0x3b222b('0x29')]?_0x140955[_0x3b222b('0x29')][_0x3b222b('0x1b')]||null:null,'include':_0x140955[_0x3b222b('0x29')]?_0x140955[_0x3b222b('0x29')][_0x3b222b('0x5')]?_[_0x3b222b('0x1d')](_0x140955[_0x3b222b('0x29')]['include'],function(_0x39dd9e){const _0x276cb0=_0x3b222b;return{'model':db[_0x39dd9e[_0x276cb0('0x2d')]],'as':_0x39dd9e['as'],'attributes':_0x39dd9e['attributes'],'include':_0x39dd9e[_0x276cb0('0x5')]?_[_0x276cb0('0x1d')](_0x39dd9e[_0x276cb0('0x5')],function(_0x148863){const _0x3dcad8=_0x276cb0;return{'model':db[_0x148863[_0x3dcad8('0x2d')]],'as':_0x148863['as'],'attributes':_0x148863[_0x3dcad8('0x1b')],'include':_0x148863['include']?_['map'](_0x148863[_0x3dcad8('0x5')],function(_0x250d24){const _0x4f852b=_0x3dcad8;return{'model':db[_0x250d24[_0x4f852b('0x2d')]],'as':_0x250d24['as'],'attributes':_0x250d24[_0x4f852b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3b222b('0x3b')](function(_0x4617dc){const _0x52bc00=_0x3b222b;logger[_0x52bc00('0xe')](_0x52bc00('0x9'),_0x140955),logger[_0x52bc00('0x12')](_0x52bc00('0x9'),_0x140955,JSON['stringify'](_0x4617dc)),_0x1c9f90(_0x4617dc);})[_0x3b222b('0x1c')](function(_0x4e9bdb){const _0x138e0c=_0x3b222b;logger[_0x138e0c('0x26')](_0x138e0c('0x9'),_0x4e9bdb[_0x138e0c('0x20')],_0x140955),_0x45dc46(_0x1e9860[_0x138e0c('0x26')](0x1f4,_0x4e9bdb[_0x138e0c('0x20')]));});});},exports[_0x35f05e('0xb')]=function(_0x1475f2){const _0xafae5b=this;return new Promise(function(_0x9975df,_0x30284a){const _0x51f04e=a139_0x3ac3;return db[_0x51f04e('0xa')][_0x51f04e('0x38')](_0x1475f2[_0x51f04e('0x0')],{'raw':_0x1475f2[_0x51f04e('0x29')]?_0x1475f2['options']['raw']===undefined?!![]:![]:!![]})[_0x51f04e('0x3b')](function(_0x505f2a){const _0x369fd1=_0x51f04e;logger[_0x369fd1('0xe')](_0x369fd1('0xb'),_0x1475f2),logger[_0x369fd1('0x12')](_0x369fd1('0xb'),_0x1475f2,JSON[_0x369fd1('0x1e')](_0x505f2a)),_0x9975df(_0x505f2a);})[_0x51f04e('0x1c')](function(_0x44dc16){const _0x5a5a75=_0x51f04e;logger[_0x5a5a75('0x26')](_0x5a5a75('0xb'),_0x44dc16[_0x5a5a75('0x20')],_0x1475f2),_0x30284a(_0xafae5b[_0x5a5a75('0x26')](0x1f4,_0x44dc16[_0x5a5a75('0x20')]));});});},exports['UpdateCmHopper']=function(_0x4fc194){const _0x1290c9=this;return new Promise(function(_0x378a20,_0x212900){const _0x385880=a139_0x3ac3;return db[_0x385880('0xa')][_0x385880('0x7')](_0x4fc194[_0x385880('0x0')],{'raw':_0x4fc194[_0x385880('0x29')]?_0x4fc194[_0x385880('0x29')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fc194[_0x385880('0x29')]?_0x4fc194[_0x385880('0x29')]['where']||null:null,'attributes':_0x4fc194[_0x385880('0x29')]?_0x4fc194[_0x385880('0x29')]['attributes']||null:null,'limit':_0x4fc194['options']?_0x4fc194['options'][_0x385880('0x2')]||null:null})[_0x385880('0x3b')](function(_0x13a55f){const _0x1bc9a0=_0x385880;logger[_0x1bc9a0('0xe')](_0x1bc9a0('0x30'),_0x4fc194),logger[_0x1bc9a0('0x12')](_0x1bc9a0('0x30'),_0x4fc194,JSON[_0x1bc9a0('0x1e')](_0x13a55f)),_0x378a20(_0x13a55f);})[_0x385880('0x1c')](function(_0x3a617b){const _0x138c54=_0x385880;logger[_0x138c54('0x26')]('UpdateCmHopper',_0x3a617b[_0x138c54('0x20')],_0x4fc194),_0x212900(_0x1290c9['error'](0x1f4,_0x3a617b[_0x138c54('0x20')]));});});},exports['DestroyCmHopper']=function(_0x137b71){const _0x35d77c=this;return new Promise(function(_0x289a08,_0x46a03f){const _0x325cc9=a139_0x3ac3;return db['CmHopper'][_0x325cc9('0xf')]({'where':_0x137b71[_0x325cc9('0x29')]?_0x137b71[_0x325cc9('0x29')][_0x325cc9('0x2b')]||null:null})[_0x325cc9('0x3b')](function(_0x129d41){const _0x3fc12c=_0x325cc9;logger['info'](_0x3fc12c('0x2c'),_0x137b71),logger['debug'](_0x3fc12c('0x2c'),_0x137b71,JSON['stringify'](_0x129d41)),_0x289a08(_0x129d41);})[_0x325cc9('0x1c')](function(_0x5761b3){const _0x1ba140=_0x325cc9;logger[_0x1ba140('0x26')]('DestroyCmHopper',_0x5761b3['message'],_0x137b71),_0x46a03f(_0x35d77c[_0x1ba140('0x26')](0x1f4,_0x5761b3[_0x1ba140('0x20')]));});});},exports[_0x35f05e('0xd')]=function(_0x1ddc1e){const _0x21dcb3=this;return new Promise(function(_0x587a77,_0x5cc54a){const _0x23b87e=a139_0x3ac3;return db[_0x23b87e('0x23')][_0x23b87e('0x1')]()[_0x23b87e('0x3b')](function(_0x4923b4){const _0x583b8a=_0x23b87e;return db['sequelize'][_0x583b8a('0x2a')](function(_0x2c172f){const _0x3dbc74=_0x583b8a;return db[_0x3dbc74('0xa')][_0x3dbc74('0xc')]({'where':_0x1ddc1e[_0x3dbc74('0x29')]?_0x1ddc1e[_0x3dbc74('0x29')][_0x3dbc74('0x2b')]||null:null,'attributes':_0x1ddc1e[_0x3dbc74('0x29')]?_0x1ddc1e[_0x3dbc74('0x29')][_0x3dbc74('0x1b')]||null:null,'limit':_0x1ddc1e[_0x3dbc74('0x29')]?_0x1ddc1e[_0x3dbc74('0x29')]['limit']||null:null,'order':_0x1ddc1e[_0x3dbc74('0x29')]?_0x1ddc1e['options'][_0x3dbc74('0x6')]||null:null,'transaction':_0x2c172f,'lock':_0x2c172f['LOCK'][_0x3dbc74('0x22')],'include':[{'model':db['CmContact'],'as':_0x3dbc74('0x4'),'attributes':_['keys'](_0x4923b4)},{'model':db[_0x3dbc74('0x25')],'as':_0x3dbc74('0x35'),'attributes':['id',_0x3dbc74('0x37'),_0x3dbc74('0x39')]}]})[_0x3dbc74('0x3b')](function(_0xe74e23){const _0x38fe6d=_0x3dbc74,_0x2d70fb=[],_0x13c2a6=[];for(let _0x391c9a=0x0;_0x391c9a<_0xe74e23[_0x38fe6d('0x24')];_0x391c9a+=0x1){!_0x13c2a6[_0x38fe6d('0x1a')](_0xe74e23[_0x391c9a][_0x38fe6d('0x2e')])&&(_0x13c2a6[_0x38fe6d('0x31')](_0xe74e23[_0x391c9a][_0x38fe6d('0x2e')]),_0x2d70fb[_0x38fe6d('0x31')](_0xe74e23[_0x391c9a]['update'](_0x1ddc1e[_0x38fe6d('0x0')],{'transaction':_0x2c172f})));}return Promise['all'](_0x2d70fb);});})['then'](function(_0x5c4389){const _0x5250c6=_0x583b8a;logger['info'](_0x5250c6('0xd'),_0x1ddc1e),logger[_0x5250c6('0x12')]('GetContactDialer',_0x1ddc1e,JSON[_0x5250c6('0x1e')](_0x5c4389)),_0x587a77(_0x5c4389);})['catch'](function(_0x3d61c3){const _0x3ee064=_0x583b8a;logger[_0x3ee064('0x26')](_0x3ee064('0xd'),_0x3d61c3[_0x3ee064('0x20')],_0x1ddc1e),_0x5cc54a(_0x21dcb3[_0x3ee064('0x26')](0x1f4,_0x3d61c3[_0x3ee064('0x20')]));});});});},exports['MoveContactManagedDialer']=function(_0x47cbfb){const _0x4e2908=this;return new Promise(function(_0x48e4c8,_0x6b5bc3){const _0x471b71=a139_0x3ac3;return db[_0x471b71('0x17')][_0x471b71('0x2a')](function(_0x52efd4){const _0x36cea5=_0x471b71;return db[_0x36cea5('0x14')]['create'](_0x47cbfb['body'],{'raw':_0x47cbfb['options']?_0x47cbfb[_0x36cea5('0x29')][_0x36cea5('0x34')]===undefined?!![]:![]:!![],'transaction':_0x52efd4})[_0x36cea5('0x3b')](function(){const _0x5b2758=_0x36cea5;return db['CmHopper'][_0x5b2758('0xf')]({'where':_0x47cbfb[_0x5b2758('0x29')]?_0x47cbfb[_0x5b2758('0x29')][_0x5b2758('0x2b')]||null:null,'transaction':_0x52efd4});});})[_0x471b71('0x3b')](function(_0x30d125){const _0x30d751=_0x471b71;logger[_0x30d751('0xe')](_0x30d751('0x3c'),_0x47cbfb),logger[_0x30d751('0x12')](_0x30d751('0x3c'),_0x47cbfb,JSON[_0x30d751('0x1e')](_0x30d125)),_0x48e4c8(_0x30d125);})[_0x471b71('0x1c')](function(_0x3aad28){const _0x3a6553=_0x471b71;logger['error'](_0x3a6553('0x3c'),_0x3aad28[_0x3a6553('0x20')],_0x47cbfb),_0x6b5bc3(_0x4e2908[_0x3a6553('0x26')](0x1f4,_0x3aad28[_0x3a6553('0x20')]));});});},exports[_0x35f05e('0x18')]=function(_0x1cdd40){const _0x30a3d7=this;return new Promise(function(_0x249b2c,_0x5d0f46){const _0x19e284=a139_0x3ac3;return db[_0x19e284('0xa')][_0x19e284('0xc')]({'raw':_0x1cdd40[_0x19e284('0x29')]?_0x1cdd40['options'][_0x19e284('0x34')]===undefined?!![]:![]:!![],'where':_0x1cdd40['options']?_0x1cdd40['options'][_0x19e284('0x2b')]||null:null,'attributes':[[fn(_0x19e284('0x3a'),fn('IF',literal(_0x19e284('0x33')+util[_0x19e284('0x27')]('\x22%s\x22',moment()['format'](_0x19e284('0x28')))+_0x19e284('0x1f')))),_0x19e284('0x10')]]})[_0x19e284('0x3b')](function(_0x25d3cb){const _0x797bd4=_0x19e284;logger[_0x797bd4('0xe')](_0x797bd4('0x18'),_0x1cdd40),logger[_0x797bd4('0x12')]('CountReScheduled',_0x1cdd40,JSON['stringify'](_0x25d3cb)),_0x249b2c(_0x25d3cb);})[_0x19e284('0x1c')](function(_0x3c0912){const _0x4f27a7=_0x19e284;logger['error'](_0x4f27a7('0x18'),_0x3c0912['message'],_0x1cdd40),_0x5d0f46(_0x30a3d7[_0x4f27a7('0x26')](0x1f4,_0x3c0912[_0x4f27a7('0x20')]));});});},exports[_0x35f05e('0x36')]=function(_0x34fd32){const _0x5c4ba5=this;return new Promise(function(_0x4b4324,_0x5283bd){const _0x3256d3=a139_0x3ac3;return db[_0x3256d3('0x23')][_0x3256d3('0x1')]()[_0x3256d3('0x3b')](function(){const _0x58c505=_0x3256d3;return db[_0x58c505('0x17')][_0x58c505('0x2a')](function(_0x4ee1d5){const _0x342d4d=_0x58c505;return db['CmHopper'][_0x342d4d('0xc')]({'where':_0x34fd32[_0x342d4d('0x29')]?_0x34fd32['options'][_0x342d4d('0x2b')]||null:null,'attributes':_0x34fd32[_0x342d4d('0x29')]?_0x34fd32['options']['attributes']||null:null,'limit':0x1,'order':_0x34fd32[_0x342d4d('0x29')]?_0x34fd32[_0x342d4d('0x29')]['order']||null:null,'group':db[_0x342d4d('0xa')][_0x342d4d('0x2e')],'transaction':_0x4ee1d5,'lock':_0x4ee1d5[_0x342d4d('0x16')][_0x342d4d('0x22')],'include':_0x34fd32[_0x342d4d('0x29')]?_0x34fd32['options']['include']?_['map'](_0x34fd32[_0x342d4d('0x29')][_0x342d4d('0x5')],function(_0x1eb547){const _0x5a7592=_0x342d4d;return{'model':db[_0x1eb547[_0x5a7592('0x2d')]],'as':_0x1eb547['as'],'attributes':_0x1eb547[_0x5a7592('0x1b')],'include':_0x1eb547[_0x5a7592('0x5')]?_[_0x5a7592('0x1d')](_0x1eb547[_0x5a7592('0x5')],function(_0xf9b802){const _0x2ae04d=_0x5a7592;return{'model':db[_0xf9b802[_0x2ae04d('0x2d')]],'as':_0xf9b802['as'],'attributes':_0xf9b802[_0x2ae04d('0x1b')],'include':_0xf9b802[_0x2ae04d('0x5')]?_[_0x2ae04d('0x1d')](_0xf9b802[_0x2ae04d('0x5')],function(_0x2608ef){const _0x44185f=_0x2ae04d;return{'model':db[_0x2608ef['model']],'as':_0x2608ef['as'],'attributes':_0x2608ef[_0x44185f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x342d4d('0x3b')](function(_0x32e837){const _0x50f563=_0x342d4d,_0x5de588=[];for(let _0x5d659c=0x0;_0x5d659c<_0x32e837['length'];_0x5d659c+=0x1){_0x5de588['push'](_0x32e837[_0x5d659c][_0x50f563('0x7')](_0x34fd32[_0x50f563('0x0')],{'transaction':_0x4ee1d5}));}return Promise[_0x50f563('0x15')](_0x5de588);});})[_0x58c505('0x3b')](function(_0x50b6c8){const _0x1e9bfc=_0x58c505;logger[_0x1e9bfc('0xe')]('GetContactRecallMe',_0x34fd32),logger['debug']('GetContactRecallMe',_0x34fd32,JSON[_0x1e9bfc('0x1e')](_0x50b6c8)),_0x4b4324(_0x50b6c8);})[_0x58c505('0x1c')](function(_0x2464a0){const _0x2cbdc0=_0x58c505;logger['error'](_0x2cbdc0('0x36'),_0x2464a0['message'],_0x34fd32),_0x5283bd(_0x5c4ba5[_0x2cbdc0('0x26')](0x1f4,_0x2464a0[_0x2cbdc0('0x20')]));});});});},exports['GetCmHopperPreview']=function(_0x29ac32){const _0x321a1f=this;return new Promise(function(_0x41b3b8,_0x1bed2f){const _0x31249c=a139_0x3ac3;db[_0x31249c('0x23')]['describe']()['then'](function(_0x5904f7){const _0x40fa0c=_0x31249c;return db[_0x40fa0c('0xa')][_0x40fa0c('0xc')]({'raw':_0x29ac32['options']?_0x29ac32[_0x40fa0c('0x29')][_0x40fa0c('0x34')]===undefined?!![]:![]:!![],'where':_0x29ac32['options']?_0x29ac32[_0x40fa0c('0x29')][_0x40fa0c('0x2b')]||null:null,'attributes':_0x29ac32['options']?_0x29ac32[_0x40fa0c('0x29')][_0x40fa0c('0x1b')]||null:null,'limit':_0x29ac32[_0x40fa0c('0x29')]?_0x29ac32['options'][_0x40fa0c('0x2')]||null:null,'include':_0x29ac32[_0x40fa0c('0x29')]?_0x29ac32[_0x40fa0c('0x29')][_0x40fa0c('0x5')]?_['map'](_0x29ac32[_0x40fa0c('0x29')]['include'],function(_0x5800d3){const _0x1fc20e=_0x40fa0c;return{'model':db[_0x5800d3[_0x1fc20e('0x2d')]],'as':_0x5800d3['as'],'attributes':_0x5800d3['as']===_0x1fc20e('0x4')?_['keys'](_0x5904f7):_0x5800d3['attributes'],'include':_0x5800d3['include']?_[_0x1fc20e('0x1d')](_0x5800d3[_0x1fc20e('0x5')],function(_0x4dd3b0){const _0x361fc0=_0x1fc20e;return{'model':db[_0x4dd3b0['model']],'as':_0x4dd3b0['as'],'attributes':_0x4dd3b0[_0x361fc0('0x1b')],'include':_0x4dd3b0[_0x361fc0('0x5')]?_[_0x361fc0('0x1d')](_0x4dd3b0[_0x361fc0('0x5')],function(_0x375f4d){const _0x44a501=_0x361fc0;return{'model':db[_0x375f4d[_0x44a501('0x2d')]],'as':_0x375f4d['as'],'attributes':_0x375f4d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2be17d){const _0x209aae=_0x40fa0c;logger['info'](_0x209aae('0x8'),_0x29ac32),logger[_0x209aae('0x12')](_0x209aae('0x8'),_0x29ac32,JSON[_0x209aae('0x1e')](_0x2be17d)),_0x41b3b8(_0x2be17d);})[_0x40fa0c('0x1c')](function(_0x186a59){const _0x124b04=_0x40fa0c;logger[_0x124b04('0x26')](_0x124b04('0x8'),_0x186a59['message'],_0x29ac32),_0x1bed2f(_0x321a1f[_0x124b04('0x26')](0x1f4,_0x186a59[_0x124b04('0x20')]));});});});};
\ No newline at end of file
+const a139_0x2b68=['DestroyCmHopper','describe','LOCK','Contact','../../mysqldb','body','raw','all','../../config/logger','\x22%s\x22','User','COUNT','debug','map','info','util','GetContactDialer','attributes','create','where','update','includes','MoveContactManagedDialer','model','UPDATE','GetContactRecallMe','voicePause','lodash','length','CmHopper','sequelize','CmContact','include','order','GetCmHopper','UpdateCmHopper','catch','options','limit','name','GetCmHopperPreview','CountReScheduled','rpc','CreateCmHopper','UserId','findAll','error','YYYY-MM-DD\x20HH:mm:ss','ShowCmHopper','findOne','then','keys','transaction','destroy','stringify','message','format','push'];(function(_0x618356,_0x2b687f){const _0x5839c8=function(_0x5e018c){while(--_0x5e018c){_0x618356['push'](_0x618356['shift']());}};_0x5839c8(++_0x2b687f);}(a139_0x2b68,0x9f));const a139_0x5839=function(_0x618356,_0x2b687f){_0x618356=_0x618356-0x0;let _0x5839c8=a139_0x2b68[_0x618356];return _0x5839c8;};const _0x103812=a139_0x5839;'use strict';const _=require(_0x103812('0x2a')),util=require(_0x103812('0x1e')),moment=require('moment'),db=require(_0x103812('0x13'))['db'],logger=require(_0x103812('0x17'))(_0x103812('0x39')),{literal,fn}=require(_0x103812('0x2d'));exports[_0x103812('0x31')]=function(_0x5e018c){const _0x7422e8=this;return new Promise(function(_0x3cc1bb,_0x4659b0){const _0x3e15a1=a139_0x5839;return db['CmHopper'][_0x3e15a1('0x2')]({'raw':_0x5e018c['options']?_0x5e018c[_0x3e15a1('0x34')][_0x3e15a1('0x15')]===undefined?!![]:![]:!![],'where':_0x5e018c[_0x3e15a1('0x34')]?_0x5e018c[_0x3e15a1('0x34')][_0x3e15a1('0x22')]||null:null,'attributes':_0x5e018c['options']?_0x5e018c[_0x3e15a1('0x34')][_0x3e15a1('0x20')]||null:null,'limit':_0x5e018c[_0x3e15a1('0x34')]?_0x5e018c[_0x3e15a1('0x34')]['limit']||null:null,'include':_0x5e018c[_0x3e15a1('0x34')]?_0x5e018c[_0x3e15a1('0x34')][_0x3e15a1('0x2f')]?_[_0x3e15a1('0x1c')](_0x5e018c[_0x3e15a1('0x34')][_0x3e15a1('0x2f')],function(_0xd05478){const _0x7bc718=_0x3e15a1;return{'model':db[_0xd05478[_0x7bc718('0x26')]],'as':_0xd05478['as'],'attributes':_0xd05478[_0x7bc718('0x20')],'include':_0xd05478['include']?_[_0x7bc718('0x1c')](_0xd05478[_0x7bc718('0x2f')],function(_0x42030b){const _0x219401=_0x7bc718;return{'model':db[_0x42030b[_0x219401('0x26')]],'as':_0x42030b['as'],'attributes':_0x42030b[_0x219401('0x20')],'include':_0x42030b[_0x219401('0x2f')]?_[_0x219401('0x1c')](_0x42030b['include'],function(_0x425001){const _0x3bb9c2=_0x219401;return{'model':db[_0x425001['model']],'as':_0x425001['as'],'attributes':_0x425001[_0x3bb9c2('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3e15a1('0x7')](function(_0x8ed1b4){const _0x6ed4a2=_0x3e15a1;logger[_0x6ed4a2('0x1d')]('GetCmHopper',_0x5e018c),logger[_0x6ed4a2('0x1b')](_0x6ed4a2('0x31'),_0x5e018c,JSON[_0x6ed4a2('0xb')](_0x8ed1b4)),_0x3cc1bb(_0x8ed1b4);})[_0x3e15a1('0x33')](function(_0x3db786){const _0xc20ddf=_0x3e15a1;logger[_0xc20ddf('0x3')](_0xc20ddf('0x31'),_0x3db786[_0xc20ddf('0xc')],_0x5e018c),_0x4659b0(_0x7422e8[_0xc20ddf('0x3')](0x1f4,_0x3db786[_0xc20ddf('0xc')]));});});},exports['ShowCmHopper']=function(_0x351acf){const _0x3f7f74=this;return new Promise(function(_0x1d4b3d,_0x377483){const _0x49bfa9=a139_0x5839;return db[_0x49bfa9('0x2c')][_0x49bfa9('0x6')]({'raw':_0x351acf['options']?_0x351acf[_0x49bfa9('0x34')][_0x49bfa9('0x15')]===undefined?!![]:![]:!![],'where':_0x351acf['options']?_0x351acf['options'][_0x49bfa9('0x22')]||null:null,'attributes':_0x351acf[_0x49bfa9('0x34')]?_0x351acf[_0x49bfa9('0x34')]['attributes']||null:null,'include':_0x351acf[_0x49bfa9('0x34')]?_0x351acf[_0x49bfa9('0x34')][_0x49bfa9('0x2f')]?_[_0x49bfa9('0x1c')](_0x351acf[_0x49bfa9('0x34')][_0x49bfa9('0x2f')],function(_0x39e3e0){const _0x32339c=_0x49bfa9;return{'model':db[_0x39e3e0['model']],'as':_0x39e3e0['as'],'attributes':_0x39e3e0['attributes'],'include':_0x39e3e0[_0x32339c('0x2f')]?_[_0x32339c('0x1c')](_0x39e3e0['include'],function(_0x5d3ab9){const _0x492a39=_0x32339c;return{'model':db[_0x5d3ab9[_0x492a39('0x26')]],'as':_0x5d3ab9['as'],'attributes':_0x5d3ab9[_0x492a39('0x20')],'include':_0x5d3ab9[_0x492a39('0x2f')]?_[_0x492a39('0x1c')](_0x5d3ab9['include'],function(_0x2d4221){const _0x354587=_0x492a39;return{'model':db[_0x2d4221[_0x354587('0x26')]],'as':_0x2d4221['as'],'attributes':_0x2d4221[_0x354587('0x20')]};}):[]};}):[]};}):[]:[]})[_0x49bfa9('0x7')](function(_0x32e8af){const _0x3920a5=_0x49bfa9;logger['info'](_0x3920a5('0x5'),_0x351acf),logger[_0x3920a5('0x1b')]('ShowCmHopper',_0x351acf,JSON[_0x3920a5('0xb')](_0x32e8af)),_0x1d4b3d(_0x32e8af);})[_0x49bfa9('0x33')](function(_0x1463d2){const _0x2be32d=_0x49bfa9;logger[_0x2be32d('0x3')](_0x2be32d('0x5'),_0x1463d2[_0x2be32d('0xc')],_0x351acf),_0x377483(_0x3f7f74['error'](0x1f4,_0x1463d2[_0x2be32d('0xc')]));});});},exports[_0x103812('0x0')]=function(_0x4b0563){const _0x446c55=this;return new Promise(function(_0x50db8f,_0x159ec9){const _0x578c6d=a139_0x5839;return db[_0x578c6d('0x2c')][_0x578c6d('0x21')](_0x4b0563[_0x578c6d('0x14')],{'raw':_0x4b0563[_0x578c6d('0x34')]?_0x4b0563[_0x578c6d('0x34')][_0x578c6d('0x15')]===undefined?!![]:![]:!![]})[_0x578c6d('0x7')](function(_0x44d9d7){const _0x584224=_0x578c6d;logger[_0x584224('0x1d')](_0x584224('0x0'),_0x4b0563),logger[_0x584224('0x1b')](_0x584224('0x0'),_0x4b0563,JSON[_0x584224('0xb')](_0x44d9d7)),_0x50db8f(_0x44d9d7);})[_0x578c6d('0x33')](function(_0x517dcd){const _0x5167cb=_0x578c6d;logger[_0x5167cb('0x3')](_0x5167cb('0x0'),_0x517dcd[_0x5167cb('0xc')],_0x4b0563),_0x159ec9(_0x446c55[_0x5167cb('0x3')](0x1f4,_0x517dcd['message']));});});},exports[_0x103812('0x32')]=function(_0x514bd9){const _0x80d408=this;return new Promise(function(_0x3eb4f6,_0x401394){const _0x1ed38=a139_0x5839;return db[_0x1ed38('0x2c')][_0x1ed38('0x23')](_0x514bd9['body'],{'raw':_0x514bd9['options']?_0x514bd9[_0x1ed38('0x34')][_0x1ed38('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x514bd9[_0x1ed38('0x34')]?_0x514bd9[_0x1ed38('0x34')][_0x1ed38('0x22')]||null:null,'attributes':_0x514bd9['options']?_0x514bd9[_0x1ed38('0x34')]['attributes']||null:null,'limit':_0x514bd9[_0x1ed38('0x34')]?_0x514bd9[_0x1ed38('0x34')]['limit']||null:null})[_0x1ed38('0x7')](function(_0x5c6b2b){const _0x359282=_0x1ed38;logger['info']('UpdateCmHopper',_0x514bd9),logger[_0x359282('0x1b')](_0x359282('0x32'),_0x514bd9,JSON[_0x359282('0xb')](_0x5c6b2b)),_0x3eb4f6(_0x5c6b2b);})[_0x1ed38('0x33')](function(_0x2cfeab){const _0x2505cd=_0x1ed38;logger[_0x2505cd('0x3')](_0x2505cd('0x32'),_0x2cfeab['message'],_0x514bd9),_0x401394(_0x80d408[_0x2505cd('0x3')](0x1f4,_0x2cfeab[_0x2505cd('0xc')]));});});},exports[_0x103812('0xf')]=function(_0x436a64){const _0x47474d=this;return new Promise(function(_0x577743,_0x388d7e){const _0x7faf9b=a139_0x5839;return db[_0x7faf9b('0x2c')]['destroy']({'where':_0x436a64[_0x7faf9b('0x34')]?_0x436a64[_0x7faf9b('0x34')][_0x7faf9b('0x22')]||null:null})[_0x7faf9b('0x7')](function(_0x1afa1f){const _0x34d3f4=_0x7faf9b;logger[_0x34d3f4('0x1d')](_0x34d3f4('0xf'),_0x436a64),logger[_0x34d3f4('0x1b')](_0x34d3f4('0xf'),_0x436a64,JSON['stringify'](_0x1afa1f)),_0x577743(_0x1afa1f);})[_0x7faf9b('0x33')](function(_0x52540e){const _0x1e63e4=_0x7faf9b;logger[_0x1e63e4('0x3')](_0x1e63e4('0xf'),_0x52540e['message'],_0x436a64),_0x388d7e(_0x47474d[_0x1e63e4('0x3')](0x1f4,_0x52540e['message']));});});},exports[_0x103812('0x1f')]=function(_0x2197c1){const _0x16ada1=this;return new Promise(function(_0x3584f7,_0x303d96){const _0xed8911=a139_0x5839;return db[_0xed8911('0x2e')][_0xed8911('0x10')]()[_0xed8911('0x7')](function(_0x53862b){const _0x1921b7=_0xed8911;return db[_0x1921b7('0x2d')][_0x1921b7('0x9')](function(_0x2d9bee){const _0x5b4660=_0x1921b7;return db[_0x5b4660('0x2c')]['findAll']({'where':_0x2197c1[_0x5b4660('0x34')]?_0x2197c1[_0x5b4660('0x34')][_0x5b4660('0x22')]||null:null,'attributes':_0x2197c1[_0x5b4660('0x34')]?_0x2197c1[_0x5b4660('0x34')]['attributes']||null:null,'limit':_0x2197c1[_0x5b4660('0x34')]?_0x2197c1[_0x5b4660('0x34')][_0x5b4660('0x35')]||null:null,'order':_0x2197c1[_0x5b4660('0x34')]?_0x2197c1[_0x5b4660('0x34')][_0x5b4660('0x30')]||null:null,'transaction':_0x2d9bee,'lock':_0x2d9bee[_0x5b4660('0x11')][_0x5b4660('0x27')],'include':[{'model':db[_0x5b4660('0x2e')],'as':_0x5b4660('0x12'),'attributes':_['keys'](_0x53862b)},{'model':db[_0x5b4660('0x19')],'as':'Agent','attributes':['id',_0x5b4660('0x36'),_0x5b4660('0x29')]}]})[_0x5b4660('0x7')](function(_0x4a6100){const _0x16d1ec=_0x5b4660,_0x54f44d=[],_0x4eb611=[];for(let _0x41aab1=0x0;_0x41aab1<_0x4a6100[_0x16d1ec('0x2b')];_0x41aab1+=0x1){!_0x4eb611[_0x16d1ec('0x24')](_0x4a6100[_0x41aab1]['UserId'])&&(_0x4eb611[_0x16d1ec('0xe')](_0x4a6100[_0x41aab1][_0x16d1ec('0x1')]),_0x54f44d[_0x16d1ec('0xe')](_0x4a6100[_0x41aab1][_0x16d1ec('0x23')](_0x2197c1['body'],{'transaction':_0x2d9bee})));}return Promise[_0x16d1ec('0x16')](_0x54f44d);});})[_0x1921b7('0x7')](function(_0x17d083){const _0x4b8c2c=_0x1921b7;logger[_0x4b8c2c('0x1d')](_0x4b8c2c('0x1f'),_0x2197c1),logger[_0x4b8c2c('0x1b')]('GetContactDialer',_0x2197c1,JSON[_0x4b8c2c('0xb')](_0x17d083)),_0x3584f7(_0x17d083);})[_0x1921b7('0x33')](function(_0x33e915){const _0x3ec954=_0x1921b7;logger['error'](_0x3ec954('0x1f'),_0x33e915[_0x3ec954('0xc')],_0x2197c1),_0x303d96(_0x16ada1['error'](0x1f4,_0x33e915['message']));});});});},exports['MoveContactManagedDialer']=function(_0x8b1425){const _0x35c03c=this;return new Promise(function(_0x56f8e3,_0x258801){const _0x159f08=a139_0x5839;return db[_0x159f08('0x2d')][_0x159f08('0x9')](function(_0x53ce6e){const _0x25d927=_0x159f08;return db['CmHopperFinal'][_0x25d927('0x21')](_0x8b1425[_0x25d927('0x14')],{'raw':_0x8b1425['options']?_0x8b1425[_0x25d927('0x34')][_0x25d927('0x15')]===undefined?!![]:![]:!![],'transaction':_0x53ce6e})[_0x25d927('0x7')](function(){const _0x480343=_0x25d927;return db[_0x480343('0x2c')][_0x480343('0xa')]({'where':_0x8b1425[_0x480343('0x34')]?_0x8b1425[_0x480343('0x34')][_0x480343('0x22')]||null:null,'transaction':_0x53ce6e});});})[_0x159f08('0x7')](function(_0x180e81){const _0x5824b3=_0x159f08;logger[_0x5824b3('0x1d')](_0x5824b3('0x25'),_0x8b1425),logger['debug'](_0x5824b3('0x25'),_0x8b1425,JSON['stringify'](_0x180e81)),_0x56f8e3(_0x180e81);})[_0x159f08('0x33')](function(_0x50bc9a){const _0x5b6a5a=_0x159f08;logger['error'](_0x5b6a5a('0x25'),_0x50bc9a['message'],_0x8b1425),_0x258801(_0x35c03c[_0x5b6a5a('0x3')](0x1f4,_0x50bc9a[_0x5b6a5a('0xc')]));});});},exports[_0x103812('0x38')]=function(_0x16f1bf){const _0x26a3e2=this;return new Promise(function(_0x77fd3b,_0x56f9b5){const _0x840e72=a139_0x5839;return db['CmHopper'][_0x840e72('0x2')]({'raw':_0x16f1bf[_0x840e72('0x34')]?_0x16f1bf[_0x840e72('0x34')][_0x840e72('0x15')]===undefined?!![]:![]:!![],'where':_0x16f1bf[_0x840e72('0x34')]?_0x16f1bf[_0x840e72('0x34')][_0x840e72('0x22')]||null:null,'attributes':[[fn(_0x840e72('0x1a'),fn('IF',literal('`scheduledat`\x20>=\x20'+util['format'](_0x840e72('0x18'),moment()[_0x840e72('0xd')](_0x840e72('0x4')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})[_0x840e72('0x7')](function(_0x6c6cee){const _0x514767=_0x840e72;logger['info'](_0x514767('0x38'),_0x16f1bf),logger[_0x514767('0x1b')](_0x514767('0x38'),_0x16f1bf,JSON[_0x514767('0xb')](_0x6c6cee)),_0x77fd3b(_0x6c6cee);})['catch'](function(_0xe54cfa){const _0x11c125=_0x840e72;logger[_0x11c125('0x3')]('CountReScheduled',_0xe54cfa[_0x11c125('0xc')],_0x16f1bf),_0x56f9b5(_0x26a3e2[_0x11c125('0x3')](0x1f4,_0xe54cfa[_0x11c125('0xc')]));});});},exports[_0x103812('0x28')]=function(_0x189811){const _0x10c250=this;return new Promise(function(_0x35b358,_0x3359ce){const _0x28f70a=a139_0x5839;return db[_0x28f70a('0x2e')][_0x28f70a('0x10')]()['then'](function(){const _0x12e4a2=_0x28f70a;return db[_0x12e4a2('0x2d')][_0x12e4a2('0x9')](function(_0x1ce136){const _0x313dcf=_0x12e4a2;return db[_0x313dcf('0x2c')]['findAll']({'where':_0x189811['options']?_0x189811['options'][_0x313dcf('0x22')]||null:null,'attributes':_0x189811[_0x313dcf('0x34')]?_0x189811[_0x313dcf('0x34')]['attributes']||null:null,'limit':0x1,'order':_0x189811['options']?_0x189811['options'][_0x313dcf('0x30')]||null:null,'group':db[_0x313dcf('0x2c')]['UserId'],'transaction':_0x1ce136,'lock':_0x1ce136['LOCK'][_0x313dcf('0x27')],'include':_0x189811[_0x313dcf('0x34')]?_0x189811[_0x313dcf('0x34')][_0x313dcf('0x2f')]?_[_0x313dcf('0x1c')](_0x189811[_0x313dcf('0x34')]['include'],function(_0x64a844){const _0xcee3d9=_0x313dcf;return{'model':db[_0x64a844[_0xcee3d9('0x26')]],'as':_0x64a844['as'],'attributes':_0x64a844['attributes'],'include':_0x64a844[_0xcee3d9('0x2f')]?_[_0xcee3d9('0x1c')](_0x64a844['include'],function(_0x3d5cf6){const _0x3e40ab=_0xcee3d9;return{'model':db[_0x3d5cf6[_0x3e40ab('0x26')]],'as':_0x3d5cf6['as'],'attributes':_0x3d5cf6['attributes'],'include':_0x3d5cf6[_0x3e40ab('0x2f')]?_[_0x3e40ab('0x1c')](_0x3d5cf6['include'],function(_0x34e957){const _0x36e21b=_0x3e40ab;return{'model':db[_0x34e957['model']],'as':_0x34e957['as'],'attributes':_0x34e957[_0x36e21b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x313dcf('0x7')](function(_0x2a4d53){const _0x2ca4a2=_0x313dcf,_0x4f472c=[];for(let _0x465486=0x0;_0x465486<_0x2a4d53['length'];_0x465486+=0x1){_0x4f472c[_0x2ca4a2('0xe')](_0x2a4d53[_0x465486][_0x2ca4a2('0x23')](_0x189811[_0x2ca4a2('0x14')],{'transaction':_0x1ce136}));}return Promise[_0x2ca4a2('0x16')](_0x4f472c);});})['then'](function(_0x250659){const _0x387ceb=_0x12e4a2;logger[_0x387ceb('0x1d')]('GetContactRecallMe',_0x189811),logger[_0x387ceb('0x1b')](_0x387ceb('0x28'),_0x189811,JSON[_0x387ceb('0xb')](_0x250659)),_0x35b358(_0x250659);})[_0x12e4a2('0x33')](function(_0x5c9ca6){const _0x5acb0c=_0x12e4a2;logger[_0x5acb0c('0x3')](_0x5acb0c('0x28'),_0x5c9ca6['message'],_0x189811),_0x3359ce(_0x10c250['error'](0x1f4,_0x5c9ca6[_0x5acb0c('0xc')]));});});});},exports[_0x103812('0x37')]=function(_0x3d70cf){const _0x77f02=this;return new Promise(function(_0x228c00,_0x134be8){const _0x2bd962=a139_0x5839;db['CmContact'][_0x2bd962('0x10')]()[_0x2bd962('0x7')](function(_0x10a864){const _0x241baa=_0x2bd962;return db[_0x241baa('0x2c')][_0x241baa('0x2')]({'raw':_0x3d70cf['options']?_0x3d70cf[_0x241baa('0x34')][_0x241baa('0x15')]===undefined?!![]:![]:!![],'where':_0x3d70cf[_0x241baa('0x34')]?_0x3d70cf[_0x241baa('0x34')][_0x241baa('0x22')]||null:null,'attributes':_0x3d70cf['options']?_0x3d70cf[_0x241baa('0x34')]['attributes']||null:null,'limit':_0x3d70cf[_0x241baa('0x34')]?_0x3d70cf['options'][_0x241baa('0x35')]||null:null,'include':_0x3d70cf[_0x241baa('0x34')]?_0x3d70cf['options'][_0x241baa('0x2f')]?_['map'](_0x3d70cf['options'][_0x241baa('0x2f')],function(_0x2a0d25){const _0x40f2b8=_0x241baa;return{'model':db[_0x2a0d25['model']],'as':_0x2a0d25['as'],'attributes':_0x2a0d25['as']===_0x40f2b8('0x12')?_[_0x40f2b8('0x8')](_0x10a864):_0x2a0d25[_0x40f2b8('0x20')],'include':_0x2a0d25['include']?_[_0x40f2b8('0x1c')](_0x2a0d25[_0x40f2b8('0x2f')],function(_0x14bb85){const _0x4926ea=_0x40f2b8;return{'model':db[_0x14bb85['model']],'as':_0x14bb85['as'],'attributes':_0x14bb85[_0x4926ea('0x20')],'include':_0x14bb85[_0x4926ea('0x2f')]?_[_0x4926ea('0x1c')](_0x14bb85[_0x4926ea('0x2f')],function(_0x94f54){return{'model':db[_0x94f54['model']],'as':_0x94f54['as'],'attributes':_0x94f54['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c1f2a){const _0x42f40c=_0x241baa;logger[_0x42f40c('0x1d')](_0x42f40c('0x31'),_0x3d70cf),logger['debug']('GetCmHopper',_0x3d70cf,JSON[_0x42f40c('0xb')](_0x2c1f2a)),_0x228c00(_0x2c1f2a);})[_0x241baa('0x33')](function(_0x2ce33d){const _0xe05cd1=_0x241baa;logger[_0xe05cd1('0x3')]('GetCmHopper',_0x2ce33d[_0xe05cd1('0xc')],_0x3d70cf),_0x134be8(_0x77f02[_0xe05cd1('0x3')](0x1f4,_0x2ce33d['message']));});});});};
\ No newline at end of file