Built motion from commit (unavailable).|2.5.26
[motion2.git] / server / api / cmHopper / cmHopper.rpc.js
index e55dc7d..9c74c25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9095=['error','message','info','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowCmHopper','find','CreateCmHopper','body','update','UpdateCmHopper','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','LOCK','UPDATE','Contact','User','name','voicePause','includes','UserId','push','MoveContactManagedDialer','destroy','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','length','keys','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xdab10,_0x173024){var _0x4644af=function(_0x20be8b){while(--_0x20be8b){_0xdab10['push'](_0xdab10['shift']());}};_0x4644af(++_0x173024);}(_0x9095,0x181));var _0x5909=function(_0x1344d6,_0x2181e6){_0x1344d6=_0x1344d6-0x0;var _0xf45b24=_0x9095[_0x1344d6];return _0xf45b24;};'use strict';var _=require(_0x5909('0x0'));var util=require(_0x5909('0x1'));var moment=require('moment');var BPromise=require(_0x5909('0x2'));var rs=require(_0x5909('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5909('0x4'))['db'];var utils=require(_0x5909('0x5'));var logger=require(_0x5909('0x6'))('rpc');var config=require(_0x5909('0x7'));var jayson=require(_0x5909('0x8'));var client=jayson[_0x5909('0x9')][_0x5909('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d6482,_0xa457f5,_0x12512c){return new BPromise(function(_0x5eedde,_0x480895){return client['request'](_0x1d6482,_0x12512c)[_0x5909('0xb')](function(_0x1143ce){logger['info'](_0x5909('0xc'),_0xa457f5,_0x5909('0xd'));logger[_0x5909('0xe')](_0x5909('0xf'),_0xa457f5,'request\x20sent',JSON[_0x5909('0x10')](_0x1143ce));if(_0x1143ce[_0x5909('0x11')]){if(_0x1143ce[_0x5909('0x11')]['code']===0x1f4){logger[_0x5909('0x11')](_0x5909('0xc'),_0xa457f5,_0x1143ce[_0x5909('0x11')]['message']);return _0x480895(_0x1143ce['error'][_0x5909('0x12')]);}logger['error'](_0x5909('0xc'),_0xa457f5,_0x1143ce['error'][_0x5909('0x12')]);return _0x5eedde(_0x1143ce['error'][_0x5909('0x12')]);}else{logger[_0x5909('0x13')](_0x5909('0xc'),_0xa457f5,'request\x20sent');_0x5eedde(_0x1143ce['result'][_0x5909('0x12')]);}})['catch'](function(_0x465f68){logger['error'](_0x5909('0xc'),_0xa457f5,_0x465f68);_0x480895(_0x465f68);});});}exports[_0x5909('0x14')]=function(_0x5f4b15){var _0x7b7fda=this;return new Promise(function(_0x4ca60c,_0x98268d){return db[_0x5909('0x15')][_0x5909('0x16')]({'raw':_0x5f4b15[_0x5909('0x17')]?_0x5f4b15[_0x5909('0x17')][_0x5909('0x18')]===undefined?!![]:![]:!![],'where':_0x5f4b15[_0x5909('0x17')]?_0x5f4b15[_0x5909('0x17')][_0x5909('0x19')]||null:null,'attributes':_0x5f4b15[_0x5909('0x17')]?_0x5f4b15[_0x5909('0x17')][_0x5909('0x1a')]||null:null,'limit':_0x5f4b15[_0x5909('0x17')]?_0x5f4b15[_0x5909('0x17')][_0x5909('0x1b')]||null:null,'include':_0x5f4b15[_0x5909('0x17')]?_0x5f4b15[_0x5909('0x17')][_0x5909('0x1c')]?_[_0x5909('0x1d')](_0x5f4b15[_0x5909('0x17')][_0x5909('0x1c')],function(_0x5a8b88){return{'model':db[_0x5a8b88[_0x5909('0x1e')]],'as':_0x5a8b88['as'],'attributes':_0x5a8b88[_0x5909('0x1a')],'include':_0x5a8b88[_0x5909('0x1c')]?_[_0x5909('0x1d')](_0x5a8b88[_0x5909('0x1c')],function(_0x58b189){return{'model':db[_0x58b189['model']],'as':_0x58b189['as'],'attributes':_0x58b189['attributes'],'include':_0x58b189[_0x5909('0x1c')]?_[_0x5909('0x1d')](_0x58b189[_0x5909('0x1c')],function(_0x11675d){return{'model':db[_0x11675d[_0x5909('0x1e')]],'as':_0x11675d['as'],'attributes':_0x11675d['attributes']};}):[]};}):[]};}):[]:[]})[_0x5909('0xb')](function(_0x391a31){logger['info']('GetCmHopper',_0x5f4b15);logger['debug']('GetCmHopper',_0x5f4b15,JSON['stringify'](_0x391a31));_0x4ca60c(_0x391a31);})[_0x5909('0x1f')](function(_0x5b5e9c){logger[_0x5909('0x11')](_0x5909('0x14'),_0x5b5e9c[_0x5909('0x12')],_0x5f4b15);_0x98268d(_0x7b7fda['error'](0x1f4,_0x5b5e9c[_0x5909('0x12')]));});});};exports[_0x5909('0x20')]=function(_0x2a9b8e){var _0x2883c5=this;return new Promise(function(_0x48fde9,_0x20b9b6){return db[_0x5909('0x15')][_0x5909('0x21')]({'raw':_0x2a9b8e['options']?_0x2a9b8e[_0x5909('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2a9b8e['options']?_0x2a9b8e[_0x5909('0x17')]['where']||null:null,'attributes':_0x2a9b8e[_0x5909('0x17')]?_0x2a9b8e[_0x5909('0x17')]['attributes']||null:null,'include':_0x2a9b8e['options']?_0x2a9b8e[_0x5909('0x17')]['include']?_[_0x5909('0x1d')](_0x2a9b8e[_0x5909('0x17')]['include'],function(_0x173746){return{'model':db[_0x173746[_0x5909('0x1e')]],'as':_0x173746['as'],'attributes':_0x173746[_0x5909('0x1a')],'include':_0x173746['include']?_[_0x5909('0x1d')](_0x173746[_0x5909('0x1c')],function(_0x271117){return{'model':db[_0x271117[_0x5909('0x1e')]],'as':_0x271117['as'],'attributes':_0x271117[_0x5909('0x1a')],'include':_0x271117[_0x5909('0x1c')]?_[_0x5909('0x1d')](_0x271117['include'],function(_0x86f0d7){return{'model':db[_0x86f0d7['model']],'as':_0x86f0d7['as'],'attributes':_0x86f0d7[_0x5909('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5909('0xb')](function(_0x31efb3){logger[_0x5909('0x13')](_0x5909('0x20'),_0x2a9b8e);logger[_0x5909('0xe')]('ShowCmHopper',_0x2a9b8e,JSON[_0x5909('0x10')](_0x31efb3));_0x48fde9(_0x31efb3);})[_0x5909('0x1f')](function(_0x4ee822){logger[_0x5909('0x11')]('ShowCmHopper',_0x4ee822[_0x5909('0x12')],_0x2a9b8e);_0x20b9b6(_0x2883c5[_0x5909('0x11')](0x1f4,_0x4ee822['message']));});});};exports[_0x5909('0x22')]=function(_0x511b36){var _0x2486a2=this;return new Promise(function(_0x34b7e0,_0x1c8c0d){return db[_0x5909('0x15')]['create'](_0x511b36[_0x5909('0x23')],{'raw':_0x511b36['options']?_0x511b36[_0x5909('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x5909('0xb')](function(_0x31edce){logger[_0x5909('0x13')](_0x5909('0x22'),_0x511b36);logger[_0x5909('0xe')](_0x5909('0x22'),_0x511b36,JSON[_0x5909('0x10')](_0x31edce));_0x34b7e0(_0x31edce);})[_0x5909('0x1f')](function(_0x2d751e){logger['error'](_0x5909('0x22'),_0x2d751e['message'],_0x511b36);_0x1c8c0d(_0x2486a2[_0x5909('0x11')](0x1f4,_0x2d751e[_0x5909('0x12')]));});});};exports['UpdateCmHopper']=function(_0x43afc1){var _0x3f7bc0=this;return new Promise(function(_0x2c5012,_0x4f0f05){return db[_0x5909('0x15')][_0x5909('0x24')](_0x43afc1['body'],{'raw':_0x43afc1[_0x5909('0x17')]?_0x43afc1[_0x5909('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43afc1[_0x5909('0x17')]?_0x43afc1[_0x5909('0x17')][_0x5909('0x19')]||null:null,'attributes':_0x43afc1['options']?_0x43afc1[_0x5909('0x17')][_0x5909('0x1a')]||null:null,'limit':_0x43afc1[_0x5909('0x17')]?_0x43afc1[_0x5909('0x17')]['limit']||null:null})[_0x5909('0xb')](function(_0x237a47){logger[_0x5909('0x13')](_0x5909('0x25'),_0x43afc1);logger['debug']('UpdateCmHopper',_0x43afc1,JSON[_0x5909('0x10')](_0x237a47));_0x2c5012(_0x237a47);})[_0x5909('0x1f')](function(_0x5b4760){logger[_0x5909('0x11')]('UpdateCmHopper',_0x5b4760[_0x5909('0x12')],_0x43afc1);_0x4f0f05(_0x3f7bc0[_0x5909('0x11')](0x1f4,_0x5b4760[_0x5909('0x12')]));});});};exports[_0x5909('0x26')]=function(_0x25ebff){var _0x327dd0=this;return new Promise(function(_0x5bc346,_0x594b81){return db[_0x5909('0x15')]['destroy']({'where':_0x25ebff[_0x5909('0x17')]?_0x25ebff[_0x5909('0x17')]['where']||null:null})['then'](function(_0x498cf1){logger[_0x5909('0x13')](_0x5909('0x26'),_0x25ebff);logger[_0x5909('0xe')]('DestroyCmHopper',_0x25ebff,JSON[_0x5909('0x10')](_0x498cf1));_0x5bc346(_0x498cf1);})[_0x5909('0x1f')](function(_0x3c2fae){logger['error'](_0x5909('0x26'),_0x3c2fae['message'],_0x25ebff);_0x594b81(_0x327dd0[_0x5909('0x11')](0x1f4,_0x3c2fae[_0x5909('0x12')]));});});};exports[_0x5909('0x27')]=function(_0x46906c){var _0x563c7e=this;return new Promise(function(_0x259c1d,_0x390fb3){return db[_0x5909('0x28')][_0x5909('0x29')]()[_0x5909('0xb')](function(_0x5d9d17){return db[_0x5909('0x2a')][_0x5909('0x2b')](function(_0x35a4d0){return db['CmHopper']['findAll']({'where':_0x46906c['options']?_0x46906c[_0x5909('0x17')][_0x5909('0x19')]||null:null,'attributes':_0x46906c['options']?_0x46906c[_0x5909('0x17')][_0x5909('0x1a')]||null:null,'limit':_0x46906c[_0x5909('0x17')]?_0x46906c['options'][_0x5909('0x1b')]||null:null,'order':_0x46906c[_0x5909('0x17')]?_0x46906c[_0x5909('0x17')]['order']||null:null,'transaction':_0x35a4d0,'lock':_0x35a4d0[_0x5909('0x2c')][_0x5909('0x2d')],'include':[{'model':db['CmContact'],'as':_0x5909('0x2e'),'attributes':_['keys'](_0x5d9d17)},{'model':db[_0x5909('0x2f')],'as':'Agent','attributes':['id',_0x5909('0x30'),_0x5909('0x31')]}]})[_0x5909('0xb')](function(_0x46c3e6){var _0x4c8585=[];var _0x2bc96b=[];for(var _0x1d6597=0x0;_0x1d6597<_0x46c3e6['length'];_0x1d6597+=0x1){if(!_0x2bc96b[_0x5909('0x32')](_0x46c3e6[_0x1d6597][_0x5909('0x33')])){_0x2bc96b[_0x5909('0x34')](_0x46c3e6[_0x1d6597]['UserId']);_0x4c8585['push'](_0x46c3e6[_0x1d6597][_0x5909('0x24')](_0x46906c[_0x5909('0x23')],{'transaction':_0x35a4d0}));}}return BPromise['all'](_0x4c8585);});})['then'](function(_0x4b666a){logger[_0x5909('0x13')](_0x5909('0x27'),_0x46906c);logger[_0x5909('0xe')]('GetContactDialer',_0x46906c,JSON[_0x5909('0x10')](_0x4b666a));_0x259c1d(_0x4b666a);})['catch'](function(_0x5906a7){logger['error']('GetContactDialer',_0x5906a7[_0x5909('0x12')],_0x46906c);_0x390fb3(_0x563c7e[_0x5909('0x11')](0x1f4,_0x5906a7['message']));});});});};exports[_0x5909('0x35')]=function(_0x189a6c){var _0x1c33f1=this;return new Promise(function(_0x51c899,_0x374736){return db[_0x5909('0x2a')]['transaction'](function(_0xbe88f4){return db['CmHopperFinal']['create'](_0x189a6c[_0x5909('0x23')],{'raw':_0x189a6c[_0x5909('0x17')]?_0x189a6c[_0x5909('0x17')][_0x5909('0x18')]===undefined?!![]:![]:!![],'transaction':_0xbe88f4})['then'](function(){return db['CmHopper'][_0x5909('0x36')]({'where':_0x189a6c[_0x5909('0x17')]?_0x189a6c[_0x5909('0x17')][_0x5909('0x19')]||null:null,'transaction':_0xbe88f4});});})[_0x5909('0xb')](function(_0x2ffc1c){logger['info'](_0x5909('0x35'),_0x189a6c);logger[_0x5909('0xe')](_0x5909('0x35'),_0x189a6c,JSON[_0x5909('0x10')](_0x2ffc1c));_0x51c899(_0x2ffc1c);})[_0x5909('0x1f')](function(_0x55108b){logger['error'](_0x5909('0x35'),_0x55108b[_0x5909('0x12')],_0x189a6c);_0x374736(_0x1c33f1[_0x5909('0x11')](0x1f4,_0x55108b[_0x5909('0x12')]));});});};exports[_0x5909('0x37')]=function(_0xe258df){var _0x35781b=this;return new Promise(function(_0x51ed5a,_0x2d5089){return db[_0x5909('0x15')][_0x5909('0x16')]({'raw':_0xe258df[_0x5909('0x17')]?_0xe258df[_0x5909('0x17')][_0x5909('0x18')]===undefined?!![]:![]:!![],'where':_0xe258df['options']?_0xe258df['options']['where']||null:null,'attributes':[[db[_0x5909('0x2a')]['fn'](_0x5909('0x38'),db[_0x5909('0x2a')]['fn']('IF',db[_0x5909('0x2a')][_0x5909('0x39')](_0x5909('0x3a')+util[_0x5909('0x3b')](_0x5909('0x3c'),moment()['format'](_0x5909('0x3d')))+_0x5909('0x3e')))),_0x5909('0x3f')]]})[_0x5909('0xb')](function(_0x1361ff){logger['info']('CountReScheduled',_0xe258df);logger[_0x5909('0xe')](_0x5909('0x37'),_0xe258df,JSON[_0x5909('0x10')](_0x1361ff));_0x51ed5a(_0x1361ff);})['catch'](function(_0x11c3bd){logger[_0x5909('0x11')](_0x5909('0x37'),_0x11c3bd['message'],_0xe258df);_0x2d5089(_0x35781b[_0x5909('0x11')](0x1f4,_0x11c3bd['message']));});});};exports[_0x5909('0x40')]=function(_0x1baaf7){var _0x2c569f=this;return new Promise(function(_0x1d8d94,_0x5f03d9){return db[_0x5909('0x28')]['describe']()[_0x5909('0xb')](function(_0x3708d1){return db[_0x5909('0x2a')]['transaction'](function(_0x370ec5){return db[_0x5909('0x15')][_0x5909('0x16')]({'where':_0x1baaf7[_0x5909('0x17')]?_0x1baaf7[_0x5909('0x17')][_0x5909('0x19')]||null:null,'attributes':_0x1baaf7[_0x5909('0x17')]?_0x1baaf7['options'][_0x5909('0x1a')]||null:null,'limit':0x1,'order':_0x1baaf7['options']?_0x1baaf7[_0x5909('0x17')]['order']||null:null,'group':db[_0x5909('0x15')][_0x5909('0x33')],'transaction':_0x370ec5,'lock':_0x370ec5[_0x5909('0x2c')][_0x5909('0x2d')],'include':_0x1baaf7[_0x5909('0x17')]?_0x1baaf7[_0x5909('0x17')][_0x5909('0x1c')]?_[_0x5909('0x1d')](_0x1baaf7['options'][_0x5909('0x1c')],function(_0xe84c63){return{'model':db[_0xe84c63['model']],'as':_0xe84c63['as'],'attributes':_0xe84c63[_0x5909('0x1a')],'include':_0xe84c63[_0x5909('0x1c')]?_[_0x5909('0x1d')](_0xe84c63[_0x5909('0x1c')],function(_0x334ec8){return{'model':db[_0x334ec8[_0x5909('0x1e')]],'as':_0x334ec8['as'],'attributes':_0x334ec8[_0x5909('0x1a')],'include':_0x334ec8['include']?_[_0x5909('0x1d')](_0x334ec8[_0x5909('0x1c')],function(_0x499ab7){return{'model':db[_0x499ab7[_0x5909('0x1e')]],'as':_0x499ab7['as'],'attributes':_0x499ab7['attributes']};}):[]};}):[]};}):[]:[]})[_0x5909('0xb')](function(_0x568f63){var _0x3e5419=[];for(var _0x51a879=0x0;_0x51a879<_0x568f63[_0x5909('0x41')];_0x51a879+=0x1){_0x3e5419[_0x5909('0x34')](_0x568f63[_0x51a879][_0x5909('0x24')](_0x1baaf7[_0x5909('0x23')],{'transaction':_0x370ec5}));}return BPromise['all'](_0x3e5419);});})[_0x5909('0xb')](function(_0x267f2e){logger['info'](_0x5909('0x40'),_0x1baaf7);logger[_0x5909('0xe')]('GetContactRecallMe',_0x1baaf7,JSON[_0x5909('0x10')](_0x267f2e));_0x1d8d94(_0x267f2e);})['catch'](function(_0x578aea){logger['error'](_0x5909('0x40'),_0x578aea[_0x5909('0x12')],_0x1baaf7);_0x5f03d9(_0x2c569f[_0x5909('0x11')](0x1f4,_0x578aea[_0x5909('0x12')]));});});});};exports['GetCmHopperPreview']=function(_0x11d276){var _0x47477a=this;return new Promise(function(_0x27a2f6,_0x567fdb){db[_0x5909('0x28')][_0x5909('0x29')]()['then'](function(_0x41e6fb){return db[_0x5909('0x15')]['findAll']({'raw':_0x11d276[_0x5909('0x17')]?_0x11d276[_0x5909('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x11d276[_0x5909('0x17')]?_0x11d276[_0x5909('0x17')][_0x5909('0x19')]||null:null,'attributes':_0x11d276['options']?_0x11d276['options']['attributes']||null:null,'limit':_0x11d276[_0x5909('0x17')]?_0x11d276[_0x5909('0x17')]['limit']||null:null,'include':_0x11d276['options']?_0x11d276[_0x5909('0x17')][_0x5909('0x1c')]?_[_0x5909('0x1d')](_0x11d276[_0x5909('0x17')][_0x5909('0x1c')],function(_0x31ad98){return{'model':db[_0x31ad98[_0x5909('0x1e')]],'as':_0x31ad98['as'],'attributes':_0x31ad98['as']==='Contact'?_[_0x5909('0x42')](_0x41e6fb):_0x31ad98[_0x5909('0x1a')],'include':_0x31ad98[_0x5909('0x1c')]?_[_0x5909('0x1d')](_0x31ad98[_0x5909('0x1c')],function(_0x3272ad){return{'model':db[_0x3272ad[_0x5909('0x1e')]],'as':_0x3272ad['as'],'attributes':_0x3272ad['attributes'],'include':_0x3272ad['include']?_[_0x5909('0x1d')](_0x3272ad[_0x5909('0x1c')],function(_0x4e6242){return{'model':db[_0x4e6242[_0x5909('0x1e')]],'as':_0x4e6242['as'],'attributes':_0x4e6242[_0x5909('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41922e){logger[_0x5909('0x13')](_0x5909('0x14'),_0x11d276);logger[_0x5909('0xe')](_0x5909('0x14'),_0x11d276,JSON[_0x5909('0x10')](_0x41922e));_0x27a2f6(_0x41922e);})['catch'](function(_0x1f7272){logger[_0x5909('0x11')](_0x5909('0x14'),_0x1f7272[_0x5909('0x12')],_0x11d276);_0x567fdb(_0x47477a[_0x5909('0x11')](0x1f4,_0x1f7272['message']));});});});};
\ No newline at end of file
+var _0xc9c9=['request','then','CmHopper,\x20%s,\x20%s','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmHopper','findAll','options','raw','where','attributes','map','include','model','stringify','CmHopper','info','ShowCmHopper','debug','CreateCmHopper','create','body','UpdateCmHopper','update','limit','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','transaction','order','keys','Agent','name','includes','push','all','MoveContactManagedDialer','sequelize','CmHopperFinal','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','UserId','LOCK','UPDATE','length','GetContactRecallMe','GetCmHopperPreview','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x4cfb78,_0x4c1da6){var _0xc1250e=function(_0x217b6c){while(--_0x217b6c){_0x4cfb78['push'](_0x4cfb78['shift']());}};_0xc1250e(++_0x4c1da6);}(_0xc9c9,0x19a));var _0x9c9c=function(_0x527acd,_0x32b758){_0x527acd=_0x527acd-0x0;var _0x2c990f=_0xc9c9[_0x527acd];return _0x2c990f;};'use strict';var _=require(_0x9c9c('0x0'));var util=require('util');var moment=require(_0x9c9c('0x1'));var BPromise=require('bluebird');var rs=require(_0x9c9c('0x2'));var fs=require('fs');var Redis=require(_0x9c9c('0x3'));var db=require(_0x9c9c('0x4'))['db'];var utils=require(_0x9c9c('0x5'));var logger=require('../../config/logger')(_0x9c9c('0x6'));var config=require(_0x9c9c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9c9c('0x8')][_0x9c9c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x554e08,_0x2f2eb9,_0x3c5deb){return new BPromise(function(_0x4ff617,_0x58aad3){return client[_0x9c9c('0xa')](_0x554e08,_0x3c5deb)[_0x9c9c('0xb')](function(_0x58feca){logger['info'](_0x9c9c('0xc'),_0x2f2eb9,_0x9c9c('0xd'));logger['debug'](_0x9c9c('0xe'),_0x2f2eb9,'request\x20sent',JSON['stringify'](_0x58feca));if(_0x58feca[_0x9c9c('0xf')]){if(_0x58feca['error'][_0x9c9c('0x10')]===0x1f4){logger[_0x9c9c('0xf')]('CmHopper,\x20%s,\x20%s',_0x2f2eb9,_0x58feca[_0x9c9c('0xf')][_0x9c9c('0x11')]);return _0x58aad3(_0x58feca[_0x9c9c('0xf')][_0x9c9c('0x11')]);}logger[_0x9c9c('0xf')](_0x9c9c('0xc'),_0x2f2eb9,_0x58feca['error']['message']);return _0x4ff617(_0x58feca[_0x9c9c('0xf')]['message']);}else{logger['info'](_0x9c9c('0xc'),_0x2f2eb9,'request\x20sent');_0x4ff617(_0x58feca[_0x9c9c('0x12')][_0x9c9c('0x11')]);}})[_0x9c9c('0x13')](function(_0x3a4024){logger[_0x9c9c('0xf')](_0x9c9c('0xc'),_0x2f2eb9,_0x3a4024);_0x58aad3(_0x3a4024);});});}exports[_0x9c9c('0x14')]=function(_0x48d389){var _0x55e525=this;return new Promise(function(_0x402dd7,_0xe14963){return db['CmHopper'][_0x9c9c('0x15')]({'raw':_0x48d389[_0x9c9c('0x16')]?_0x48d389['options'][_0x9c9c('0x17')]===undefined?!![]:![]:!![],'where':_0x48d389[_0x9c9c('0x16')]?_0x48d389[_0x9c9c('0x16')][_0x9c9c('0x18')]||null:null,'attributes':_0x48d389['options']?_0x48d389[_0x9c9c('0x16')][_0x9c9c('0x19')]||null:null,'limit':_0x48d389[_0x9c9c('0x16')]?_0x48d389[_0x9c9c('0x16')]['limit']||null:null,'include':_0x48d389['options']?_0x48d389[_0x9c9c('0x16')]['include']?_[_0x9c9c('0x1a')](_0x48d389[_0x9c9c('0x16')][_0x9c9c('0x1b')],function(_0x56c1d3){return{'model':db[_0x56c1d3[_0x9c9c('0x1c')]],'as':_0x56c1d3['as'],'attributes':_0x56c1d3[_0x9c9c('0x19')],'include':_0x56c1d3[_0x9c9c('0x1b')]?_[_0x9c9c('0x1a')](_0x56c1d3[_0x9c9c('0x1b')],function(_0x3b4ab0){return{'model':db[_0x3b4ab0['model']],'as':_0x3b4ab0['as'],'attributes':_0x3b4ab0[_0x9c9c('0x19')],'include':_0x3b4ab0['include']?_[_0x9c9c('0x1a')](_0x3b4ab0['include'],function(_0x4c981b){return{'model':db[_0x4c981b[_0x9c9c('0x1c')]],'as':_0x4c981b['as'],'attributes':_0x4c981b['attributes']};}):[]};}):[]};}):[]:[]})[_0x9c9c('0xb')](function(_0x1496a0){logger['info'](_0x9c9c('0x14'),_0x48d389);logger['debug'](_0x9c9c('0x14'),_0x48d389,JSON[_0x9c9c('0x1d')](_0x1496a0));_0x402dd7(_0x1496a0);})[_0x9c9c('0x13')](function(_0x5b4e18){logger['error'](_0x9c9c('0x14'),_0x5b4e18['message'],_0x48d389);_0xe14963(_0x55e525[_0x9c9c('0xf')](0x1f4,_0x5b4e18[_0x9c9c('0x11')]));});});};exports['ShowCmHopper']=function(_0x46001d){var _0x2c606e=this;return new Promise(function(_0x1dd80b,_0x23bf14){return db[_0x9c9c('0x1e')]['find']({'raw':_0x46001d[_0x9c9c('0x16')]?_0x46001d[_0x9c9c('0x16')][_0x9c9c('0x17')]===undefined?!![]:![]:!![],'where':_0x46001d['options']?_0x46001d[_0x9c9c('0x16')][_0x9c9c('0x18')]||null:null,'attributes':_0x46001d[_0x9c9c('0x16')]?_0x46001d[_0x9c9c('0x16')][_0x9c9c('0x19')]||null:null,'include':_0x46001d[_0x9c9c('0x16')]?_0x46001d['options'][_0x9c9c('0x1b')]?_[_0x9c9c('0x1a')](_0x46001d[_0x9c9c('0x16')][_0x9c9c('0x1b')],function(_0x4b10d3){return{'model':db[_0x4b10d3['model']],'as':_0x4b10d3['as'],'attributes':_0x4b10d3[_0x9c9c('0x19')],'include':_0x4b10d3[_0x9c9c('0x1b')]?_[_0x9c9c('0x1a')](_0x4b10d3[_0x9c9c('0x1b')],function(_0x444705){return{'model':db[_0x444705[_0x9c9c('0x1c')]],'as':_0x444705['as'],'attributes':_0x444705['attributes'],'include':_0x444705['include']?_[_0x9c9c('0x1a')](_0x444705['include'],function(_0x181deb){return{'model':db[_0x181deb[_0x9c9c('0x1c')]],'as':_0x181deb['as'],'attributes':_0x181deb[_0x9c9c('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x50174d){logger[_0x9c9c('0x1f')](_0x9c9c('0x20'),_0x46001d);logger[_0x9c9c('0x21')](_0x9c9c('0x20'),_0x46001d,JSON[_0x9c9c('0x1d')](_0x50174d));_0x1dd80b(_0x50174d);})[_0x9c9c('0x13')](function(_0x17f2ab){logger[_0x9c9c('0xf')](_0x9c9c('0x20'),_0x17f2ab['message'],_0x46001d);_0x23bf14(_0x2c606e[_0x9c9c('0xf')](0x1f4,_0x17f2ab[_0x9c9c('0x11')]));});});};exports[_0x9c9c('0x22')]=function(_0x3a483d){var _0xd1ba5c=this;return new Promise(function(_0x435aeb,_0x2b184a){return db[_0x9c9c('0x1e')][_0x9c9c('0x23')](_0x3a483d[_0x9c9c('0x24')],{'raw':_0x3a483d[_0x9c9c('0x16')]?_0x3a483d[_0x9c9c('0x16')][_0x9c9c('0x17')]===undefined?!![]:![]:!![]})[_0x9c9c('0xb')](function(_0x3d1a18){logger[_0x9c9c('0x1f')](_0x9c9c('0x22'),_0x3a483d);logger[_0x9c9c('0x21')](_0x9c9c('0x22'),_0x3a483d,JSON[_0x9c9c('0x1d')](_0x3d1a18));_0x435aeb(_0x3d1a18);})[_0x9c9c('0x13')](function(_0x192fbb){logger[_0x9c9c('0xf')](_0x9c9c('0x22'),_0x192fbb[_0x9c9c('0x11')],_0x3a483d);_0x2b184a(_0xd1ba5c['error'](0x1f4,_0x192fbb[_0x9c9c('0x11')]));});});};exports[_0x9c9c('0x25')]=function(_0x40003d){var _0x3d2ef6=this;return new Promise(function(_0x52b9ff,_0x3d4e1a){return db['CmHopper'][_0x9c9c('0x26')](_0x40003d['body'],{'raw':_0x40003d[_0x9c9c('0x16')]?_0x40003d[_0x9c9c('0x16')][_0x9c9c('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40003d['options']?_0x40003d[_0x9c9c('0x16')]['where']||null:null,'attributes':_0x40003d['options']?_0x40003d[_0x9c9c('0x16')][_0x9c9c('0x19')]||null:null,'limit':_0x40003d[_0x9c9c('0x16')]?_0x40003d[_0x9c9c('0x16')][_0x9c9c('0x27')]||null:null})[_0x9c9c('0xb')](function(_0x5b7cfc){logger[_0x9c9c('0x1f')]('UpdateCmHopper',_0x40003d);logger['debug'](_0x9c9c('0x25'),_0x40003d,JSON[_0x9c9c('0x1d')](_0x5b7cfc));_0x52b9ff(_0x5b7cfc);})[_0x9c9c('0x13')](function(_0x3c27d7){logger[_0x9c9c('0xf')](_0x9c9c('0x25'),_0x3c27d7['message'],_0x40003d);_0x3d4e1a(_0x3d2ef6[_0x9c9c('0xf')](0x1f4,_0x3c27d7['message']));});});};exports['DestroyCmHopper']=function(_0x134193){var _0xd4403f=this;return new Promise(function(_0x1686eb,_0x1cbf79){return db[_0x9c9c('0x1e')][_0x9c9c('0x28')]({'where':_0x134193['options']?_0x134193[_0x9c9c('0x16')]['where']||null:null})[_0x9c9c('0xb')](function(_0x5c9627){logger[_0x9c9c('0x1f')]('DestroyCmHopper',_0x134193);logger[_0x9c9c('0x21')]('DestroyCmHopper',_0x134193,JSON['stringify'](_0x5c9627));_0x1686eb(_0x5c9627);})['catch'](function(_0x3a3302){logger[_0x9c9c('0xf')](_0x9c9c('0x29'),_0x3a3302[_0x9c9c('0x11')],_0x134193);_0x1cbf79(_0xd4403f['error'](0x1f4,_0x3a3302[_0x9c9c('0x11')]));});});};exports[_0x9c9c('0x2a')]=function(_0x10068b){var _0x2b5396=this;return new Promise(function(_0x1b831d,_0x229a4c){return db[_0x9c9c('0x2b')][_0x9c9c('0x2c')]()[_0x9c9c('0xb')](function(_0x256c5a){return db['sequelize'][_0x9c9c('0x2d')](function(_0x58cf2e){return db[_0x9c9c('0x1e')][_0x9c9c('0x15')]({'where':_0x10068b[_0x9c9c('0x16')]?_0x10068b[_0x9c9c('0x16')][_0x9c9c('0x18')]||null:null,'attributes':_0x10068b[_0x9c9c('0x16')]?_0x10068b[_0x9c9c('0x16')]['attributes']||null:null,'limit':_0x10068b[_0x9c9c('0x16')]?_0x10068b[_0x9c9c('0x16')][_0x9c9c('0x27')]||null:null,'order':_0x10068b[_0x9c9c('0x16')]?_0x10068b[_0x9c9c('0x16')][_0x9c9c('0x2e')]||null:null,'transaction':_0x58cf2e,'lock':_0x58cf2e['LOCK']['UPDATE'],'include':[{'model':db[_0x9c9c('0x2b')],'as':'Contact','attributes':_[_0x9c9c('0x2f')](_0x256c5a)},{'model':db['User'],'as':_0x9c9c('0x30'),'attributes':['id',_0x9c9c('0x31'),'voicePause']}]})[_0x9c9c('0xb')](function(_0x5ac146){var _0x42cd7b=[];var _0x215723=[];for(var _0x4b7755=0x0;_0x4b7755<_0x5ac146['length'];_0x4b7755+=0x1){if(!_0x215723[_0x9c9c('0x32')](_0x5ac146[_0x4b7755]['UserId'])){_0x215723[_0x9c9c('0x33')](_0x5ac146[_0x4b7755]['UserId']);_0x42cd7b['push'](_0x5ac146[_0x4b7755]['update'](_0x10068b[_0x9c9c('0x24')],{'transaction':_0x58cf2e}));}}return BPromise[_0x9c9c('0x34')](_0x42cd7b);});})[_0x9c9c('0xb')](function(_0x53623a){logger[_0x9c9c('0x1f')](_0x9c9c('0x2a'),_0x10068b);logger[_0x9c9c('0x21')](_0x9c9c('0x2a'),_0x10068b,JSON['stringify'](_0x53623a));_0x1b831d(_0x53623a);})['catch'](function(_0x5c5259){logger[_0x9c9c('0xf')](_0x9c9c('0x2a'),_0x5c5259['message'],_0x10068b);_0x229a4c(_0x2b5396['error'](0x1f4,_0x5c5259[_0x9c9c('0x11')]));});});});};exports[_0x9c9c('0x35')]=function(_0x363de9){var _0x32273e=this;return new Promise(function(_0x4dc3b5,_0x52ba47){return db[_0x9c9c('0x36')][_0x9c9c('0x2d')](function(_0xbef5a0){return db[_0x9c9c('0x37')][_0x9c9c('0x23')](_0x363de9['body'],{'raw':_0x363de9[_0x9c9c('0x16')]?_0x363de9[_0x9c9c('0x16')][_0x9c9c('0x17')]===undefined?!![]:![]:!![],'transaction':_0xbef5a0})['then'](function(){return db[_0x9c9c('0x1e')][_0x9c9c('0x28')]({'where':_0x363de9[_0x9c9c('0x16')]?_0x363de9[_0x9c9c('0x16')][_0x9c9c('0x18')]||null:null,'transaction':_0xbef5a0});});})[_0x9c9c('0xb')](function(_0x187bc1){logger[_0x9c9c('0x1f')](_0x9c9c('0x35'),_0x363de9);logger[_0x9c9c('0x21')](_0x9c9c('0x35'),_0x363de9,JSON[_0x9c9c('0x1d')](_0x187bc1));_0x4dc3b5(_0x187bc1);})['catch'](function(_0x3074a6){logger[_0x9c9c('0xf')](_0x9c9c('0x35'),_0x3074a6['message'],_0x363de9);_0x52ba47(_0x32273e[_0x9c9c('0xf')](0x1f4,_0x3074a6['message']));});});};exports['CountReScheduled']=function(_0x2df1b8){var _0x386e30=this;return new Promise(function(_0x2fb3bb,_0x22321e){return db[_0x9c9c('0x1e')][_0x9c9c('0x15')]({'raw':_0x2df1b8[_0x9c9c('0x16')]?_0x2df1b8[_0x9c9c('0x16')][_0x9c9c('0x17')]===undefined?!![]:![]:!![],'where':_0x2df1b8['options']?_0x2df1b8['options'][_0x9c9c('0x18')]||null:null,'attributes':[[db[_0x9c9c('0x36')]['fn'](_0x9c9c('0x38'),db['sequelize']['fn']('IF',db[_0x9c9c('0x36')][_0x9c9c('0x39')](_0x9c9c('0x3a')+util['format'](_0x9c9c('0x3b'),moment()[_0x9c9c('0x3c')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x9c9c('0x3d')))),_0x9c9c('0x3e')]]})[_0x9c9c('0xb')](function(_0x2f82b3){logger[_0x9c9c('0x1f')](_0x9c9c('0x3f'),_0x2df1b8);logger[_0x9c9c('0x21')]('CountReScheduled',_0x2df1b8,JSON['stringify'](_0x2f82b3));_0x2fb3bb(_0x2f82b3);})['catch'](function(_0x414b3b){logger['error'](_0x9c9c('0x3f'),_0x414b3b[_0x9c9c('0x11')],_0x2df1b8);_0x22321e(_0x386e30['error'](0x1f4,_0x414b3b[_0x9c9c('0x11')]));});});};exports['GetContactRecallMe']=function(_0x11c8ae){var _0xaf8545=this;return new Promise(function(_0x4b4c44,_0x14bcf5){return db[_0x9c9c('0x2b')][_0x9c9c('0x2c')]()[_0x9c9c('0xb')](function(_0x2358f9){return db[_0x9c9c('0x36')][_0x9c9c('0x2d')](function(_0x35ab91){return db[_0x9c9c('0x1e')][_0x9c9c('0x15')]({'where':_0x11c8ae[_0x9c9c('0x16')]?_0x11c8ae[_0x9c9c('0x16')]['where']||null:null,'attributes':_0x11c8ae[_0x9c9c('0x16')]?_0x11c8ae[_0x9c9c('0x16')][_0x9c9c('0x19')]||null:null,'limit':0x1,'order':_0x11c8ae[_0x9c9c('0x16')]?_0x11c8ae[_0x9c9c('0x16')][_0x9c9c('0x2e')]||null:null,'group':db['CmHopper'][_0x9c9c('0x40')],'transaction':_0x35ab91,'lock':_0x35ab91[_0x9c9c('0x41')][_0x9c9c('0x42')],'include':_0x11c8ae[_0x9c9c('0x16')]?_0x11c8ae[_0x9c9c('0x16')][_0x9c9c('0x1b')]?_['map'](_0x11c8ae['options'][_0x9c9c('0x1b')],function(_0x375056){return{'model':db[_0x375056[_0x9c9c('0x1c')]],'as':_0x375056['as'],'attributes':_0x375056[_0x9c9c('0x19')],'include':_0x375056[_0x9c9c('0x1b')]?_[_0x9c9c('0x1a')](_0x375056[_0x9c9c('0x1b')],function(_0x323810){return{'model':db[_0x323810[_0x9c9c('0x1c')]],'as':_0x323810['as'],'attributes':_0x323810[_0x9c9c('0x19')],'include':_0x323810[_0x9c9c('0x1b')]?_[_0x9c9c('0x1a')](_0x323810[_0x9c9c('0x1b')],function(_0x59b190){return{'model':db[_0x59b190[_0x9c9c('0x1c')]],'as':_0x59b190['as'],'attributes':_0x59b190[_0x9c9c('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9c9c('0xb')](function(_0x441d4c){var _0x107f4b=[];for(var _0x1af1ef=0x0;_0x1af1ef<_0x441d4c[_0x9c9c('0x43')];_0x1af1ef+=0x1){_0x107f4b[_0x9c9c('0x33')](_0x441d4c[_0x1af1ef][_0x9c9c('0x26')](_0x11c8ae[_0x9c9c('0x24')],{'transaction':_0x35ab91}));}return BPromise[_0x9c9c('0x34')](_0x107f4b);});})['then'](function(_0x22675f){logger[_0x9c9c('0x1f')](_0x9c9c('0x44'),_0x11c8ae);logger[_0x9c9c('0x21')]('GetContactRecallMe',_0x11c8ae,JSON['stringify'](_0x22675f));_0x4b4c44(_0x22675f);})[_0x9c9c('0x13')](function(_0x2bc79a){logger['error']('GetContactRecallMe',_0x2bc79a[_0x9c9c('0x11')],_0x11c8ae);_0x14bcf5(_0xaf8545[_0x9c9c('0xf')](0x1f4,_0x2bc79a[_0x9c9c('0x11')]));});});});};exports[_0x9c9c('0x45')]=function(_0x2ea966){var _0x41975b=this;return new Promise(function(_0x24192a,_0x2f99ce){db[_0x9c9c('0x2b')]['describe']()[_0x9c9c('0xb')](function(_0xaca1bf){return db[_0x9c9c('0x1e')][_0x9c9c('0x15')]({'raw':_0x2ea966[_0x9c9c('0x16')]?_0x2ea966[_0x9c9c('0x16')][_0x9c9c('0x17')]===undefined?!![]:![]:!![],'where':_0x2ea966[_0x9c9c('0x16')]?_0x2ea966[_0x9c9c('0x16')][_0x9c9c('0x18')]||null:null,'attributes':_0x2ea966['options']?_0x2ea966[_0x9c9c('0x16')]['attributes']||null:null,'limit':_0x2ea966['options']?_0x2ea966[_0x9c9c('0x16')][_0x9c9c('0x27')]||null:null,'include':_0x2ea966['options']?_0x2ea966[_0x9c9c('0x16')][_0x9c9c('0x1b')]?_[_0x9c9c('0x1a')](_0x2ea966[_0x9c9c('0x16')][_0x9c9c('0x1b')],function(_0x25f321){return{'model':db[_0x25f321[_0x9c9c('0x1c')]],'as':_0x25f321['as'],'attributes':_0x25f321['as']==='Contact'?_[_0x9c9c('0x2f')](_0xaca1bf):_0x25f321[_0x9c9c('0x19')],'include':_0x25f321[_0x9c9c('0x1b')]?_[_0x9c9c('0x1a')](_0x25f321[_0x9c9c('0x1b')],function(_0x38731a){return{'model':db[_0x38731a[_0x9c9c('0x1c')]],'as':_0x38731a['as'],'attributes':_0x38731a[_0x9c9c('0x19')],'include':_0x38731a[_0x9c9c('0x1b')]?_[_0x9c9c('0x1a')](_0x38731a[_0x9c9c('0x1b')],function(_0x152005){return{'model':db[_0x152005[_0x9c9c('0x1c')]],'as':_0x152005['as'],'attributes':_0x152005[_0x9c9c('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16a5c2){logger[_0x9c9c('0x1f')](_0x9c9c('0x14'),_0x2ea966);logger[_0x9c9c('0x21')](_0x9c9c('0x14'),_0x2ea966,JSON['stringify'](_0x16a5c2));_0x24192a(_0x16a5c2);})[_0x9c9c('0x13')](function(_0x323b05){logger[_0x9c9c('0xf')](_0x9c9c('0x14'),_0x323b05['message'],_0x2ea966);_0x2f99ce(_0x41975b[_0x9c9c('0xf')](0x1f4,_0x323b05[_0x9c9c('0x11')]));});});});};
\ No newline at end of file