beee07196e9a3981922dfae7231a20db1d9a19ad
[motion-next.git] / server / api / whatsappQueue / whatsappQueue.rpc.js
1 const a811_0x36c6=['attributes','catch','limit','model','../../rediscache','then','map','stringify','include','WhatsappQueue','options','info','findOne','GetWhatsappQueue','findAll','lodash','register','ShowWhatsappQueue','raw','error','message','rpc','where','debug'];(function(_0x260ec3,_0x36c641){const _0x2de7e6=function(_0x41868f){while(--_0x41868f){_0x260ec3['push'](_0x260ec3['shift']());}};_0x2de7e6(++_0x36c641);}(a811_0x36c6,0x1ad));const a811_0x2de7=function(_0x260ec3,_0x36c641){_0x260ec3=_0x260ec3-0x0;let _0x2de7e6=a811_0x36c6[_0x260ec3];return _0x2de7e6;};const _0x55ab64=a811_0x2de7;'use strict';const _=require(_0x55ab64('0x12')),db=require('../../mysqldb')['db'],logger=require('../../config/logger')(_0x55ab64('0x0')),{getSocket}=require(_0x55ab64('0x7')),socket=getSocket();require('./whatsappQueue.socket')[_0x55ab64('0x13')](socket),exports[_0x55ab64('0x10')]=function(_0x41868f){const _0x41f01f=this;return new Promise(function(_0x2c39df,_0x2b2ca9){const _0x2c8225=a811_0x2de7;return db[_0x2c8225('0xc')][_0x2c8225('0x11')]({'raw':_0x41868f[_0x2c8225('0xd')]?_0x41868f[_0x2c8225('0xd')]['raw']===undefined?!![]:![]:!![],'where':_0x41868f['options']?_0x41868f['options']['where']||null:null,'attributes':_0x41868f['options']?_0x41868f[_0x2c8225('0xd')][_0x2c8225('0x3')]||null:null,'limit':_0x41868f['options']?_0x41868f[_0x2c8225('0xd')][_0x2c8225('0x5')]||null:null,'include':_0x41868f['options']?_0x41868f[_0x2c8225('0xd')][_0x2c8225('0xb')]?_[_0x2c8225('0x9')](_0x41868f[_0x2c8225('0xd')][_0x2c8225('0xb')],function(_0x17db3b){const _0x27c31b=_0x2c8225;return{'model':db[_0x17db3b[_0x27c31b('0x6')]],'as':_0x17db3b['as'],'attributes':_0x17db3b[_0x27c31b('0x3')],'include':_0x17db3b[_0x27c31b('0xb')]?_[_0x27c31b('0x9')](_0x17db3b['include'],function(_0x1657da){const _0x4cc61f=_0x27c31b;return{'model':db[_0x1657da[_0x4cc61f('0x6')]],'as':_0x1657da['as'],'attributes':_0x1657da['attributes'],'include':_0x1657da[_0x4cc61f('0xb')]?_[_0x4cc61f('0x9')](_0x1657da['include'],function(_0x1d5b64){const _0x26c76c=_0x4cc61f;return{'model':db[_0x1d5b64[_0x26c76c('0x6')]],'as':_0x1d5b64['as'],'attributes':_0x1d5b64[_0x26c76c('0x3')]};}):[]};}):[]};}):[]:[]})[_0x2c8225('0x8')](function(_0x2989c2){const _0x43ffae=_0x2c8225;logger[_0x43ffae('0xe')](_0x43ffae('0x10'),_0x41868f),logger['debug'](_0x43ffae('0x10'),_0x41868f,JSON['stringify'](_0x2989c2)),_0x2c39df(_0x2989c2);})[_0x2c8225('0x4')](function(_0x2af6d7){const _0x4fe52b=_0x2c8225;logger['error'](_0x4fe52b('0x10'),_0x2af6d7[_0x4fe52b('0x17')],_0x41868f),_0x2b2ca9(_0x41f01f[_0x4fe52b('0x16')](0x1f4,_0x2af6d7[_0x4fe52b('0x17')]));});});},exports['ShowWhatsappQueue']=function(_0x15b039){const _0x302822=this;return new Promise(function(_0x74321f,_0x17421e){const _0x1a36d1=a811_0x2de7;return db[_0x1a36d1('0xc')][_0x1a36d1('0xf')]({'raw':_0x15b039[_0x1a36d1('0xd')]?_0x15b039['options'][_0x1a36d1('0x15')]===undefined?!![]:![]:!![],'where':_0x15b039[_0x1a36d1('0xd')]?_0x15b039[_0x1a36d1('0xd')][_0x1a36d1('0x1')]||null:null,'attributes':_0x15b039[_0x1a36d1('0xd')]?_0x15b039['options'][_0x1a36d1('0x3')]||null:null,'include':_0x15b039[_0x1a36d1('0xd')]?_0x15b039[_0x1a36d1('0xd')][_0x1a36d1('0xb')]?_[_0x1a36d1('0x9')](_0x15b039[_0x1a36d1('0xd')][_0x1a36d1('0xb')],function(_0x466c11){const _0x2a24ee=_0x1a36d1;return{'model':db[_0x466c11[_0x2a24ee('0x6')]],'as':_0x466c11['as'],'attributes':_0x466c11[_0x2a24ee('0x3')],'include':_0x466c11[_0x2a24ee('0xb')]?_[_0x2a24ee('0x9')](_0x466c11[_0x2a24ee('0xb')],function(_0x3b5b93){const _0x428b36=_0x2a24ee;return{'model':db[_0x3b5b93[_0x428b36('0x6')]],'as':_0x3b5b93['as'],'attributes':_0x3b5b93[_0x428b36('0x3')],'include':_0x3b5b93[_0x428b36('0xb')]?_['map'](_0x3b5b93[_0x428b36('0xb')],function(_0x5f39b7){const _0xcd9209=_0x428b36;return{'model':db[_0x5f39b7[_0xcd9209('0x6')]],'as':_0x5f39b7['as'],'attributes':_0x5f39b7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x180e17){const _0xe6e7f4=_0x1a36d1;logger[_0xe6e7f4('0xe')]('ShowWhatsappQueue',_0x15b039),logger[_0xe6e7f4('0x2')](_0xe6e7f4('0x14'),_0x15b039,JSON[_0xe6e7f4('0xa')](_0x180e17)),_0x74321f(_0x180e17);})[_0x1a36d1('0x4')](function(_0x4d3cdb){const _0xf36175=_0x1a36d1;logger['error'](_0xf36175('0x14'),_0x4d3cdb[_0xf36175('0x17')],_0x15b039),_0x17421e(_0x302822['error'](0x1f4,_0x4d3cdb[_0xf36175('0x17')]));});});};