Built motion from commit (unavailable).|2.4.13
[motion2.git] / server / api / cmHopper / cmHopper.rpc.js
index 6bc0e61..15a2e31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbf2=['then','ShowCmHopper','raw','CreateCmHopper','body','UpdateCmHopper','update','limit','DestroyCmHopper','destroy','describe','sequelize','transaction','order','LOCK','CmContact','Contact','keys','length','push','all','GetContactDialer','CmHopperFinal','create','CountReScheduled','COUNT','literal','format','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','UPDATE','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','findAll','options','where','attributes','include','map','model'];(function(_0x115a0f,_0x46c0ae){var _0x2b53a0=function(_0x5ad110){while(--_0x5ad110){_0x115a0f['push'](_0x115a0f['shift']());}};_0x2b53a0(++_0x46c0ae);}(_0xcbf2,0x119));var _0x2cbf=function(_0x5b2db5,_0x32190e){_0x5b2db5=_0x5b2db5-0x0;var _0x39c5f1=_0xcbf2[_0x5b2db5];return _0x39c5f1;};'use strict';var _=require(_0x2cbf('0x0'));var util=require(_0x2cbf('0x1'));var moment=require(_0x2cbf('0x2'));var BPromise=require(_0x2cbf('0x3'));var rs=require(_0x2cbf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2cbf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2cbf('0x6'))(_0x2cbf('0x7'));var config=require(_0x2cbf('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3065d0,_0x2bb4b7,_0x2e18f9){return new BPromise(function(_0x5104b9,_0x4a3ac4){return client['request'](_0x3065d0,_0x2e18f9)['then'](function(_0x23b643){logger[_0x2cbf('0x9')](_0x2cbf('0xa'),_0x2bb4b7,_0x2cbf('0xb'));logger[_0x2cbf('0xc')](_0x2cbf('0xd'),_0x2bb4b7,_0x2cbf('0xb'),JSON[_0x2cbf('0xe')](_0x23b643));if(_0x23b643[_0x2cbf('0xf')]){if(_0x23b643['error'][_0x2cbf('0x10')]===0x1f4){logger[_0x2cbf('0xf')]('CmHopper,\x20%s,\x20%s',_0x2bb4b7,_0x23b643['error']['message']);return _0x4a3ac4(_0x23b643[_0x2cbf('0xf')][_0x2cbf('0x11')]);}logger[_0x2cbf('0xf')](_0x2cbf('0xa'),_0x2bb4b7,_0x23b643[_0x2cbf('0xf')][_0x2cbf('0x11')]);return _0x5104b9(_0x23b643[_0x2cbf('0xf')][_0x2cbf('0x11')]);}else{logger[_0x2cbf('0x9')](_0x2cbf('0xa'),_0x2bb4b7,_0x2cbf('0xb'));_0x5104b9(_0x23b643[_0x2cbf('0x12')]['message']);}})[_0x2cbf('0x13')](function(_0x21f531){logger[_0x2cbf('0xf')](_0x2cbf('0xa'),_0x2bb4b7,_0x21f531);_0x4a3ac4(_0x21f531);});});}exports[_0x2cbf('0x14')]=function(_0x533536){var _0x4f9727=this;return new Promise(function(_0x1d34e9,_0x142e00){return db[_0x2cbf('0x15')][_0x2cbf('0x16')]({'raw':_0x533536['options']?_0x533536['options']['raw']===undefined?!![]:![]:!![],'where':_0x533536[_0x2cbf('0x17')]?_0x533536['options'][_0x2cbf('0x18')]||null:null,'attributes':_0x533536[_0x2cbf('0x17')]?_0x533536[_0x2cbf('0x17')][_0x2cbf('0x19')]||null:null,'limit':_0x533536['options']?_0x533536[_0x2cbf('0x17')]['limit']||null:null,'include':_0x533536['options']?_0x533536['options'][_0x2cbf('0x1a')]?_[_0x2cbf('0x1b')](_0x533536['options'][_0x2cbf('0x1a')],function(_0x4317ef){return{'model':db[_0x4317ef[_0x2cbf('0x1c')]],'as':_0x4317ef['as'],'attributes':_0x4317ef[_0x2cbf('0x19')],'include':_0x4317ef[_0x2cbf('0x1a')]?_[_0x2cbf('0x1b')](_0x4317ef[_0x2cbf('0x1a')],function(_0x32bd4f){return{'model':db[_0x32bd4f[_0x2cbf('0x1c')]],'as':_0x32bd4f['as'],'attributes':_0x32bd4f[_0x2cbf('0x19')],'include':_0x32bd4f[_0x2cbf('0x1a')]?_[_0x2cbf('0x1b')](_0x32bd4f['include'],function(_0x5bcd49){return{'model':db[_0x5bcd49[_0x2cbf('0x1c')]],'as':_0x5bcd49['as'],'attributes':_0x5bcd49[_0x2cbf('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2cbf('0x1d')](function(_0x1dfdfb){logger[_0x2cbf('0x9')](_0x2cbf('0x14'),_0x533536);logger[_0x2cbf('0xc')](_0x2cbf('0x14'),_0x533536,JSON[_0x2cbf('0xe')](_0x1dfdfb));_0x1d34e9(_0x1dfdfb);})[_0x2cbf('0x13')](function(_0x2111e7){logger['error'](_0x2cbf('0x14'),_0x2111e7['message'],_0x533536);_0x142e00(_0x4f9727[_0x2cbf('0xf')](0x1f4,_0x2111e7[_0x2cbf('0x11')]));});});};exports[_0x2cbf('0x1e')]=function(_0x52b611){var _0x227a63=this;return new Promise(function(_0x1b2188,_0x794459){return db[_0x2cbf('0x15')]['find']({'raw':_0x52b611['options']?_0x52b611[_0x2cbf('0x17')][_0x2cbf('0x1f')]===undefined?!![]:![]:!![],'where':_0x52b611['options']?_0x52b611[_0x2cbf('0x17')][_0x2cbf('0x18')]||null:null,'attributes':_0x52b611[_0x2cbf('0x17')]?_0x52b611[_0x2cbf('0x17')][_0x2cbf('0x19')]||null:null,'include':_0x52b611[_0x2cbf('0x17')]?_0x52b611[_0x2cbf('0x17')][_0x2cbf('0x1a')]?_['map'](_0x52b611['options'][_0x2cbf('0x1a')],function(_0x28b004){return{'model':db[_0x28b004[_0x2cbf('0x1c')]],'as':_0x28b004['as'],'attributes':_0x28b004['attributes'],'include':_0x28b004[_0x2cbf('0x1a')]?_[_0x2cbf('0x1b')](_0x28b004['include'],function(_0x18c386){return{'model':db[_0x18c386['model']],'as':_0x18c386['as'],'attributes':_0x18c386[_0x2cbf('0x19')],'include':_0x18c386['include']?_[_0x2cbf('0x1b')](_0x18c386['include'],function(_0x300ce0){return{'model':db[_0x300ce0[_0x2cbf('0x1c')]],'as':_0x300ce0['as'],'attributes':_0x300ce0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x707e82){logger[_0x2cbf('0x9')](_0x2cbf('0x1e'),_0x52b611);logger[_0x2cbf('0xc')](_0x2cbf('0x1e'),_0x52b611,JSON[_0x2cbf('0xe')](_0x707e82));_0x1b2188(_0x707e82);})[_0x2cbf('0x13')](function(_0x3a130d){logger[_0x2cbf('0xf')](_0x2cbf('0x1e'),_0x3a130d[_0x2cbf('0x11')],_0x52b611);_0x794459(_0x227a63[_0x2cbf('0xf')](0x1f4,_0x3a130d[_0x2cbf('0x11')]));});});};exports[_0x2cbf('0x20')]=function(_0x1e40d2){var _0x27b5bb=this;return new Promise(function(_0x263152,_0x325377){return db['CmHopper']['create'](_0x1e40d2[_0x2cbf('0x21')],{'raw':_0x1e40d2[_0x2cbf('0x17')]?_0x1e40d2[_0x2cbf('0x17')][_0x2cbf('0x1f')]===undefined?!![]:![]:!![]})[_0x2cbf('0x1d')](function(_0x212efc){logger[_0x2cbf('0x9')](_0x2cbf('0x20'),_0x1e40d2);logger[_0x2cbf('0xc')](_0x2cbf('0x20'),_0x1e40d2,JSON[_0x2cbf('0xe')](_0x212efc));_0x263152(_0x212efc);})[_0x2cbf('0x13')](function(_0x40c239){logger['error']('CreateCmHopper',_0x40c239[_0x2cbf('0x11')],_0x1e40d2);_0x325377(_0x27b5bb[_0x2cbf('0xf')](0x1f4,_0x40c239['message']));});});};exports[_0x2cbf('0x22')]=function(_0x19658f){var _0x4712cb=this;return new Promise(function(_0x47695c,_0x128715){return db['CmHopper'][_0x2cbf('0x23')](_0x19658f['body'],{'raw':_0x19658f[_0x2cbf('0x17')]?_0x19658f[_0x2cbf('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19658f[_0x2cbf('0x17')]?_0x19658f['options'][_0x2cbf('0x18')]||null:null,'attributes':_0x19658f['options']?_0x19658f['options'][_0x2cbf('0x19')]||null:null,'limit':_0x19658f[_0x2cbf('0x17')]?_0x19658f[_0x2cbf('0x17')][_0x2cbf('0x24')]||null:null})[_0x2cbf('0x1d')](function(_0x3de85d){logger[_0x2cbf('0x9')](_0x2cbf('0x22'),_0x19658f);logger[_0x2cbf('0xc')](_0x2cbf('0x22'),_0x19658f,JSON[_0x2cbf('0xe')](_0x3de85d));_0x47695c(_0x3de85d);})['catch'](function(_0x3b0698){logger[_0x2cbf('0xf')](_0x2cbf('0x22'),_0x3b0698[_0x2cbf('0x11')],_0x19658f);_0x128715(_0x4712cb[_0x2cbf('0xf')](0x1f4,_0x3b0698['message']));});});};exports[_0x2cbf('0x25')]=function(_0x264959){var _0x216af4=this;return new Promise(function(_0x233e78,_0x1399cf){return db[_0x2cbf('0x15')][_0x2cbf('0x26')]({'where':_0x264959[_0x2cbf('0x17')]?_0x264959[_0x2cbf('0x17')][_0x2cbf('0x18')]||null:null})['then'](function(_0x337292){logger['info'](_0x2cbf('0x25'),_0x264959);logger['debug'](_0x2cbf('0x25'),_0x264959,JSON[_0x2cbf('0xe')](_0x337292));_0x233e78(_0x337292);})[_0x2cbf('0x13')](function(_0x79f1e9){logger['error'](_0x2cbf('0x25'),_0x79f1e9['message'],_0x264959);_0x1399cf(_0x216af4[_0x2cbf('0xf')](0x1f4,_0x79f1e9['message']));});});};exports['GetContactDialer']=function(_0x37a546){var _0x427a13=this;return new Promise(function(_0x57964,_0x52657b){return db['CmContact'][_0x2cbf('0x27')]()[_0x2cbf('0x1d')](function(_0x2f6b4d){return db[_0x2cbf('0x28')][_0x2cbf('0x29')](function(_0x510ecd){return db[_0x2cbf('0x15')][_0x2cbf('0x16')]({'where':_0x37a546['options']?_0x37a546[_0x2cbf('0x17')][_0x2cbf('0x18')]||null:null,'attributes':_0x37a546[_0x2cbf('0x17')]?_0x37a546[_0x2cbf('0x17')]['attributes']||null:null,'limit':_0x37a546[_0x2cbf('0x17')]?_0x37a546[_0x2cbf('0x17')][_0x2cbf('0x24')]||null:null,'order':_0x37a546[_0x2cbf('0x17')]?_0x37a546[_0x2cbf('0x17')][_0x2cbf('0x2a')]||null:null,'transaction':_0x510ecd,'lock':_0x510ecd[_0x2cbf('0x2b')]['UPDATE'],'include':[{'model':db[_0x2cbf('0x2c')],'as':_0x2cbf('0x2d'),'attributes':_[_0x2cbf('0x2e')](_0x2f6b4d)}]})[_0x2cbf('0x1d')](function(_0x26edf5){var _0x57bdcb=[];for(var _0xc426b2=0x0;_0xc426b2<_0x26edf5[_0x2cbf('0x2f')];_0xc426b2+=0x1){_0x57bdcb[_0x2cbf('0x30')](_0x26edf5[_0xc426b2]['update'](_0x37a546[_0x2cbf('0x21')],{'transaction':_0x510ecd}));}return BPromise[_0x2cbf('0x31')](_0x57bdcb);});})[_0x2cbf('0x1d')](function(_0xc18e24){logger[_0x2cbf('0x9')](_0x2cbf('0x32'),_0x37a546);logger['debug'](_0x2cbf('0x32'),_0x37a546,JSON[_0x2cbf('0xe')](_0xc18e24));_0x57964(_0xc18e24);})[_0x2cbf('0x13')](function(_0x41f0b0){logger['error'](_0x2cbf('0x32'),_0x41f0b0[_0x2cbf('0x11')],_0x37a546);_0x52657b(_0x427a13[_0x2cbf('0xf')](0x1f4,_0x41f0b0[_0x2cbf('0x11')]));});});});};exports['MoveContactManagedDialer']=function(_0x4a0fcd){var _0xede22d=this;return new Promise(function(_0x47b170,_0x2fdfbe){return db[_0x2cbf('0x28')][_0x2cbf('0x29')](function(_0x155a8b){return db[_0x2cbf('0x33')][_0x2cbf('0x34')](_0x4a0fcd[_0x2cbf('0x21')],{'raw':_0x4a0fcd[_0x2cbf('0x17')]?_0x4a0fcd[_0x2cbf('0x17')][_0x2cbf('0x1f')]===undefined?!![]:![]:!![],'transaction':_0x155a8b})[_0x2cbf('0x1d')](function(){return db[_0x2cbf('0x15')][_0x2cbf('0x26')]({'where':_0x4a0fcd[_0x2cbf('0x17')]?_0x4a0fcd[_0x2cbf('0x17')]['where']||null:null,'transaction':_0x155a8b});});})['then'](function(_0xc091fb){logger[_0x2cbf('0x9')]('MoveContactManagedDialer',_0x4a0fcd);logger[_0x2cbf('0xc')]('MoveContactManagedDialer',_0x4a0fcd,JSON[_0x2cbf('0xe')](_0xc091fb));_0x47b170(_0xc091fb);})[_0x2cbf('0x13')](function(_0x872a96){logger[_0x2cbf('0xf')]('MoveContactManagedDialer',_0x872a96['message'],_0x4a0fcd);_0x2fdfbe(_0xede22d['error'](0x1f4,_0x872a96[_0x2cbf('0x11')]));});});};exports[_0x2cbf('0x35')]=function(_0x3155b4){var _0x5a41e6=this;return new Promise(function(_0x286758,_0x2e9698){return db[_0x2cbf('0x15')][_0x2cbf('0x16')]({'raw':_0x3155b4[_0x2cbf('0x17')]?_0x3155b4[_0x2cbf('0x17')][_0x2cbf('0x1f')]===undefined?!![]:![]:!![],'where':_0x3155b4[_0x2cbf('0x17')]?_0x3155b4['options'][_0x2cbf('0x18')]||null:null,'attributes':[[db[_0x2cbf('0x28')]['fn'](_0x2cbf('0x36'),db['sequelize']['fn']('IF',db['sequelize'][_0x2cbf('0x37')]('`scheduledat`\x20>=\x20'+util[_0x2cbf('0x38')]('\x22%s\x22',moment()[_0x2cbf('0x38')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x2cbf('0x39')))),_0x2cbf('0x3a')]]})[_0x2cbf('0x1d')](function(_0x4cfb2a){logger[_0x2cbf('0x9')]('CountReScheduled',_0x3155b4);logger[_0x2cbf('0xc')](_0x2cbf('0x35'),_0x3155b4,JSON['stringify'](_0x4cfb2a));_0x286758(_0x4cfb2a);})[_0x2cbf('0x13')](function(_0xa5a02d){logger[_0x2cbf('0xf')](_0x2cbf('0x35'),_0xa5a02d[_0x2cbf('0x11')],_0x3155b4);_0x2e9698(_0x5a41e6[_0x2cbf('0xf')](0x1f4,_0xa5a02d[_0x2cbf('0x11')]));});});};exports[_0x2cbf('0x3b')]=function(_0xc832a1){var _0xe19504=this;return new Promise(function(_0x17db1f,_0x5c62fa){return db[_0x2cbf('0x2c')][_0x2cbf('0x27')]()[_0x2cbf('0x1d')](function(_0x2a176e){return db[_0x2cbf('0x28')][_0x2cbf('0x29')](function(_0x57b234){return db[_0x2cbf('0x15')][_0x2cbf('0x16')]({'where':_0xc832a1[_0x2cbf('0x17')]?_0xc832a1[_0x2cbf('0x17')]['where']||null:null,'attributes':_0xc832a1['options']?_0xc832a1[_0x2cbf('0x17')][_0x2cbf('0x19')]||null:null,'limit':0x1,'order':_0xc832a1[_0x2cbf('0x17')]?_0xc832a1[_0x2cbf('0x17')][_0x2cbf('0x2a')]||null:null,'group':db[_0x2cbf('0x15')][_0x2cbf('0x3c')],'transaction':_0x57b234,'lock':_0x57b234['LOCK'][_0x2cbf('0x3d')],'include':_0xc832a1[_0x2cbf('0x17')]?_0xc832a1['options'][_0x2cbf('0x1a')]?_[_0x2cbf('0x1b')](_0xc832a1['options'][_0x2cbf('0x1a')],function(_0x1ee1fc){return{'model':db[_0x1ee1fc['model']],'as':_0x1ee1fc['as'],'attributes':_0x1ee1fc['attributes'],'include':_0x1ee1fc[_0x2cbf('0x1a')]?_[_0x2cbf('0x1b')](_0x1ee1fc[_0x2cbf('0x1a')],function(_0x170ed8){return{'model':db[_0x170ed8['model']],'as':_0x170ed8['as'],'attributes':_0x170ed8['attributes'],'include':_0x170ed8[_0x2cbf('0x1a')]?_['map'](_0x170ed8['include'],function(_0xefa8da){return{'model':db[_0xefa8da[_0x2cbf('0x1c')]],'as':_0xefa8da['as'],'attributes':_0xefa8da[_0x2cbf('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x225438){var _0x492cc8=[];for(var _0x4d7d7b=0x0;_0x4d7d7b<_0x225438[_0x2cbf('0x2f')];_0x4d7d7b+=0x1){_0x492cc8[_0x2cbf('0x30')](_0x225438[_0x4d7d7b][_0x2cbf('0x23')](_0xc832a1[_0x2cbf('0x21')],{'transaction':_0x57b234}));}return BPromise[_0x2cbf('0x31')](_0x492cc8);});})[_0x2cbf('0x1d')](function(_0x486e95){logger[_0x2cbf('0x9')]('GetContactRecallMe',_0xc832a1);logger[_0x2cbf('0xc')]('GetContactRecallMe',_0xc832a1,JSON['stringify'](_0x486e95));_0x17db1f(_0x486e95);})[_0x2cbf('0x13')](function(_0x729694){logger[_0x2cbf('0xf')](_0x2cbf('0x3b'),_0x729694[_0x2cbf('0x11')],_0xc832a1);_0x5c62fa(_0xe19504[_0x2cbf('0xf')](0x1f4,_0x729694[_0x2cbf('0x11')]));});});});};
\ No newline at end of file
+var _0xd66e=['include','map','model','ShowCmHopper','CmHopper','find','then','create','CreateCmHopper','UpdateCmHopper','update','body','DestroyCmHopper','destroy','GetContactDialer','transaction','limit','order','LOCK','UPDATE','CmContact','Contact','keys','length','push','all','MoveContactManagedDialer','sequelize','CmHopperFinal','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','describe','UserId','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','info','CmHopper,\x20%s,\x20%s','debug','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetCmHopper','findAll','options','raw','where','attributes'];(function(_0x28b691,_0x16aad0){var _0x34ef70=function(_0x248ea9){while(--_0x248ea9){_0x28b691['push'](_0x28b691['shift']());}};_0x34ef70(++_0x16aad0);}(_0xd66e,0x6c));var _0xed66=function(_0x2cbfe5,_0x1fb99b){_0x2cbfe5=_0x2cbfe5-0x0;var _0x3f69ad=_0xd66e[_0x2cbfe5];return _0x3f69ad;};'use strict';var _=require(_0xed66('0x0'));var util=require('util');var moment=require(_0xed66('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed66('0x2'));var db=require(_0xed66('0x3'))['db'];var utils=require(_0xed66('0x4'));var logger=require('../../config/logger')(_0xed66('0x5'));var config=require(_0xed66('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xed66('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1364a2,_0x27e712,_0x12a8fd){return new BPromise(function(_0x338786,_0x130fd3){return client[_0xed66('0x8')](_0x1364a2,_0x12a8fd)['then'](function(_0x28e842){logger[_0xed66('0x9')](_0xed66('0xa'),_0x27e712,'request\x20sent');logger[_0xed66('0xb')](_0xed66('0xc'),_0x27e712,_0xed66('0xd'),JSON[_0xed66('0xe')](_0x28e842));if(_0x28e842[_0xed66('0xf')]){if(_0x28e842[_0xed66('0xf')][_0xed66('0x10')]===0x1f4){logger[_0xed66('0xf')](_0xed66('0xa'),_0x27e712,_0x28e842[_0xed66('0xf')][_0xed66('0x11')]);return _0x130fd3(_0x28e842[_0xed66('0xf')][_0xed66('0x11')]);}logger[_0xed66('0xf')](_0xed66('0xa'),_0x27e712,_0x28e842[_0xed66('0xf')]['message']);return _0x338786(_0x28e842[_0xed66('0xf')][_0xed66('0x11')]);}else{logger[_0xed66('0x9')](_0xed66('0xa'),_0x27e712,'request\x20sent');_0x338786(_0x28e842[_0xed66('0x12')][_0xed66('0x11')]);}})[_0xed66('0x13')](function(_0x5a987c){logger[_0xed66('0xf')](_0xed66('0xa'),_0x27e712,_0x5a987c);_0x130fd3(_0x5a987c);});});}exports[_0xed66('0x14')]=function(_0x483bd7){var _0x4c437c=this;return new Promise(function(_0x575327,_0x36d717){return db['CmHopper'][_0xed66('0x15')]({'raw':_0x483bd7[_0xed66('0x16')]?_0x483bd7[_0xed66('0x16')][_0xed66('0x17')]===undefined?!![]:![]:!![],'where':_0x483bd7[_0xed66('0x16')]?_0x483bd7[_0xed66('0x16')][_0xed66('0x18')]||null:null,'attributes':_0x483bd7['options']?_0x483bd7[_0xed66('0x16')][_0xed66('0x19')]||null:null,'limit':_0x483bd7[_0xed66('0x16')]?_0x483bd7[_0xed66('0x16')]['limit']||null:null,'include':_0x483bd7[_0xed66('0x16')]?_0x483bd7[_0xed66('0x16')][_0xed66('0x1a')]?_[_0xed66('0x1b')](_0x483bd7['options'][_0xed66('0x1a')],function(_0x57ac58){return{'model':db[_0x57ac58[_0xed66('0x1c')]],'as':_0x57ac58['as'],'attributes':_0x57ac58[_0xed66('0x19')],'include':_0x57ac58[_0xed66('0x1a')]?_[_0xed66('0x1b')](_0x57ac58['include'],function(_0x188934){return{'model':db[_0x188934[_0xed66('0x1c')]],'as':_0x188934['as'],'attributes':_0x188934['attributes'],'include':_0x188934['include']?_[_0xed66('0x1b')](_0x188934[_0xed66('0x1a')],function(_0x4af87c){return{'model':db[_0x4af87c['model']],'as':_0x4af87c['as'],'attributes':_0x4af87c[_0xed66('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x300271){logger[_0xed66('0x9')]('GetCmHopper',_0x483bd7);logger[_0xed66('0xb')]('GetCmHopper',_0x483bd7,JSON[_0xed66('0xe')](_0x300271));_0x575327(_0x300271);})[_0xed66('0x13')](function(_0x278bf7){logger[_0xed66('0xf')]('GetCmHopper',_0x278bf7[_0xed66('0x11')],_0x483bd7);_0x36d717(_0x4c437c[_0xed66('0xf')](0x1f4,_0x278bf7[_0xed66('0x11')]));});});};exports[_0xed66('0x1d')]=function(_0x4ae5de){var _0x3f0716=this;return new Promise(function(_0x344fc9,_0x3dc144){return db[_0xed66('0x1e')][_0xed66('0x1f')]({'raw':_0x4ae5de['options']?_0x4ae5de[_0xed66('0x16')][_0xed66('0x17')]===undefined?!![]:![]:!![],'where':_0x4ae5de[_0xed66('0x16')]?_0x4ae5de['options'][_0xed66('0x18')]||null:null,'attributes':_0x4ae5de[_0xed66('0x16')]?_0x4ae5de[_0xed66('0x16')]['attributes']||null:null,'include':_0x4ae5de['options']?_0x4ae5de[_0xed66('0x16')][_0xed66('0x1a')]?_[_0xed66('0x1b')](_0x4ae5de[_0xed66('0x16')][_0xed66('0x1a')],function(_0x3de5f2){return{'model':db[_0x3de5f2['model']],'as':_0x3de5f2['as'],'attributes':_0x3de5f2['attributes'],'include':_0x3de5f2['include']?_[_0xed66('0x1b')](_0x3de5f2[_0xed66('0x1a')],function(_0x5d9f76){return{'model':db[_0x5d9f76[_0xed66('0x1c')]],'as':_0x5d9f76['as'],'attributes':_0x5d9f76[_0xed66('0x19')],'include':_0x5d9f76['include']?_[_0xed66('0x1b')](_0x5d9f76[_0xed66('0x1a')],function(_0x2be0dd){return{'model':db[_0x2be0dd['model']],'as':_0x2be0dd['as'],'attributes':_0x2be0dd[_0xed66('0x19')]};}):[]};}):[]};}):[]:[]})[_0xed66('0x20')](function(_0x4b952b){logger[_0xed66('0x9')](_0xed66('0x1d'),_0x4ae5de);logger[_0xed66('0xb')](_0xed66('0x1d'),_0x4ae5de,JSON['stringify'](_0x4b952b));_0x344fc9(_0x4b952b);})['catch'](function(_0x213c13){logger[_0xed66('0xf')](_0xed66('0x1d'),_0x213c13[_0xed66('0x11')],_0x4ae5de);_0x3dc144(_0x3f0716[_0xed66('0xf')](0x1f4,_0x213c13[_0xed66('0x11')]));});});};exports['CreateCmHopper']=function(_0x448f6a){var _0x18a2f1=this;return new Promise(function(_0x207ea7,_0x1ff57c){return db['CmHopper'][_0xed66('0x21')](_0x448f6a['body'],{'raw':_0x448f6a[_0xed66('0x16')]?_0x448f6a[_0xed66('0x16')][_0xed66('0x17')]===undefined?!![]:![]:!![]})[_0xed66('0x20')](function(_0x355218){logger[_0xed66('0x9')](_0xed66('0x22'),_0x448f6a);logger[_0xed66('0xb')](_0xed66('0x22'),_0x448f6a,JSON['stringify'](_0x355218));_0x207ea7(_0x355218);})[_0xed66('0x13')](function(_0x28a9e8){logger[_0xed66('0xf')](_0xed66('0x22'),_0x28a9e8[_0xed66('0x11')],_0x448f6a);_0x1ff57c(_0x18a2f1[_0xed66('0xf')](0x1f4,_0x28a9e8[_0xed66('0x11')]));});});};exports[_0xed66('0x23')]=function(_0x4ad8a6){var _0x1faf67=this;return new Promise(function(_0xe3fa68,_0x571254){return db['CmHopper'][_0xed66('0x24')](_0x4ad8a6[_0xed66('0x25')],{'raw':_0x4ad8a6['options']?_0x4ad8a6[_0xed66('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ad8a6[_0xed66('0x16')]?_0x4ad8a6['options'][_0xed66('0x18')]||null:null,'attributes':_0x4ad8a6[_0xed66('0x16')]?_0x4ad8a6[_0xed66('0x16')]['attributes']||null:null,'limit':_0x4ad8a6[_0xed66('0x16')]?_0x4ad8a6[_0xed66('0x16')]['limit']||null:null})[_0xed66('0x20')](function(_0x4f8e0f){logger[_0xed66('0x9')](_0xed66('0x23'),_0x4ad8a6);logger['debug'](_0xed66('0x23'),_0x4ad8a6,JSON[_0xed66('0xe')](_0x4f8e0f));_0xe3fa68(_0x4f8e0f);})[_0xed66('0x13')](function(_0x478348){logger[_0xed66('0xf')](_0xed66('0x23'),_0x478348[_0xed66('0x11')],_0x4ad8a6);_0x571254(_0x1faf67[_0xed66('0xf')](0x1f4,_0x478348[_0xed66('0x11')]));});});};exports[_0xed66('0x26')]=function(_0x2a3762){var _0xa3f264=this;return new Promise(function(_0x146b0e,_0x406304){return db[_0xed66('0x1e')][_0xed66('0x27')]({'where':_0x2a3762[_0xed66('0x16')]?_0x2a3762[_0xed66('0x16')][_0xed66('0x18')]||null:null})[_0xed66('0x20')](function(_0x3f81da){logger['info']('DestroyCmHopper',_0x2a3762);logger[_0xed66('0xb')](_0xed66('0x26'),_0x2a3762,JSON[_0xed66('0xe')](_0x3f81da));_0x146b0e(_0x3f81da);})['catch'](function(_0xfdba51){logger[_0xed66('0xf')](_0xed66('0x26'),_0xfdba51['message'],_0x2a3762);_0x406304(_0xa3f264[_0xed66('0xf')](0x1f4,_0xfdba51[_0xed66('0x11')]));});});};exports[_0xed66('0x28')]=function(_0x487749){var _0x41d1fd=this;return new Promise(function(_0x43cf93,_0x2e07fd){return db['CmContact']['describe']()[_0xed66('0x20')](function(_0xa30b5f){return db['sequelize'][_0xed66('0x29')](function(_0x19c37e){return db[_0xed66('0x1e')]['findAll']({'where':_0x487749[_0xed66('0x16')]?_0x487749[_0xed66('0x16')][_0xed66('0x18')]||null:null,'attributes':_0x487749[_0xed66('0x16')]?_0x487749[_0xed66('0x16')][_0xed66('0x19')]||null:null,'limit':_0x487749[_0xed66('0x16')]?_0x487749[_0xed66('0x16')][_0xed66('0x2a')]||null:null,'order':_0x487749['options']?_0x487749[_0xed66('0x16')][_0xed66('0x2b')]||null:null,'transaction':_0x19c37e,'lock':_0x19c37e[_0xed66('0x2c')][_0xed66('0x2d')],'include':[{'model':db[_0xed66('0x2e')],'as':_0xed66('0x2f'),'attributes':_[_0xed66('0x30')](_0xa30b5f)}]})[_0xed66('0x20')](function(_0x2141fa){var _0x2451c0=[];for(var _0x48f335=0x0;_0x48f335<_0x2141fa[_0xed66('0x31')];_0x48f335+=0x1){_0x2451c0[_0xed66('0x32')](_0x2141fa[_0x48f335][_0xed66('0x24')](_0x487749[_0xed66('0x25')],{'transaction':_0x19c37e}));}return BPromise[_0xed66('0x33')](_0x2451c0);});})[_0xed66('0x20')](function(_0x1845f5){logger[_0xed66('0x9')]('GetContactDialer',_0x487749);logger[_0xed66('0xb')]('GetContactDialer',_0x487749,JSON[_0xed66('0xe')](_0x1845f5));_0x43cf93(_0x1845f5);})[_0xed66('0x13')](function(_0x43d07c){logger[_0xed66('0xf')](_0xed66('0x28'),_0x43d07c['message'],_0x487749);_0x2e07fd(_0x41d1fd[_0xed66('0xf')](0x1f4,_0x43d07c[_0xed66('0x11')]));});});});};exports[_0xed66('0x34')]=function(_0x1bd57e){var _0x49677c=this;return new Promise(function(_0x12b33f,_0x5ba4db){return db[_0xed66('0x35')]['transaction'](function(_0x43b008){return db[_0xed66('0x36')]['create'](_0x1bd57e[_0xed66('0x25')],{'raw':_0x1bd57e[_0xed66('0x16')]?_0x1bd57e[_0xed66('0x16')][_0xed66('0x17')]===undefined?!![]:![]:!![],'transaction':_0x43b008})[_0xed66('0x20')](function(){return db['CmHopper'][_0xed66('0x27')]({'where':_0x1bd57e[_0xed66('0x16')]?_0x1bd57e[_0xed66('0x16')][_0xed66('0x18')]||null:null,'transaction':_0x43b008});});})['then'](function(_0x434dd1){logger[_0xed66('0x9')](_0xed66('0x34'),_0x1bd57e);logger[_0xed66('0xb')](_0xed66('0x34'),_0x1bd57e,JSON['stringify'](_0x434dd1));_0x12b33f(_0x434dd1);})[_0xed66('0x13')](function(_0x51a974){logger[_0xed66('0xf')](_0xed66('0x34'),_0x51a974['message'],_0x1bd57e);_0x5ba4db(_0x49677c[_0xed66('0xf')](0x1f4,_0x51a974['message']));});});};exports[_0xed66('0x37')]=function(_0x4951d1){var _0x29b977=this;return new Promise(function(_0x4b8c7c,_0xc3bca5){return db[_0xed66('0x1e')][_0xed66('0x15')]({'raw':_0x4951d1[_0xed66('0x16')]?_0x4951d1[_0xed66('0x16')][_0xed66('0x17')]===undefined?!![]:![]:!![],'where':_0x4951d1['options']?_0x4951d1[_0xed66('0x16')][_0xed66('0x18')]||null:null,'attributes':[[db[_0xed66('0x35')]['fn'](_0xed66('0x38'),db[_0xed66('0x35')]['fn']('IF',db['sequelize'][_0xed66('0x39')](_0xed66('0x3a')+util[_0xed66('0x3b')](_0xed66('0x3c'),moment()[_0xed66('0x3b')](_0xed66('0x3d')))+_0xed66('0x3e')))),_0xed66('0x3f')]]})['then'](function(_0xaf209){logger['info']('CountReScheduled',_0x4951d1);logger[_0xed66('0xb')](_0xed66('0x37'),_0x4951d1,JSON['stringify'](_0xaf209));_0x4b8c7c(_0xaf209);})[_0xed66('0x13')](function(_0x16de2e){logger[_0xed66('0xf')]('CountReScheduled',_0x16de2e[_0xed66('0x11')],_0x4951d1);_0xc3bca5(_0x29b977[_0xed66('0xf')](0x1f4,_0x16de2e['message']));});});};exports[_0xed66('0x40')]=function(_0x57df1c){var _0x2fbe5f=this;return new Promise(function(_0x3c5327,_0x15041c){return db[_0xed66('0x2e')][_0xed66('0x41')]()[_0xed66('0x20')](function(_0x2893ad){return db[_0xed66('0x35')][_0xed66('0x29')](function(_0x4dea69){return db[_0xed66('0x1e')]['findAll']({'where':_0x57df1c[_0xed66('0x16')]?_0x57df1c[_0xed66('0x16')]['where']||null:null,'attributes':_0x57df1c[_0xed66('0x16')]?_0x57df1c[_0xed66('0x16')][_0xed66('0x19')]||null:null,'limit':0x1,'order':_0x57df1c[_0xed66('0x16')]?_0x57df1c['options'][_0xed66('0x2b')]||null:null,'group':db[_0xed66('0x1e')][_0xed66('0x42')],'transaction':_0x4dea69,'lock':_0x4dea69[_0xed66('0x2c')][_0xed66('0x2d')],'include':_0x57df1c['options']?_0x57df1c[_0xed66('0x16')][_0xed66('0x1a')]?_[_0xed66('0x1b')](_0x57df1c[_0xed66('0x16')][_0xed66('0x1a')],function(_0x42ba98){return{'model':db[_0x42ba98[_0xed66('0x1c')]],'as':_0x42ba98['as'],'attributes':_0x42ba98[_0xed66('0x19')],'include':_0x42ba98['include']?_['map'](_0x42ba98[_0xed66('0x1a')],function(_0x14d8b2){return{'model':db[_0x14d8b2[_0xed66('0x1c')]],'as':_0x14d8b2['as'],'attributes':_0x14d8b2[_0xed66('0x19')],'include':_0x14d8b2[_0xed66('0x1a')]?_[_0xed66('0x1b')](_0x14d8b2[_0xed66('0x1a')],function(_0x315e51){return{'model':db[_0x315e51['model']],'as':_0x315e51['as'],'attributes':_0x315e51[_0xed66('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x112c47){var _0x4a65b4=[];for(var _0x3068ee=0x0;_0x3068ee<_0x112c47[_0xed66('0x31')];_0x3068ee+=0x1){_0x4a65b4[_0xed66('0x32')](_0x112c47[_0x3068ee][_0xed66('0x24')](_0x57df1c[_0xed66('0x25')],{'transaction':_0x4dea69}));}return BPromise[_0xed66('0x33')](_0x4a65b4);});})[_0xed66('0x20')](function(_0x2843a8){logger[_0xed66('0x9')](_0xed66('0x40'),_0x57df1c);logger[_0xed66('0xb')](_0xed66('0x40'),_0x57df1c,JSON[_0xed66('0xe')](_0x2843a8));_0x3c5327(_0x2843a8);})['catch'](function(_0x30108d){logger[_0xed66('0xf')](_0xed66('0x40'),_0x30108d[_0xed66('0x11')],_0x57df1c);_0x15041c(_0x2fbe5f['error'](0x1f4,_0x30108d[_0xed66('0x11')]));});});});};
\ No newline at end of file