Built motion from commit b517aaa2a6638133380e4d135c64a80893061362. Version 3.0.0...
[motion-next.git] / server / api / chatQueueReport / chatQueueReport.controller.js
index 3c1fb9a..696fd6e 100644 (file)
@@ -1 +1 @@
-const a102_0x79b4=['findAll','../../components/parsers/qs','Content-Range','intersection','update','offset','options','rows','name','stack','length','fields','create','type','key','undefined','keys','findOne','filters','sendStatus','body','VIRTUAL','index','map','ChatQueueReport','limit','sequelize','includeAll','where','json','sort','filter','describe','fieldName','model','order','then','attributes','pick','destroy','count','status','params','rawAttributes','query','api','include','merge','show','catch'];(function(_0x542ec4,_0x79b42a){const _0x32fda7=function(_0x55a5ba){while(--_0x55a5ba){_0x542ec4['push'](_0x542ec4['shift']());}};_0x32fda7(++_0x79b42a);}(a102_0x79b4,0x1a0));const a102_0x32fd=function(_0x542ec4,_0x79b42a){_0x542ec4=_0x542ec4-0x0;let _0x32fda7=a102_0x79b4[_0x542ec4];return _0x32fda7;};const _0x47e9fa=a102_0x32fd;'use strict';const _=require('lodash'),qs=require(_0x47e9fa('0x23')),logger=require('../../config/logger')(_0x47e9fa('0x1d')),db=require('../../mysqldb')['db'],{Op}=require(_0x47e9fa('0xa'));function respondWithResult(_0x55a5ba,_0x457bdd){return _0x457bdd=_0x457bdd||0xc8,function(_0x163a90){if(_0x163a90)return _0x55a5ba['status'](_0x457bdd)['json'](_0x163a90);};}function respondWithFilteredResult(_0x24c61b,_0x3aa6a6){return function(_0x37a500){const _0x37ca49=a102_0x32fd;if(_0x37a500){const _0x49f7a7=_0x37a500[_0x37ca49('0x18')],_0xe3c90a=_0x3aa6a6[_0x37ca49('0x27')];let _0x49519f=_0x3aa6a6[_0x37ca49('0x27')]+_0x3aa6a6['limit'],_0x8aacf2;return _0x49519f>=_0x49f7a7?(_0x49519f=_0x49f7a7,_0x8aacf2=0xc8):_0x8aacf2=0xce,_0x24c61b[_0x37ca49('0x19')](_0x8aacf2),_0x24c61b['set'](_0x37ca49('0x24'),_0xe3c90a+'-'+_0x49519f+'/'+_0x49f7a7)[_0x37ca49('0xd')](_0x37a500);}return null;};}function saveUpdates(_0x255185){return function(_0x350f74){if(_0x350f74)return _0x350f74['update'](_0x255185)['then'](function(_0x14bc3f){return _0x14bc3f;});return null;};}function removeEntity(_0x16c787){return function(_0x3820bc){const _0x41fa78=a102_0x32fd;if(_0x3820bc)return _0x3820bc[_0x41fa78('0x17')]()[_0x41fa78('0x14')](function(){const _0x20f08f=_0x41fa78;_0x16c787[_0x20f08f('0x19')](0xcc)['end']();});};}function handleEntityNotFound(_0xad0673){return function(_0x44cc1a){const _0x2fb312=a102_0x32fd;return!_0x44cc1a&&_0xad0673[_0x2fb312('0x3')](0x194),_0x44cc1a;};}function handleError(_0x522eff,_0xbb6476){return _0xbb6476=_0xbb6476||0x1f4,function(_0x186c64){const _0x7ad47f=a102_0x32fd;logger['error'](_0x186c64[_0x7ad47f('0x2b')]),_0x186c64[_0x7ad47f('0x2a')]&&delete _0x186c64[_0x7ad47f('0x2a')],_0x522eff['status'](_0xbb6476)['send'](_0x186c64);};}exports[_0x47e9fa('0x6')]=function(_0x4ae471,_0xcd64bf){const _0x378b2f=_0x47e9fa;let _0xab3dcf={};const _0x3d9520={},_0x34fe00={'count':0x0,'rows':[]},_0x25bbed=_[_0x378b2f('0x7')](db[_0x378b2f('0x8')][_0x378b2f('0x1b')],function(_0x25b740){const _0xfe834=_0x378b2f;return{'name':_0x25b740[_0xfe834('0x11')],'type':_0x25b740[_0xfe834('0x2f')][_0xfe834('0x30')]};});_0x3d9520[_0x378b2f('0x12')]=_[_0x378b2f('0x7')](_0x25bbed,'name'),_0x3d9520['query']=_[_0x378b2f('0x0')](_0x4ae471[_0x378b2f('0x1c')]),_0x3d9520[_0x378b2f('0x2')]=_[_0x378b2f('0x25')](_0x3d9520[_0x378b2f('0x12')],_0x3d9520[_0x378b2f('0x1c')]),_0xab3dcf[_0x378b2f('0x15')]=_['intersection'](_0x3d9520[_0x378b2f('0x12')],qs[_0x378b2f('0x2d')](_0x4ae471[_0x378b2f('0x1c')][_0x378b2f('0x2d')])),_0xab3dcf[_0x378b2f('0x15')]=_0xab3dcf[_0x378b2f('0x15')][_0x378b2f('0x2c')]?_0xab3dcf[_0x378b2f('0x15')]:_0x3d9520[_0x378b2f('0x12')];typeof _0x4ae471[_0x378b2f('0x1c')]['nolimit']===_0x378b2f('0x31')&&(_0xab3dcf[_0x378b2f('0x9')]=qs[_0x378b2f('0x9')](_0x4ae471[_0x378b2f('0x1c')]['limit']),_0xab3dcf['offset']=qs[_0x378b2f('0x27')](_0x4ae471[_0x378b2f('0x1c')][_0x378b2f('0x27')]));_0xab3dcf[_0x378b2f('0x13')]=qs[_0x378b2f('0xe')](_0x4ae471[_0x378b2f('0x1c')][_0x378b2f('0xe')]),_0xab3dcf['where']=qs['filters'](_[_0x378b2f('0x16')](_0x4ae471[_0x378b2f('0x1c')],_0x3d9520[_0x378b2f('0x2')]),_0x25bbed);_0x4ae471['query'][_0x378b2f('0xf')]&&(_0xab3dcf[_0x378b2f('0xc')]=_['merge'](_0xab3dcf[_0x378b2f('0xc')],{[Op['or']]:_[_0x378b2f('0x7')](_0x25bbed,function(_0x207ef7){const _0x152e05=_0x378b2f;if(_0x207ef7[_0x152e05('0x2f')]!==_0x152e05('0x5')){const _0xead7f8={};return _0xead7f8[_0x207ef7[_0x152e05('0x2a')]]={[Op['like']]:'%'+_0x4ae471['query'][_0x152e05('0xf')]+'%'},_0xead7f8;}})}));_0xab3dcf=_[_0x378b2f('0x1f')]({},_0xab3dcf,_0x4ae471['options']);const _0x158620={'where':_0xab3dcf[_0x378b2f('0xc')]};return db[_0x378b2f('0x8')][_0x378b2f('0x18')](_0x158620)[_0x378b2f('0x14')](function(_0x34bd94){const _0x190cf0=_0x378b2f;return _0x34fe00[_0x190cf0('0x18')]=_0x34bd94,_0x4ae471[_0x190cf0('0x1c')]['includeAll']&&(_0xab3dcf['include']=[{'all':!![]}]),db[_0x190cf0('0x8')][_0x190cf0('0x22')](_0xab3dcf);})[_0x378b2f('0x14')](function(_0x4cca5b){const _0x4fb283=_0x378b2f;return _0x34fe00[_0x4fb283('0x29')]=_0x4cca5b,_0x34fe00;})['then'](respondWithFilteredResult(_0xcd64bf,_0xab3dcf))[_0x378b2f('0x21')](handleError(_0xcd64bf,null));},exports[_0x47e9fa('0x20')]=function(_0x70cfbe,_0x9690f6){const _0x44a8c2=_0x47e9fa;let _0xaccd62={'raw':!![],'where':{'id':_0x70cfbe['params']['id']}};const _0x3749e1={};return _0x3749e1[_0x44a8c2('0x12')]=_[_0x44a8c2('0x0')](db[_0x44a8c2('0x8')][_0x44a8c2('0x1b')]),_0x3749e1[_0x44a8c2('0x1c')]=_['keys'](_0x70cfbe[_0x44a8c2('0x1c')]),_0x3749e1[_0x44a8c2('0x2')]=_[_0x44a8c2('0x25')](_0x3749e1[_0x44a8c2('0x12')],_0x3749e1[_0x44a8c2('0x1c')]),_0xaccd62['attributes']=_['intersection'](_0x3749e1[_0x44a8c2('0x12')],qs[_0x44a8c2('0x2d')](_0x70cfbe[_0x44a8c2('0x1c')][_0x44a8c2('0x2d')])),_0xaccd62[_0x44a8c2('0x15')]=_0xaccd62[_0x44a8c2('0x15')][_0x44a8c2('0x2c')]?_0xaccd62['attributes']:_0x3749e1[_0x44a8c2('0x12')],_0x70cfbe[_0x44a8c2('0x1c')][_0x44a8c2('0xb')]&&(_0xaccd62[_0x44a8c2('0x1e')]=[{'all':!![]}]),_0xaccd62=_[_0x44a8c2('0x1f')]({},_0xaccd62,_0x70cfbe[_0x44a8c2('0x28')]),db[_0x44a8c2('0x8')][_0x44a8c2('0x1')](_0xaccd62)['then'](handleEntityNotFound(_0x9690f6,null))[_0x44a8c2('0x14')](respondWithResult(_0x9690f6,null))[_0x44a8c2('0x21')](handleError(_0x9690f6,null));},exports[_0x47e9fa('0x2e')]=function(_0xd72899,_0x1279e0){const _0x7b0cf9=_0x47e9fa;return db['ChatQueueReport'][_0x7b0cf9('0x2e')](_0xd72899[_0x7b0cf9('0x4')],{})[_0x7b0cf9('0x14')](respondWithResult(_0x1279e0,0xc9))[_0x7b0cf9('0x21')](handleError(_0x1279e0,null));},exports[_0x47e9fa('0x26')]=function(_0x1ca802,_0x51e919){const _0x405037=_0x47e9fa;return _0x1ca802[_0x405037('0x4')]['id']&&delete _0x1ca802[_0x405037('0x4')]['id'],db['ChatQueueReport']['findOne']({'where':{'id':_0x1ca802[_0x405037('0x1a')]['id']}})[_0x405037('0x14')](handleEntityNotFound(_0x51e919,null))[_0x405037('0x14')](saveUpdates(_0x1ca802['body'],null))[_0x405037('0x14')](respondWithResult(_0x51e919,null))[_0x405037('0x21')](handleError(_0x51e919,null));},exports[_0x47e9fa('0x17')]=function(_0x1ce685,_0x41bb77){const _0x5af582=_0x47e9fa;return db['ChatQueueReport']['findOne']({'where':{'id':_0x1ce685[_0x5af582('0x1a')]['id']}})[_0x5af582('0x14')](handleEntityNotFound(_0x41bb77,null))['then'](removeEntity(_0x41bb77,null))[_0x5af582('0x21')](handleError(_0x41bb77,null));},exports[_0x47e9fa('0x10')]=function(_0x2b0c6b,_0x3105d5){const _0x53821c=_0x47e9fa;return db[_0x53821c('0x8')][_0x53821c('0x10')]()['then'](respondWithResult(_0x3105d5,null))[_0x53821c('0x21')](handleError(_0x3105d5,null));};
\ No newline at end of file
+const a102_0x101a=['include','merge','../../components/parsers/qs','keys','ChatQueueReport','then','rawAttributes','status','catch','fieldName','attributes','sort','where','stack','filters','filter','show','fields','name','send','model','body','end','length','findOne','rows','../../mysqldb','includeAll','like','update','lodash','key','limit','map','intersection','params','json','type','create','count','offset','Content-Range','query','options','../../config/logger','destroy','nolimit','sequelize','order','error'];(function(_0xb33052,_0x101a38){const _0x45ed3=function(_0x58bc00){while(--_0x58bc00){_0xb33052['push'](_0xb33052['shift']());}};_0x45ed3(++_0x101a38);}(a102_0x101a,0xa1));const a102_0x45ed=function(_0xb33052,_0x101a38){_0xb33052=_0xb33052-0x0;let _0x45ed3=a102_0x101a[_0xb33052];return _0x45ed3;};const _0xe72607=a102_0x45ed;'use strict';const _=require(_0xe72607('0x13')),qs=require(_0xe72607('0x29')),logger=require(_0xe72607('0x21'))('api'),db=require(_0xe72607('0xf'))['db'],{Op}=require(_0xe72607('0x24'));function respondWithResult(_0x58bc00,_0x34354e){return _0x34354e=_0x34354e||0xc8,function(_0x105c35){const _0x4f5e74=a102_0x45ed;if(_0x105c35)return _0x58bc00[_0x4f5e74('0x2e')](_0x34354e)[_0x4f5e74('0x19')](_0x105c35);};}function respondWithFilteredResult(_0x189842,_0x1ae4e4){return function(_0x3e9265){const _0x56d6ff=a102_0x45ed;if(_0x3e9265){const _0x21f211=_0x3e9265[_0x56d6ff('0x1c')],_0x254d6d=_0x1ae4e4[_0x56d6ff('0x1d')];let _0x1471f2=_0x1ae4e4[_0x56d6ff('0x1d')]+_0x1ae4e4[_0x56d6ff('0x15')],_0x447442;return _0x1471f2>=_0x21f211?(_0x1471f2=_0x21f211,_0x447442=0xc8):_0x447442=0xce,_0x189842['status'](_0x447442),_0x189842['set'](_0x56d6ff('0x1e'),_0x254d6d+'-'+_0x1471f2+'/'+_0x21f211)[_0x56d6ff('0x19')](_0x3e9265);}return null;};}function saveUpdates(_0x597406){return function(_0x16e22f){const _0x5882f2=a102_0x45ed;if(_0x16e22f)return _0x16e22f[_0x5882f2('0x12')](_0x597406)[_0x5882f2('0x2c')](function(_0x477a77){return _0x477a77;});return null;};}function removeEntity(_0x27524c){return function(_0x4c9a64){const _0x341f73=a102_0x45ed;if(_0x4c9a64)return _0x4c9a64[_0x341f73('0x22')]()[_0x341f73('0x2c')](function(){const _0x12da55=_0x341f73;_0x27524c[_0x12da55('0x2e')](0xcc)[_0x12da55('0xb')]();});};}function handleEntityNotFound(_0x1ffe14){return function(_0x29f3d0){return!_0x29f3d0&&_0x1ffe14['sendStatus'](0x194),_0x29f3d0;};}function handleError(_0x49baaf,_0x216fd4){return _0x216fd4=_0x216fd4||0x1f4,function(_0x1771f7){const _0x1ee9af=a102_0x45ed;logger[_0x1ee9af('0x26')](_0x1771f7[_0x1ee9af('0x2')]),_0x1771f7[_0x1ee9af('0x7')]&&delete _0x1771f7[_0x1ee9af('0x7')],_0x49baaf[_0x1ee9af('0x2e')](_0x216fd4)[_0x1ee9af('0x8')](_0x1771f7);};}exports['index']=function(_0x4e8871,_0x246d75){const _0x1ed714=_0xe72607;let _0x41b572={};const _0x51b2ad={},_0x5dba45={'count':0x0,'rows':[]},_0x2b6ddd=_[_0x1ed714('0x16')](db['ChatQueueReport'][_0x1ed714('0x2d')],function(_0x1923b8){const _0x44fd53=_0x1ed714;return{'name':_0x1923b8[_0x44fd53('0x30')],'type':_0x1923b8['type'][_0x44fd53('0x14')]};});_0x51b2ad[_0x1ed714('0x9')]=_['map'](_0x2b6ddd,'name'),_0x51b2ad[_0x1ed714('0x1f')]=_[_0x1ed714('0x2a')](_0x4e8871[_0x1ed714('0x1f')]),_0x51b2ad[_0x1ed714('0x3')]=_['intersection'](_0x51b2ad['model'],_0x51b2ad[_0x1ed714('0x1f')]),_0x41b572['attributes']=_[_0x1ed714('0x17')](_0x51b2ad[_0x1ed714('0x9')],qs[_0x1ed714('0x6')](_0x4e8871[_0x1ed714('0x1f')][_0x1ed714('0x6')])),_0x41b572[_0x1ed714('0x31')]=_0x41b572[_0x1ed714('0x31')][_0x1ed714('0xc')]?_0x41b572[_0x1ed714('0x31')]:_0x51b2ad[_0x1ed714('0x9')];typeof _0x4e8871['query'][_0x1ed714('0x23')]==='undefined'&&(_0x41b572[_0x1ed714('0x15')]=qs['limit'](_0x4e8871[_0x1ed714('0x1f')][_0x1ed714('0x15')]),_0x41b572[_0x1ed714('0x1d')]=qs['offset'](_0x4e8871['query'][_0x1ed714('0x1d')]));_0x41b572[_0x1ed714('0x25')]=qs[_0x1ed714('0x0')](_0x4e8871['query'][_0x1ed714('0x0')]),_0x41b572[_0x1ed714('0x1')]=qs[_0x1ed714('0x3')](_['pick'](_0x4e8871[_0x1ed714('0x1f')],_0x51b2ad[_0x1ed714('0x3')]),_0x2b6ddd);_0x4e8871[_0x1ed714('0x1f')][_0x1ed714('0x4')]&&(_0x41b572[_0x1ed714('0x1')]=_[_0x1ed714('0x28')](_0x41b572[_0x1ed714('0x1')],{[Op['or']]:_[_0x1ed714('0x16')](_0x2b6ddd,function(_0x5cd237){const _0x209689=_0x1ed714;if(_0x5cd237[_0x209689('0x1a')]!=='VIRTUAL'){const _0x24b2e1={};return _0x24b2e1[_0x5cd237[_0x209689('0x7')]]={[Op[_0x209689('0x11')]]:'%'+_0x4e8871[_0x209689('0x1f')][_0x209689('0x4')]+'%'},_0x24b2e1;}})}));_0x41b572=_['merge']({},_0x41b572,_0x4e8871[_0x1ed714('0x20')]);const _0x18ca2c={'where':_0x41b572['where']};return db['ChatQueueReport'][_0x1ed714('0x1c')](_0x18ca2c)[_0x1ed714('0x2c')](function(_0x26ca48){const _0x5b5339=_0x1ed714;return _0x5dba45['count']=_0x26ca48,_0x4e8871['query'][_0x5b5339('0x10')]&&(_0x41b572[_0x5b5339('0x27')]=[{'all':!![]}]),db[_0x5b5339('0x2b')]['findAll'](_0x41b572);})[_0x1ed714('0x2c')](function(_0x46a008){const _0x197e0b=_0x1ed714;return _0x5dba45[_0x197e0b('0xe')]=_0x46a008,_0x5dba45;})[_0x1ed714('0x2c')](respondWithFilteredResult(_0x246d75,_0x41b572))[_0x1ed714('0x2f')](handleError(_0x246d75,null));},exports[_0xe72607('0x5')]=function(_0x1ae7df,_0x13fde2){const _0x2597b2=_0xe72607;let _0x2dd550={'raw':!![],'where':{'id':_0x1ae7df[_0x2597b2('0x18')]['id']}};const _0x4fa30b={};return _0x4fa30b[_0x2597b2('0x9')]=_[_0x2597b2('0x2a')](db[_0x2597b2('0x2b')]['rawAttributes']),_0x4fa30b[_0x2597b2('0x1f')]=_['keys'](_0x1ae7df[_0x2597b2('0x1f')]),_0x4fa30b[_0x2597b2('0x3')]=_[_0x2597b2('0x17')](_0x4fa30b[_0x2597b2('0x9')],_0x4fa30b[_0x2597b2('0x1f')]),_0x2dd550[_0x2597b2('0x31')]=_['intersection'](_0x4fa30b[_0x2597b2('0x9')],qs['fields'](_0x1ae7df[_0x2597b2('0x1f')][_0x2597b2('0x6')])),_0x2dd550[_0x2597b2('0x31')]=_0x2dd550[_0x2597b2('0x31')][_0x2597b2('0xc')]?_0x2dd550[_0x2597b2('0x31')]:_0x4fa30b[_0x2597b2('0x9')],_0x1ae7df[_0x2597b2('0x1f')][_0x2597b2('0x10')]&&(_0x2dd550[_0x2597b2('0x27')]=[{'all':!![]}]),_0x2dd550=_[_0x2597b2('0x28')]({},_0x2dd550,_0x1ae7df['options']),db[_0x2597b2('0x2b')][_0x2597b2('0xd')](_0x2dd550)[_0x2597b2('0x2c')](handleEntityNotFound(_0x13fde2,null))[_0x2597b2('0x2c')](respondWithResult(_0x13fde2,null))[_0x2597b2('0x2f')](handleError(_0x13fde2,null));},exports[_0xe72607('0x1b')]=function(_0x8a958c,_0x4c5858){const _0x2ad143=_0xe72607;return db['ChatQueueReport'][_0x2ad143('0x1b')](_0x8a958c[_0x2ad143('0xa')],{})[_0x2ad143('0x2c')](respondWithResult(_0x4c5858,0xc9))[_0x2ad143('0x2f')](handleError(_0x4c5858,null));},exports[_0xe72607('0x12')]=function(_0x1c939f,_0x365073){const _0x4dca8d=_0xe72607;return _0x1c939f['body']['id']&&delete _0x1c939f[_0x4dca8d('0xa')]['id'],db['ChatQueueReport'][_0x4dca8d('0xd')]({'where':{'id':_0x1c939f[_0x4dca8d('0x18')]['id']}})['then'](handleEntityNotFound(_0x365073,null))[_0x4dca8d('0x2c')](saveUpdates(_0x1c939f['body'],null))[_0x4dca8d('0x2c')](respondWithResult(_0x365073,null))[_0x4dca8d('0x2f')](handleError(_0x365073,null));},exports[_0xe72607('0x22')]=function(_0x431d5d,_0x4753e7){const _0x2f6f35=_0xe72607;return db[_0x2f6f35('0x2b')][_0x2f6f35('0xd')]({'where':{'id':_0x431d5d[_0x2f6f35('0x18')]['id']}})[_0x2f6f35('0x2c')](handleEntityNotFound(_0x4753e7,null))[_0x2f6f35('0x2c')](removeEntity(_0x4753e7,null))['catch'](handleError(_0x4753e7,null));},exports['describe']=function(_0x4bc43a,_0x9002f2){const _0x52de84=_0xe72607;return db['ChatQueueReport']['describe']()[_0x52de84('0x2c')](respondWithResult(_0x9002f2,null))[_0x52de84('0x2f')](handleError(_0x9002f2,null));};
\ No newline at end of file