Built motion from commit df3e9871f6bcc3432fec345b2f4facbd4dba8b5c. Version 3.0.0...
[motion-next.git] / server / api / mailQueueReport / mailQueueReport.controller.js
index bdbf49c..a494025 100644 (file)
@@ -1 +1 @@
-const a427_0x4d68=['index','key','params','merge','length','findOne','error','describe','then','pick','create','findAll','name','query','VIRTUAL','type','MailQueueReport','count','like','order','map','include','attributes','stack','includeAll','../../mysqldb','where','api','Content-Range','show','body','end','limit','keys','../../components/parsers/qs','fieldName','set','status','offset','lodash','update','intersection','filter','fields','json','catch','destroy','rawAttributes','model'];(function(_0x24fd62,_0x4d685f){const _0x504e81=function(_0xf28827){while(--_0xf28827){_0x24fd62['push'](_0x24fd62['shift']());}};_0x504e81(++_0x4d685f);}(a427_0x4d68,0x78));const a427_0x504e=function(_0x24fd62,_0x4d685f){_0x24fd62=_0x24fd62-0x0;let _0x504e81=a427_0x4d68[_0x24fd62];return _0x504e81;};const _0x2c7440=a427_0x504e;'use strict';const _=require(_0x2c7440('0x11')),qs=require(_0x2c7440('0xc')),logger=require('../../config/logger')(_0x2c7440('0x5')),db=require(_0x2c7440('0x3'))['db'],{Op}=require('sequelize');function respondWithResult(_0xf28827,_0x29e6de){return _0x29e6de=_0x29e6de||0xc8,function(_0x40d0d2){const _0x130b0e=a427_0x504e;if(_0x40d0d2)return _0xf28827['status'](_0x29e6de)[_0x130b0e('0x16')](_0x40d0d2);};}function respondWithFilteredResult(_0x5cb029,_0x1cf53e){return function(_0x39717a){const _0x57dbe0=a427_0x504e;if(_0x39717a){const _0x2ac4a3=_0x39717a[_0x57dbe0('0x2c')],_0x14d944=_0x1cf53e[_0x57dbe0('0x10')];let _0x1024f4=_0x1cf53e['offset']+_0x1cf53e[_0x57dbe0('0xa')],_0x2cd9c1;return _0x1024f4>=_0x2ac4a3?(_0x1024f4=_0x2ac4a3,_0x2cd9c1=0xc8):_0x2cd9c1=0xce,_0x5cb029[_0x57dbe0('0xf')](_0x2cd9c1),_0x5cb029[_0x57dbe0('0xe')](_0x57dbe0('0x6'),_0x14d944+'-'+_0x1024f4+'/'+_0x2ac4a3)['json'](_0x39717a);}return null;};}function saveUpdates(_0x1dd794){return function(_0x189bf7){const _0x589c48=a427_0x504e;if(_0x189bf7)return _0x189bf7[_0x589c48('0x12')](_0x1dd794)['then'](function(_0x4d13a4){return _0x4d13a4;});return null;};}function removeEntity(_0x3e6b7f){return function(_0x595ee9){if(_0x595ee9)return _0x595ee9['destroy']()['then'](function(){const _0x5175cd=a427_0x504e;_0x3e6b7f[_0x5175cd('0xf')](0xcc)[_0x5175cd('0x9')]();});};}function handleEntityNotFound(_0xbab376){return function(_0x38ffae){return!_0x38ffae&&_0xbab376['sendStatus'](0x194),_0x38ffae;};}function handleError(_0x4bf92a,_0x1cb178){return _0x1cb178=_0x1cb178||0x1f4,function(_0x17ed5d){const _0x13efa3=a427_0x504e;logger[_0x13efa3('0x21')](_0x17ed5d[_0x13efa3('0x1')]),_0x17ed5d[_0x13efa3('0x27')]&&delete _0x17ed5d[_0x13efa3('0x27')],_0x4bf92a[_0x13efa3('0xf')](_0x1cb178)['send'](_0x17ed5d);};}exports[_0x2c7440('0x1b')]=function(_0x1eedac,_0x5f0a4e){const _0x4e4cc0=_0x2c7440;let _0x52afaf={};const _0x203d26={},_0x495fb7={'count':0x0,'rows':[]},_0x2726c7=_[_0x4e4cc0('0x2f')](db[_0x4e4cc0('0x2b')][_0x4e4cc0('0x19')],function(_0x553e9e){const _0x155c27=_0x4e4cc0;return{'name':_0x553e9e[_0x155c27('0xd')],'type':_0x553e9e[_0x155c27('0x2a')][_0x155c27('0x1c')]};});_0x203d26[_0x4e4cc0('0x1a')]=_[_0x4e4cc0('0x2f')](_0x2726c7,_0x4e4cc0('0x27')),_0x203d26['query']=_[_0x4e4cc0('0xb')](_0x1eedac[_0x4e4cc0('0x28')]),_0x203d26['filters']=_['intersection'](_0x203d26[_0x4e4cc0('0x1a')],_0x203d26[_0x4e4cc0('0x28')]),_0x52afaf[_0x4e4cc0('0x0')]=_[_0x4e4cc0('0x13')](_0x203d26[_0x4e4cc0('0x1a')],qs['fields'](_0x1eedac[_0x4e4cc0('0x28')][_0x4e4cc0('0x15')])),_0x52afaf[_0x4e4cc0('0x0')]=_0x52afaf['attributes']['length']?_0x52afaf[_0x4e4cc0('0x0')]:_0x203d26[_0x4e4cc0('0x1a')];typeof _0x1eedac[_0x4e4cc0('0x28')]['nolimit']==='undefined'&&(_0x52afaf[_0x4e4cc0('0xa')]=qs[_0x4e4cc0('0xa')](_0x1eedac[_0x4e4cc0('0x28')]['limit']),_0x52afaf['offset']=qs[_0x4e4cc0('0x10')](_0x1eedac[_0x4e4cc0('0x28')]['offset']));_0x52afaf[_0x4e4cc0('0x2e')]=qs['sort'](_0x1eedac['query']['sort']),_0x52afaf[_0x4e4cc0('0x4')]=qs['filters'](_[_0x4e4cc0('0x24')](_0x1eedac[_0x4e4cc0('0x28')],_0x203d26['filters']),_0x2726c7);_0x1eedac[_0x4e4cc0('0x28')][_0x4e4cc0('0x14')]&&(_0x52afaf[_0x4e4cc0('0x4')]=_['merge'](_0x52afaf['where'],{[Op['or']]:_[_0x4e4cc0('0x2f')](_0x2726c7,function(_0x90b05f){const _0x22ebbc=_0x4e4cc0;if(_0x90b05f[_0x22ebbc('0x2a')]!==_0x22ebbc('0x29')){const _0x16fed7={};return _0x16fed7[_0x90b05f[_0x22ebbc('0x27')]]={[Op[_0x22ebbc('0x2d')]]:'%'+_0x1eedac['query'][_0x22ebbc('0x14')]+'%'},_0x16fed7;}})}));_0x52afaf=_[_0x4e4cc0('0x1e')]({},_0x52afaf,_0x1eedac['options']);const _0x304453={'where':_0x52afaf[_0x4e4cc0('0x4')]};return db['MailQueueReport']['count'](_0x304453)['then'](function(_0x4f6115){const _0x2656a0=_0x4e4cc0;return _0x495fb7[_0x2656a0('0x2c')]=_0x4f6115,_0x1eedac[_0x2656a0('0x28')][_0x2656a0('0x2')]&&(_0x52afaf[_0x2656a0('0x30')]=[{'all':!![]}]),db[_0x2656a0('0x2b')][_0x2656a0('0x26')](_0x52afaf);})[_0x4e4cc0('0x23')](function(_0x1bf29){return _0x495fb7['rows']=_0x1bf29,_0x495fb7;})[_0x4e4cc0('0x23')](respondWithFilteredResult(_0x5f0a4e,_0x52afaf))['catch'](handleError(_0x5f0a4e,null));},exports[_0x2c7440('0x7')]=function(_0xbbe1a7,_0x5a3398){const _0x4b88de=_0x2c7440;let _0x168d64={'raw':!![],'where':{'id':_0xbbe1a7[_0x4b88de('0x1d')]['id']}};const _0x38a23c={};return _0x38a23c[_0x4b88de('0x1a')]=_[_0x4b88de('0xb')](db[_0x4b88de('0x2b')]['rawAttributes']),_0x38a23c[_0x4b88de('0x28')]=_[_0x4b88de('0xb')](_0xbbe1a7[_0x4b88de('0x28')]),_0x38a23c['filters']=_[_0x4b88de('0x13')](_0x38a23c[_0x4b88de('0x1a')],_0x38a23c[_0x4b88de('0x28')]),_0x168d64['attributes']=_[_0x4b88de('0x13')](_0x38a23c[_0x4b88de('0x1a')],qs[_0x4b88de('0x15')](_0xbbe1a7[_0x4b88de('0x28')][_0x4b88de('0x15')])),_0x168d64[_0x4b88de('0x0')]=_0x168d64[_0x4b88de('0x0')][_0x4b88de('0x1f')]?_0x168d64[_0x4b88de('0x0')]:_0x38a23c[_0x4b88de('0x1a')],_0xbbe1a7['query'][_0x4b88de('0x2')]&&(_0x168d64[_0x4b88de('0x30')]=[{'all':!![]}]),_0x168d64=_[_0x4b88de('0x1e')]({},_0x168d64,_0xbbe1a7['options']),db[_0x4b88de('0x2b')]['findOne'](_0x168d64)[_0x4b88de('0x23')](handleEntityNotFound(_0x5a3398,null))[_0x4b88de('0x23')](respondWithResult(_0x5a3398,null))[_0x4b88de('0x17')](handleError(_0x5a3398,null));},exports[_0x2c7440('0x25')]=function(_0x4a1e1a,_0x1632b3){const _0x57cd4c=_0x2c7440;return db[_0x57cd4c('0x2b')]['create'](_0x4a1e1a['body'],{})[_0x57cd4c('0x23')](respondWithResult(_0x1632b3,0xc9))[_0x57cd4c('0x17')](handleError(_0x1632b3,null));},exports[_0x2c7440('0x12')]=function(_0x5a90a5,_0x318c59){const _0x111b85=_0x2c7440;return _0x5a90a5[_0x111b85('0x8')]['id']&&delete _0x5a90a5[_0x111b85('0x8')]['id'],db[_0x111b85('0x2b')][_0x111b85('0x20')]({'where':{'id':_0x5a90a5[_0x111b85('0x1d')]['id']}})[_0x111b85('0x23')](handleEntityNotFound(_0x318c59,null))[_0x111b85('0x23')](saveUpdates(_0x5a90a5[_0x111b85('0x8')],null))['then'](respondWithResult(_0x318c59,null))[_0x111b85('0x17')](handleError(_0x318c59,null));},exports[_0x2c7440('0x18')]=function(_0x13995f,_0x4f8aa9){const _0x39b3cf=_0x2c7440;return db[_0x39b3cf('0x2b')]['findOne']({'where':{'id':_0x13995f[_0x39b3cf('0x1d')]['id']}})['then'](handleEntityNotFound(_0x4f8aa9,null))[_0x39b3cf('0x23')](removeEntity(_0x4f8aa9,null))['catch'](handleError(_0x4f8aa9,null));},exports[_0x2c7440('0x22')]=function(_0xa9f575,_0x418089){const _0x41e04e=_0x2c7440;return db[_0x41e04e('0x2b')][_0x41e04e('0x22')]()['then'](respondWithResult(_0x418089,null))[_0x41e04e('0x17')](handleError(_0x418089,null));};
\ No newline at end of file
+const a427_0xe5f8=['index','options','nolimit','merge','findOne','../../components/parsers/qs','offset','key','end','update','count','lodash','rawAttributes','sendStatus','then','body','fields','fieldName','catch','sort','keys','include','rows','intersection','../../config/logger','type','filter','error','destroy','pick','describe','name','json','like','order','send','where','stack','model','params','includeAll','filters','query','../../mysqldb','limit','status','attributes','map','MailQueueReport','create'];(function(_0x166f6f,_0xe5f8a){const _0x3c02f0=function(_0x57181c){while(--_0x57181c){_0x166f6f['push'](_0x166f6f['shift']());}};_0x3c02f0(++_0xe5f8a);}(a427_0xe5f8,0x1ee));const a427_0x3c02=function(_0x166f6f,_0xe5f8a){_0x166f6f=_0x166f6f-0x0;let _0x3c02f0=a427_0xe5f8[_0x166f6f];return _0x3c02f0;};const _0x3a13da=a427_0x3c02;'use strict';const _=require(_0x3a13da('0x11')),qs=require(_0x3a13da('0xb')),logger=require(_0x3a13da('0x1e'))('api'),db=require(_0x3a13da('0x31'))['db'],{Op}=require('sequelize');function respondWithResult(_0x57181c,_0x2a607b){return _0x2a607b=_0x2a607b||0xc8,function(_0x20351e){if(_0x20351e)return _0x57181c['status'](_0x2a607b)['json'](_0x20351e);};}function respondWithFilteredResult(_0x23a2c2,_0x49165a){return function(_0x28fa15){const _0x5337ea=a427_0x3c02;if(_0x28fa15){const _0x130d82=_0x28fa15[_0x5337ea('0x10')],_0x3a9291=_0x49165a[_0x5337ea('0xc')];let _0x29fc44=_0x49165a[_0x5337ea('0xc')]+_0x49165a[_0x5337ea('0x0')],_0x14173c;return _0x29fc44>=_0x130d82?(_0x29fc44=_0x130d82,_0x14173c=0xc8):_0x14173c=0xce,_0x23a2c2['status'](_0x14173c),_0x23a2c2['set']('Content-Range',_0x3a9291+'-'+_0x29fc44+'/'+_0x130d82)[_0x5337ea('0x26')](_0x28fa15);}return null;};}function saveUpdates(_0x2e1270){return function(_0x161bdd){const _0x397ff4=a427_0x3c02;if(_0x161bdd)return _0x161bdd[_0x397ff4('0xf')](_0x2e1270)[_0x397ff4('0x14')](function(_0x2a17fd){return _0x2a17fd;});return null;};}function removeEntity(_0x1579df){return function(_0x2ffc0e){const _0x34020e=a427_0x3c02;if(_0x2ffc0e)return _0x2ffc0e[_0x34020e('0x22')]()[_0x34020e('0x14')](function(){const _0x39cc11=_0x34020e;_0x1579df['status'](0xcc)[_0x39cc11('0xe')]();});};}function handleEntityNotFound(_0x2304bc){return function(_0x9b94b3){const _0x37e157=a427_0x3c02;return!_0x9b94b3&&_0x2304bc[_0x37e157('0x13')](0x194),_0x9b94b3;};}function handleError(_0x548772,_0x10954a){return _0x10954a=_0x10954a||0x1f4,function(_0x5a82eb){const _0x374d03=a427_0x3c02;logger[_0x374d03('0x21')](_0x5a82eb[_0x374d03('0x2b')]),_0x5a82eb['name']&&delete _0x5a82eb[_0x374d03('0x25')],_0x548772[_0x374d03('0x1')](_0x10954a)[_0x374d03('0x29')](_0x5a82eb);};}exports[_0x3a13da('0x6')]=function(_0x326db6,_0x5b5c70){const _0x3ecc37=_0x3a13da;let _0x494f13={};const _0x453c0f={},_0x406b83={'count':0x0,'rows':[]},_0x51dbc0=_[_0x3ecc37('0x3')](db[_0x3ecc37('0x4')][_0x3ecc37('0x12')],function(_0x2c300c){const _0x5c7364=_0x3ecc37;return{'name':_0x2c300c[_0x5c7364('0x17')],'type':_0x2c300c['type'][_0x5c7364('0xd')]};});_0x453c0f[_0x3ecc37('0x2c')]=_[_0x3ecc37('0x3')](_0x51dbc0,_0x3ecc37('0x25')),_0x453c0f[_0x3ecc37('0x30')]=_[_0x3ecc37('0x1a')](_0x326db6[_0x3ecc37('0x30')]),_0x453c0f['filters']=_['intersection'](_0x453c0f[_0x3ecc37('0x2c')],_0x453c0f[_0x3ecc37('0x30')]),_0x494f13[_0x3ecc37('0x2')]=_['intersection'](_0x453c0f['model'],qs[_0x3ecc37('0x16')](_0x326db6[_0x3ecc37('0x30')][_0x3ecc37('0x16')])),_0x494f13['attributes']=_0x494f13[_0x3ecc37('0x2')]['length']?_0x494f13['attributes']:_0x453c0f[_0x3ecc37('0x2c')];typeof _0x326db6['query'][_0x3ecc37('0x8')]==='undefined'&&(_0x494f13[_0x3ecc37('0x0')]=qs[_0x3ecc37('0x0')](_0x326db6[_0x3ecc37('0x30')][_0x3ecc37('0x0')]),_0x494f13['offset']=qs['offset'](_0x326db6[_0x3ecc37('0x30')][_0x3ecc37('0xc')]));_0x494f13[_0x3ecc37('0x28')]=qs[_0x3ecc37('0x19')](_0x326db6['query']['sort']),_0x494f13[_0x3ecc37('0x2a')]=qs[_0x3ecc37('0x2f')](_[_0x3ecc37('0x23')](_0x326db6['query'],_0x453c0f[_0x3ecc37('0x2f')]),_0x51dbc0);_0x326db6[_0x3ecc37('0x30')][_0x3ecc37('0x20')]&&(_0x494f13[_0x3ecc37('0x2a')]=_[_0x3ecc37('0x9')](_0x494f13[_0x3ecc37('0x2a')],{[Op['or']]:_[_0x3ecc37('0x3')](_0x51dbc0,function(_0x50ddcf){const _0x209076=_0x3ecc37;if(_0x50ddcf[_0x209076('0x1f')]!=='VIRTUAL'){const _0xeb632e={};return _0xeb632e[_0x50ddcf[_0x209076('0x25')]]={[Op[_0x209076('0x27')]]:'%'+_0x326db6[_0x209076('0x30')][_0x209076('0x20')]+'%'},_0xeb632e;}})}));_0x494f13=_[_0x3ecc37('0x9')]({},_0x494f13,_0x326db6['options']);const _0x121914={'where':_0x494f13[_0x3ecc37('0x2a')]};return db['MailQueueReport'][_0x3ecc37('0x10')](_0x121914)[_0x3ecc37('0x14')](function(_0x26665f){const _0x556695=_0x3ecc37;return _0x406b83['count']=_0x26665f,_0x326db6['query'][_0x556695('0x2e')]&&(_0x494f13[_0x556695('0x1b')]=[{'all':!![]}]),db[_0x556695('0x4')]['findAll'](_0x494f13);})[_0x3ecc37('0x14')](function(_0x137fe3){const _0x298109=_0x3ecc37;return _0x406b83[_0x298109('0x1c')]=_0x137fe3,_0x406b83;})['then'](respondWithFilteredResult(_0x5b5c70,_0x494f13))[_0x3ecc37('0x18')](handleError(_0x5b5c70,null));},exports['show']=function(_0x444f76,_0x5d870d){const _0x7a061f=_0x3a13da;let _0x4bca76={'raw':!![],'where':{'id':_0x444f76[_0x7a061f('0x2d')]['id']}};const _0x150073={};return _0x150073[_0x7a061f('0x2c')]=_[_0x7a061f('0x1a')](db['MailQueueReport'][_0x7a061f('0x12')]),_0x150073[_0x7a061f('0x30')]=_[_0x7a061f('0x1a')](_0x444f76[_0x7a061f('0x30')]),_0x150073[_0x7a061f('0x2f')]=_[_0x7a061f('0x1d')](_0x150073[_0x7a061f('0x2c')],_0x150073[_0x7a061f('0x30')]),_0x4bca76['attributes']=_[_0x7a061f('0x1d')](_0x150073[_0x7a061f('0x2c')],qs[_0x7a061f('0x16')](_0x444f76[_0x7a061f('0x30')]['fields'])),_0x4bca76[_0x7a061f('0x2')]=_0x4bca76[_0x7a061f('0x2')]['length']?_0x4bca76[_0x7a061f('0x2')]:_0x150073[_0x7a061f('0x2c')],_0x444f76[_0x7a061f('0x30')][_0x7a061f('0x2e')]&&(_0x4bca76[_0x7a061f('0x1b')]=[{'all':!![]}]),_0x4bca76=_[_0x7a061f('0x9')]({},_0x4bca76,_0x444f76[_0x7a061f('0x7')]),db[_0x7a061f('0x4')][_0x7a061f('0xa')](_0x4bca76)['then'](handleEntityNotFound(_0x5d870d,null))['then'](respondWithResult(_0x5d870d,null))[_0x7a061f('0x18')](handleError(_0x5d870d,null));},exports['create']=function(_0x398b3c,_0x1b5236){const _0x51606d=_0x3a13da;return db[_0x51606d('0x4')][_0x51606d('0x5')](_0x398b3c[_0x51606d('0x15')],{})['then'](respondWithResult(_0x1b5236,0xc9))[_0x51606d('0x18')](handleError(_0x1b5236,null));},exports[_0x3a13da('0xf')]=function(_0x487d0e,_0x122b7d){const _0x3b0cdb=_0x3a13da;return _0x487d0e[_0x3b0cdb('0x15')]['id']&&delete _0x487d0e['body']['id'],db[_0x3b0cdb('0x4')][_0x3b0cdb('0xa')]({'where':{'id':_0x487d0e['params']['id']}})[_0x3b0cdb('0x14')](handleEntityNotFound(_0x122b7d,null))[_0x3b0cdb('0x14')](saveUpdates(_0x487d0e[_0x3b0cdb('0x15')],null))[_0x3b0cdb('0x14')](respondWithResult(_0x122b7d,null))[_0x3b0cdb('0x18')](handleError(_0x122b7d,null));},exports[_0x3a13da('0x22')]=function(_0x20852b,_0x2cb8fc){const _0x491062=_0x3a13da;return db[_0x491062('0x4')][_0x491062('0xa')]({'where':{'id':_0x20852b[_0x491062('0x2d')]['id']}})[_0x491062('0x14')](handleEntityNotFound(_0x2cb8fc,null))[_0x491062('0x14')](removeEntity(_0x2cb8fc,null))['catch'](handleError(_0x2cb8fc,null));},exports[_0x3a13da('0x24')]=function(_0x217d0c,_0x3892ec){const _0x3427ae=_0x3a13da;return db['MailQueueReport'][_0x3427ae('0x24')]()[_0x3427ae('0x14')](respondWithResult(_0x3892ec,null))[_0x3427ae('0x18')](handleError(_0x3892ec,null));};
\ No newline at end of file