Built motion from commit 459747fdfe53bbf13fbede61eeaffea1f1438f86. Version 3.0.0...
[motion-next.git] / server / api / openchannelQueueReport / openchannelQueueReport.controller.js
index fdb1491..b5f178d 100644 (file)
@@ -1 +1 @@
-const a501_0x4620=['params','body','index','create','includeAll','pick','update','Content-Range','fields','describe','merge','findAll','model','length','json','keys','status','undefined','sort','query','attributes','then','limit','map','nolimit','rawAttributes','order','lodash','like','sendStatus','offset','api','../../components/parsers/qs','sequelize','../../mysqldb','intersection','count','findOne','where','show','options','send','../../config/logger','OpenchannelQueueReport','catch','include','end','filters','destroy','filter','name','fieldName'];(function(_0x2066a4,_0x4620d1){const _0x3195b1=function(_0x1062e7){while(--_0x1062e7){_0x2066a4['push'](_0x2066a4['shift']());}};_0x3195b1(++_0x4620d1);}(a501_0x4620,0xf1));const a501_0x3195=function(_0x2066a4,_0x4620d1){_0x2066a4=_0x2066a4-0x0;let _0x3195b1=a501_0x4620[_0x2066a4];return _0x3195b1;};const _0xbdbe91=a501_0x3195;'use strict';const _=require(_0xbdbe91('0x2e')),qs=require(_0xbdbe91('0x33')),logger=require(_0xbdbe91('0x9'))(_0xbdbe91('0x32')),db=require(_0xbdbe91('0x1'))['db'],{Op}=require(_0xbdbe91('0x0'));function respondWithResult(_0x1062e7,_0x561021){return _0x561021=_0x561021||0xc8,function(_0x1bf704){const _0x96f572=a501_0x3195;if(_0x1bf704)return _0x1062e7['status'](_0x561021)[_0x96f572('0x21')](_0x1bf704);};}function respondWithFilteredResult(_0x837181,_0x528dbb){return function(_0x47596e){const _0x18cea0=a501_0x3195;if(_0x47596e){const _0x4b068a=_0x47596e[_0x18cea0('0x3')],_0x418f9d=_0x528dbb['offset'];let _0x452c62=_0x528dbb[_0x18cea0('0x31')]+_0x528dbb['limit'],_0x37e747;return _0x452c62>=_0x4b068a?(_0x452c62=_0x4b068a,_0x37e747=0xc8):_0x37e747=0xce,_0x837181[_0x18cea0('0x23')](_0x37e747),_0x837181['set'](_0x18cea0('0x1a'),_0x418f9d+'-'+_0x452c62+'/'+_0x4b068a)[_0x18cea0('0x21')](_0x47596e);}return null;};}function saveUpdates(_0x84e547){return function(_0x3a597b){const _0x345bd7=a501_0x3195;if(_0x3a597b)return _0x3a597b[_0x345bd7('0x19')](_0x84e547)['then'](function(_0x5945b0){return _0x5945b0;});return null;};}function removeEntity(_0x232869){return function(_0x2f2c57){const _0xccb82=a501_0x3195;if(_0x2f2c57)return _0x2f2c57[_0xccb82('0xf')]()[_0xccb82('0x28')](function(){const _0x5ccfe0=_0xccb82;_0x232869[_0x5ccfe0('0x23')](0xcc)[_0x5ccfe0('0xd')]();});};}function handleEntityNotFound(_0x8094e7){return function(_0x181550){const _0x2ec8da=a501_0x3195;return!_0x181550&&_0x8094e7[_0x2ec8da('0x30')](0x194),_0x181550;};}function handleError(_0x2800ee,_0x3a935e){return _0x3a935e=_0x3a935e||0x1f4,function(_0x471dc5){const _0x36c16d=a501_0x3195;logger['error'](_0x471dc5['stack']),_0x471dc5[_0x36c16d('0x11')]&&delete _0x471dc5[_0x36c16d('0x11')],_0x2800ee[_0x36c16d('0x23')](_0x3a935e)[_0x36c16d('0x8')](_0x471dc5);};}exports[_0xbdbe91('0x15')]=function(_0x17ea01,_0x418256){const _0x2091ea=_0xbdbe91;let _0x2fe407={};const _0x22f483={},_0x34beb9={'count':0x0,'rows':[]},_0x2104d4=_[_0x2091ea('0x2a')](db[_0x2091ea('0xa')][_0x2091ea('0x2c')],function(_0x27acc2){const _0x1f2cb7=_0x2091ea;return{'name':_0x27acc2[_0x1f2cb7('0x12')],'type':_0x27acc2['type']['key']};});_0x22f483[_0x2091ea('0x1f')]=_[_0x2091ea('0x2a')](_0x2104d4,'name'),_0x22f483[_0x2091ea('0x26')]=_['keys'](_0x17ea01['query']),_0x22f483['filters']=_['intersection'](_0x22f483[_0x2091ea('0x1f')],_0x22f483['query']),_0x2fe407[_0x2091ea('0x27')]=_[_0x2091ea('0x2')](_0x22f483['model'],qs[_0x2091ea('0x1b')](_0x17ea01[_0x2091ea('0x26')][_0x2091ea('0x1b')])),_0x2fe407[_0x2091ea('0x27')]=_0x2fe407[_0x2091ea('0x27')][_0x2091ea('0x20')]?_0x2fe407['attributes']:_0x22f483['model'];typeof _0x17ea01[_0x2091ea('0x26')][_0x2091ea('0x2b')]===_0x2091ea('0x24')&&(_0x2fe407[_0x2091ea('0x29')]=qs[_0x2091ea('0x29')](_0x17ea01['query']['limit']),_0x2fe407[_0x2091ea('0x31')]=qs[_0x2091ea('0x31')](_0x17ea01[_0x2091ea('0x26')]['offset']));_0x2fe407[_0x2091ea('0x2d')]=qs[_0x2091ea('0x25')](_0x17ea01[_0x2091ea('0x26')][_0x2091ea('0x25')]),_0x2fe407[_0x2091ea('0x5')]=qs['filters'](_[_0x2091ea('0x18')](_0x17ea01[_0x2091ea('0x26')],_0x22f483[_0x2091ea('0xe')]),_0x2104d4);_0x17ea01['query'][_0x2091ea('0x10')]&&(_0x2fe407[_0x2091ea('0x5')]=_[_0x2091ea('0x1d')](_0x2fe407[_0x2091ea('0x5')],{[Op['or']]:_[_0x2091ea('0x2a')](_0x2104d4,function(_0x509cef){const _0x2daccc=_0x2091ea;if(_0x509cef['type']!=='VIRTUAL'){const _0x3d0414={};return _0x3d0414[_0x509cef[_0x2daccc('0x11')]]={[Op[_0x2daccc('0x2f')]]:'%'+_0x17ea01[_0x2daccc('0x26')][_0x2daccc('0x10')]+'%'},_0x3d0414;}})}));_0x2fe407=_[_0x2091ea('0x1d')]({},_0x2fe407,_0x17ea01[_0x2091ea('0x7')]);const _0x3778b3={'where':_0x2fe407[_0x2091ea('0x5')]};return db[_0x2091ea('0xa')]['count'](_0x3778b3)[_0x2091ea('0x28')](function(_0x803d7b){const _0x2b204e=_0x2091ea;return _0x34beb9[_0x2b204e('0x3')]=_0x803d7b,_0x17ea01[_0x2b204e('0x26')][_0x2b204e('0x17')]&&(_0x2fe407[_0x2b204e('0xc')]=[{'all':!![]}]),db[_0x2b204e('0xa')][_0x2b204e('0x1e')](_0x2fe407);})[_0x2091ea('0x28')](function(_0x3f162d){return _0x34beb9['rows']=_0x3f162d,_0x34beb9;})[_0x2091ea('0x28')](respondWithFilteredResult(_0x418256,_0x2fe407))[_0x2091ea('0xb')](handleError(_0x418256,null));},exports[_0xbdbe91('0x6')]=function(_0x281e27,_0x24c979){const _0x22d75e=_0xbdbe91;let _0x46fcd1={'raw':!![],'where':{'id':_0x281e27[_0x22d75e('0x13')]['id']}};const _0x40260f={};return _0x40260f[_0x22d75e('0x1f')]=_[_0x22d75e('0x22')](db['OpenchannelQueueReport'][_0x22d75e('0x2c')]),_0x40260f['query']=_['keys'](_0x281e27[_0x22d75e('0x26')]),_0x40260f[_0x22d75e('0xe')]=_[_0x22d75e('0x2')](_0x40260f[_0x22d75e('0x1f')],_0x40260f[_0x22d75e('0x26')]),_0x46fcd1[_0x22d75e('0x27')]=_['intersection'](_0x40260f['model'],qs[_0x22d75e('0x1b')](_0x281e27['query'][_0x22d75e('0x1b')])),_0x46fcd1[_0x22d75e('0x27')]=_0x46fcd1[_0x22d75e('0x27')]['length']?_0x46fcd1[_0x22d75e('0x27')]:_0x40260f[_0x22d75e('0x1f')],_0x281e27[_0x22d75e('0x26')][_0x22d75e('0x17')]&&(_0x46fcd1[_0x22d75e('0xc')]=[{'all':!![]}]),_0x46fcd1=_[_0x22d75e('0x1d')]({},_0x46fcd1,_0x281e27[_0x22d75e('0x7')]),db[_0x22d75e('0xa')][_0x22d75e('0x4')](_0x46fcd1)['then'](handleEntityNotFound(_0x24c979,null))[_0x22d75e('0x28')](respondWithResult(_0x24c979,null))[_0x22d75e('0xb')](handleError(_0x24c979,null));},exports[_0xbdbe91('0x16')]=function(_0xf33b29,_0x2a9f3d){const _0x1163c9=_0xbdbe91;return db[_0x1163c9('0xa')][_0x1163c9('0x16')](_0xf33b29['body'],{})[_0x1163c9('0x28')](respondWithResult(_0x2a9f3d,0xc9))[_0x1163c9('0xb')](handleError(_0x2a9f3d,null));},exports[_0xbdbe91('0x19')]=function(_0x162f48,_0x51cf55){const _0xa5ed11=_0xbdbe91;return _0x162f48['body']['id']&&delete _0x162f48['body']['id'],db[_0xa5ed11('0xa')][_0xa5ed11('0x4')]({'where':{'id':_0x162f48[_0xa5ed11('0x13')]['id']}})['then'](handleEntityNotFound(_0x51cf55,null))[_0xa5ed11('0x28')](saveUpdates(_0x162f48[_0xa5ed11('0x14')],null))[_0xa5ed11('0x28')](respondWithResult(_0x51cf55,null))[_0xa5ed11('0xb')](handleError(_0x51cf55,null));},exports[_0xbdbe91('0xf')]=function(_0xc0466a,_0x47297a){const _0x2724c8=_0xbdbe91;return db['OpenchannelQueueReport'][_0x2724c8('0x4')]({'where':{'id':_0xc0466a[_0x2724c8('0x13')]['id']}})[_0x2724c8('0x28')](handleEntityNotFound(_0x47297a,null))[_0x2724c8('0x28')](removeEntity(_0x47297a,null))['catch'](handleError(_0x47297a,null));},exports[_0xbdbe91('0x1c')]=function(_0x1a9dc6,_0x18c492){const _0x1d888a=_0xbdbe91;return db[_0x1d888a('0xa')][_0x1d888a('0x1c')]()[_0x1d888a('0x28')](respondWithResult(_0x18c492,null))[_0x1d888a('0xb')](handleError(_0x18c492,null));};
\ No newline at end of file
+const a501_0x4a75=['include','query','offset','type','show','undefined','end','error','stack','api','index','merge','rawAttributes','catch','attributes','intersection','order','length','count','findAll','nolimit','set','map','fieldName','sequelize','../../config/logger','sort','body','key','fields','destroy','VIRTUAL','params','name','limit','status','model','describe','OpenchannelQueueReport','options','like','update','then','filter','filters','keys','includeAll','findOne','sendStatus','where','../../components/parsers/qs','json'];(function(_0x11ef39,_0x4a75e0){const _0x3f812b=function(_0x465554){while(--_0x465554){_0x11ef39['push'](_0x11ef39['shift']());}};_0x3f812b(++_0x4a75e0);}(a501_0x4a75,0x166));const a501_0x3f81=function(_0x11ef39,_0x4a75e0){_0x11ef39=_0x11ef39-0x0;let _0x3f812b=a501_0x4a75[_0x11ef39];return _0x3f812b;};const _0x507aaf=a501_0x3f81;'use strict';const _=require('lodash'),qs=require(_0x507aaf('0x4')),logger=require(_0x507aaf('0x1f'))(_0x507aaf('0xf')),db=require('../../mysqldb')['db'],{Op}=require(_0x507aaf('0x1e'));function respondWithResult(_0x465554,_0x59a37d){return _0x59a37d=_0x59a37d||0xc8,function(_0x2a76f8){const _0x2ef727=a501_0x3f81;if(_0x2a76f8)return _0x465554[_0x2ef727('0x29')](_0x59a37d)[_0x2ef727('0x5')](_0x2a76f8);};}function respondWithFilteredResult(_0x231f71,_0x2c642c){return function(_0x18bc9b){const _0xa7f8cf=a501_0x3f81;if(_0x18bc9b){const _0x47a807=_0x18bc9b[_0xa7f8cf('0x18')],_0x4a0f7d=_0x2c642c[_0xa7f8cf('0x8')];let _0x125305=_0x2c642c[_0xa7f8cf('0x8')]+_0x2c642c[_0xa7f8cf('0x28')],_0xbdebd1;return _0x125305>=_0x47a807?(_0x125305=_0x47a807,_0xbdebd1=0xc8):_0xbdebd1=0xce,_0x231f71[_0xa7f8cf('0x29')](_0xbdebd1),_0x231f71[_0xa7f8cf('0x1b')]('Content-Range',_0x4a0f7d+'-'+_0x125305+'/'+_0x47a807)['json'](_0x18bc9b);}return null;};}function saveUpdates(_0x460647){return function(_0x1628ef){const _0x16220f=a501_0x3f81;if(_0x1628ef)return _0x1628ef[_0x16220f('0x2f')](_0x460647)[_0x16220f('0x30')](function(_0x82603c){return _0x82603c;});return null;};}function removeEntity(_0x4ac853){return function(_0x27e56f){const _0x4c8bfe=a501_0x3f81;if(_0x27e56f)return _0x27e56f[_0x4c8bfe('0x24')]()['then'](function(){const _0x544e0b=_0x4c8bfe;_0x4ac853['status'](0xcc)[_0x544e0b('0xc')]();});};}function handleEntityNotFound(_0x2988f9){return function(_0x381013){const _0x1e9d13=a501_0x3f81;return!_0x381013&&_0x2988f9[_0x1e9d13('0x2')](0x194),_0x381013;};}function handleError(_0x1a22cb,_0x6ebf7b){return _0x6ebf7b=_0x6ebf7b||0x1f4,function(_0x4cb093){const _0x3facbd=a501_0x3f81;logger[_0x3facbd('0xd')](_0x4cb093[_0x3facbd('0xe')]),_0x4cb093[_0x3facbd('0x27')]&&delete _0x4cb093[_0x3facbd('0x27')],_0x1a22cb[_0x3facbd('0x29')](_0x6ebf7b)['send'](_0x4cb093);};}exports[_0x507aaf('0x10')]=function(_0x470026,_0x4f37a2){const _0x5cb92d=_0x507aaf;let _0x1ac48f={};const _0x7eab71={},_0x63db76={'count':0x0,'rows':[]},_0x152488=_[_0x5cb92d('0x1c')](db[_0x5cb92d('0x2c')]['rawAttributes'],function(_0xf6d2c2){const _0x548c68=_0x5cb92d;return{'name':_0xf6d2c2[_0x548c68('0x1d')],'type':_0xf6d2c2[_0x548c68('0x9')][_0x548c68('0x22')]};});_0x7eab71[_0x5cb92d('0x2a')]=_[_0x5cb92d('0x1c')](_0x152488,_0x5cb92d('0x27')),_0x7eab71[_0x5cb92d('0x7')]=_[_0x5cb92d('0x33')](_0x470026['query']),_0x7eab71['filters']=_[_0x5cb92d('0x15')](_0x7eab71['model'],_0x7eab71[_0x5cb92d('0x7')]),_0x1ac48f['attributes']=_[_0x5cb92d('0x15')](_0x7eab71[_0x5cb92d('0x2a')],qs[_0x5cb92d('0x23')](_0x470026[_0x5cb92d('0x7')][_0x5cb92d('0x23')])),_0x1ac48f[_0x5cb92d('0x14')]=_0x1ac48f[_0x5cb92d('0x14')][_0x5cb92d('0x17')]?_0x1ac48f[_0x5cb92d('0x14')]:_0x7eab71['model'];typeof _0x470026[_0x5cb92d('0x7')][_0x5cb92d('0x1a')]===_0x5cb92d('0xb')&&(_0x1ac48f[_0x5cb92d('0x28')]=qs[_0x5cb92d('0x28')](_0x470026[_0x5cb92d('0x7')][_0x5cb92d('0x28')]),_0x1ac48f['offset']=qs[_0x5cb92d('0x8')](_0x470026[_0x5cb92d('0x7')][_0x5cb92d('0x8')]));_0x1ac48f[_0x5cb92d('0x16')]=qs['sort'](_0x470026[_0x5cb92d('0x7')][_0x5cb92d('0x20')]),_0x1ac48f[_0x5cb92d('0x3')]=qs[_0x5cb92d('0x32')](_['pick'](_0x470026[_0x5cb92d('0x7')],_0x7eab71[_0x5cb92d('0x32')]),_0x152488);_0x470026[_0x5cb92d('0x7')]['filter']&&(_0x1ac48f['where']=_['merge'](_0x1ac48f[_0x5cb92d('0x3')],{[Op['or']]:_[_0x5cb92d('0x1c')](_0x152488,function(_0x581b39){const _0x5c9896=_0x5cb92d;if(_0x581b39[_0x5c9896('0x9')]!==_0x5c9896('0x25')){const _0x14a3d6={};return _0x14a3d6[_0x581b39['name']]={[Op[_0x5c9896('0x2e')]]:'%'+_0x470026[_0x5c9896('0x7')][_0x5c9896('0x31')]+'%'},_0x14a3d6;}})}));_0x1ac48f=_[_0x5cb92d('0x11')]({},_0x1ac48f,_0x470026['options']);const _0x5b3d50={'where':_0x1ac48f[_0x5cb92d('0x3')]};return db['OpenchannelQueueReport'][_0x5cb92d('0x18')](_0x5b3d50)['then'](function(_0x576972){const _0x1ee52b=_0x5cb92d;return _0x63db76[_0x1ee52b('0x18')]=_0x576972,_0x470026[_0x1ee52b('0x7')][_0x1ee52b('0x0')]&&(_0x1ac48f['include']=[{'all':!![]}]),db[_0x1ee52b('0x2c')][_0x1ee52b('0x19')](_0x1ac48f);})[_0x5cb92d('0x30')](function(_0x21815c){return _0x63db76['rows']=_0x21815c,_0x63db76;})[_0x5cb92d('0x30')](respondWithFilteredResult(_0x4f37a2,_0x1ac48f))[_0x5cb92d('0x13')](handleError(_0x4f37a2,null));},exports[_0x507aaf('0xa')]=function(_0x311ef7,_0x44de78){const _0x23c23f=_0x507aaf;let _0x5e0d0f={'raw':!![],'where':{'id':_0x311ef7[_0x23c23f('0x26')]['id']}};const _0x4dd92f={};return _0x4dd92f['model']=_[_0x23c23f('0x33')](db['OpenchannelQueueReport'][_0x23c23f('0x12')]),_0x4dd92f[_0x23c23f('0x7')]=_[_0x23c23f('0x33')](_0x311ef7[_0x23c23f('0x7')]),_0x4dd92f['filters']=_['intersection'](_0x4dd92f[_0x23c23f('0x2a')],_0x4dd92f[_0x23c23f('0x7')]),_0x5e0d0f['attributes']=_[_0x23c23f('0x15')](_0x4dd92f['model'],qs[_0x23c23f('0x23')](_0x311ef7[_0x23c23f('0x7')][_0x23c23f('0x23')])),_0x5e0d0f['attributes']=_0x5e0d0f[_0x23c23f('0x14')]['length']?_0x5e0d0f[_0x23c23f('0x14')]:_0x4dd92f[_0x23c23f('0x2a')],_0x311ef7[_0x23c23f('0x7')]['includeAll']&&(_0x5e0d0f[_0x23c23f('0x6')]=[{'all':!![]}]),_0x5e0d0f=_['merge']({},_0x5e0d0f,_0x311ef7[_0x23c23f('0x2d')]),db[_0x23c23f('0x2c')][_0x23c23f('0x1')](_0x5e0d0f)[_0x23c23f('0x30')](handleEntityNotFound(_0x44de78,null))[_0x23c23f('0x30')](respondWithResult(_0x44de78,null))[_0x23c23f('0x13')](handleError(_0x44de78,null));},exports['create']=function(_0x50b28d,_0x175cc3){const _0x339124=_0x507aaf;return db[_0x339124('0x2c')]['create'](_0x50b28d[_0x339124('0x21')],{})['then'](respondWithResult(_0x175cc3,0xc9))['catch'](handleError(_0x175cc3,null));},exports[_0x507aaf('0x2f')]=function(_0x4adea1,_0x15ee78){const _0x5f256c=_0x507aaf;return _0x4adea1[_0x5f256c('0x21')]['id']&&delete _0x4adea1[_0x5f256c('0x21')]['id'],db[_0x5f256c('0x2c')][_0x5f256c('0x1')]({'where':{'id':_0x4adea1[_0x5f256c('0x26')]['id']}})[_0x5f256c('0x30')](handleEntityNotFound(_0x15ee78,null))[_0x5f256c('0x30')](saveUpdates(_0x4adea1[_0x5f256c('0x21')],null))[_0x5f256c('0x30')](respondWithResult(_0x15ee78,null))[_0x5f256c('0x13')](handleError(_0x15ee78,null));},exports[_0x507aaf('0x24')]=function(_0x115e1f,_0x3727be){const _0x54a806=_0x507aaf;return db[_0x54a806('0x2c')][_0x54a806('0x1')]({'where':{'id':_0x115e1f[_0x54a806('0x26')]['id']}})['then'](handleEntityNotFound(_0x3727be,null))[_0x54a806('0x30')](removeEntity(_0x3727be,null))[_0x54a806('0x13')](handleError(_0x3727be,null));},exports[_0x507aaf('0x2b')]=function(_0x4fd384,_0x4ddaf4){const _0xd792cd=_0x507aaf;return db['OpenchannelQueueReport'][_0xd792cd('0x2b')]()[_0xd792cd('0x30')](respondWithResult(_0x4ddaf4,null))[_0xd792cd('0x13')](handleError(_0x4ddaf4,null));};
\ No newline at end of file