Built motion from commit 709aa6fb5ed03aa61bc373fcdbf622215d37d30b. Version 3.0.0...
[motion-next.git] / server / api / mailQueue / mailQueue.rpc.js
1 const a423_0x2540=['rpc','model','where','register','MailQueue','debug','../../rediscache','stringify','options','raw','include','findAll','findOne','lodash','GetMailQueue','ShowMailQueue','attributes','then','info','error','./mailQueue.socket','map','message'];(function(_0x4bbe7a,_0x25402e){const _0x569f3e=function(_0x4c0d82){while(--_0x4c0d82){_0x4bbe7a['push'](_0x4bbe7a['shift']());}};_0x569f3e(++_0x25402e);}(a423_0x2540,0x19b));const a423_0x569f=function(_0x4bbe7a,_0x25402e){_0x4bbe7a=_0x4bbe7a-0x0;let _0x569f3e=a423_0x2540[_0x4bbe7a];return _0x569f3e;};const _0x2306b6=a423_0x569f;'use strict';const _=require(_0x2306b6('0x10')),db=require('../../mysqldb')['db'],logger=require('../../config/logger')(_0x2306b6('0x3')),{getSocket}=require(_0x2306b6('0x9')),socket=getSocket();require(_0x2306b6('0x0'))[_0x2306b6('0x6')](socket),exports['GetMailQueue']=function(_0x4c0d82){const _0x169812=this;return new Promise(function(_0x3859e6,_0x50317){const _0x3546bd=a423_0x569f;return db['MailQueue'][_0x3546bd('0xe')]({'raw':_0x4c0d82[_0x3546bd('0xb')]?_0x4c0d82['options'][_0x3546bd('0xc')]===undefined?!![]:![]:!![],'where':_0x4c0d82[_0x3546bd('0xb')]?_0x4c0d82['options'][_0x3546bd('0x5')]||null:null,'attributes':_0x4c0d82[_0x3546bd('0xb')]?_0x4c0d82[_0x3546bd('0xb')][_0x3546bd('0x13')]||null:null,'limit':_0x4c0d82[_0x3546bd('0xb')]?_0x4c0d82[_0x3546bd('0xb')]['limit']||null:null,'include':_0x4c0d82[_0x3546bd('0xb')]?_0x4c0d82[_0x3546bd('0xb')][_0x3546bd('0xd')]?_[_0x3546bd('0x1')](_0x4c0d82[_0x3546bd('0xb')][_0x3546bd('0xd')],function(_0x17223d){const _0x1e80f7=_0x3546bd;return{'model':db[_0x17223d['model']],'as':_0x17223d['as'],'attributes':_0x17223d['attributes'],'include':_0x17223d['include']?_[_0x1e80f7('0x1')](_0x17223d[_0x1e80f7('0xd')],function(_0x230d1a){const _0x474b26=_0x1e80f7;return{'model':db[_0x230d1a['model']],'as':_0x230d1a['as'],'attributes':_0x230d1a['attributes'],'include':_0x230d1a[_0x474b26('0xd')]?_[_0x474b26('0x1')](_0x230d1a[_0x474b26('0xd')],function(_0x129b81){const _0x323fa4=_0x474b26;return{'model':db[_0x129b81[_0x323fa4('0x4')]],'as':_0x129b81['as'],'attributes':_0x129b81[_0x323fa4('0x13')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c116a){const _0x32fca3=_0x3546bd;logger['info']('GetMailQueue',_0x4c0d82),logger[_0x32fca3('0x8')](_0x32fca3('0x11'),_0x4c0d82,JSON[_0x32fca3('0xa')](_0x4c116a)),_0x3859e6(_0x4c116a);})['catch'](function(_0x58a951){const _0x125777=_0x3546bd;logger['error'](_0x125777('0x11'),_0x58a951['message'],_0x4c0d82),_0x50317(_0x169812[_0x125777('0x16')](0x1f4,_0x58a951[_0x125777('0x2')]));});});},exports['ShowMailQueue']=function(_0x4bd917){const _0xe6a473=this;return new Promise(function(_0x560b69,_0x10e7bc){const _0x30a919=a423_0x569f;return db[_0x30a919('0x7')][_0x30a919('0xf')]({'raw':_0x4bd917[_0x30a919('0xb')]?_0x4bd917[_0x30a919('0xb')]['raw']===undefined?!![]:![]:!![],'where':_0x4bd917[_0x30a919('0xb')]?_0x4bd917[_0x30a919('0xb')][_0x30a919('0x5')]||null:null,'attributes':_0x4bd917[_0x30a919('0xb')]?_0x4bd917[_0x30a919('0xb')]['attributes']||null:null,'include':_0x4bd917[_0x30a919('0xb')]?_0x4bd917[_0x30a919('0xb')][_0x30a919('0xd')]?_['map'](_0x4bd917['options'][_0x30a919('0xd')],function(_0x3ee890){const _0x42bf30=_0x30a919;return{'model':db[_0x3ee890[_0x42bf30('0x4')]],'as':_0x3ee890['as'],'attributes':_0x3ee890[_0x42bf30('0x13')],'include':_0x3ee890[_0x42bf30('0xd')]?_[_0x42bf30('0x1')](_0x3ee890[_0x42bf30('0xd')],function(_0x342211){const _0x50ebf0=_0x42bf30;return{'model':db[_0x342211[_0x50ebf0('0x4')]],'as':_0x342211['as'],'attributes':_0x342211['attributes'],'include':_0x342211[_0x50ebf0('0xd')]?_[_0x50ebf0('0x1')](_0x342211[_0x50ebf0('0xd')],function(_0x44da01){const _0x1cd13d=_0x50ebf0;return{'model':db[_0x44da01['model']],'as':_0x44da01['as'],'attributes':_0x44da01[_0x1cd13d('0x13')]};}):[]};}):[]};}):[]:[]})[_0x30a919('0x14')](function(_0x102e55){const _0x116ad1=_0x30a919;logger[_0x116ad1('0x15')]('ShowMailQueue',_0x4bd917),logger[_0x116ad1('0x8')](_0x116ad1('0x12'),_0x4bd917,JSON['stringify'](_0x102e55)),_0x560b69(_0x102e55);})['catch'](function(_0x2114d7){const _0x2af30b=_0x30a919;logger[_0x2af30b('0x16')]('ShowMailQueue',_0x2114d7[_0x2af30b('0x2')],_0x4bd917),_0x10e7bc(_0xe6a473['error'](0x1f4,_0x2114d7[_0x2af30b('0x2')]));});});};