Built motion from commit ded33658aad58fc8de845a8299a9db59a88cc353. Version 3.0.0...
[motion-next.git] / server / api / chatQueueReport / chatQueueReport.controller.js
index 0acd9e3..698c329 100644 (file)
@@ -1 +1 @@
-const a102_0x2d06=['index','fieldName','pick','where','show','filter','../../components/parsers/qs','body','describe','rows','lodash','sequelize','../../config/logger','create','catch','key','fields','map','limit','then','params','status','options','keys','rawAttributes','type','query','model','filters','api','findOne','Content-Range','merge','sendStatus','includeAll','ChatQueueReport','end','length','offset','sort','intersection','order','destroy','name','VIRTUAL','include','attributes','json','count','update','send'];(function(_0x340f8a,_0x2d061b){const _0x4babca=function(_0x3cb2ef){while(--_0x3cb2ef){_0x340f8a['push'](_0x340f8a['shift']());}};_0x4babca(++_0x2d061b);}(a102_0x2d06,0x75));const a102_0x4bab=function(_0x340f8a,_0x2d061b){_0x340f8a=_0x340f8a-0x0;let _0x4babca=a102_0x2d06[_0x340f8a];return _0x4babca;};const _0x28268c=a102_0x4bab;'use strict';const _=require(_0x28268c('0x2e')),qs=require(_0x28268c('0x2a')),logger=require(_0x28268c('0x30'))(_0x28268c('0xe')),db=require('../../mysqldb')['db'],{Op}=require(_0x28268c('0x2f'));function respondWithResult(_0x3cb2ef,_0x573a6b){return _0x573a6b=_0x573a6b||0xc8,function(_0x37c910){const _0x53a844=a102_0x4bab;if(_0x37c910)return _0x3cb2ef[_0x53a844('0x6')](_0x573a6b)[_0x53a844('0x20')](_0x37c910);};}function respondWithFilteredResult(_0x2fab27,_0x49a8c9){return function(_0xa0ad88){const _0x4bd70f=a102_0x4bab;if(_0xa0ad88){const _0x31e819=_0xa0ad88[_0x4bd70f('0x21')],_0x20b673=_0x49a8c9['offset'];let _0x4e5f1f=_0x49a8c9[_0x4bd70f('0x17')]+_0x49a8c9[_0x4bd70f('0x3')],_0x2df783;return _0x4e5f1f>=_0x31e819?(_0x4e5f1f=_0x31e819,_0x2df783=0xc8):_0x2df783=0xce,_0x2fab27['status'](_0x2df783),_0x2fab27['set'](_0x4bd70f('0x10'),_0x20b673+'-'+_0x4e5f1f+'/'+_0x31e819)['json'](_0xa0ad88);}return null;};}function saveUpdates(_0x37f8b2){return function(_0x1e8576){const _0x2c51d6=a102_0x4bab;if(_0x1e8576)return _0x1e8576[_0x2c51d6('0x22')](_0x37f8b2)[_0x2c51d6('0x4')](function(_0x301e4e){return _0x301e4e;});return null;};}function removeEntity(_0x2a1ffa){return function(_0x2c8e42){const _0x12955d=a102_0x4bab;if(_0x2c8e42)return _0x2c8e42[_0x12955d('0x1b')]()[_0x12955d('0x4')](function(){const _0x8c160c=_0x12955d;_0x2a1ffa[_0x8c160c('0x6')](0xcc)[_0x8c160c('0x15')]();});};}function handleEntityNotFound(_0x11885f){return function(_0x551aaf){const _0x1a25f9=a102_0x4bab;return!_0x551aaf&&_0x11885f[_0x1a25f9('0x12')](0x194),_0x551aaf;};}function handleError(_0x4e3697,_0x4846bd){return _0x4846bd=_0x4846bd||0x1f4,function(_0x244732){const _0xce1121=a102_0x4bab;logger['error'](_0x244732['stack']),_0x244732[_0xce1121('0x1c')]&&delete _0x244732[_0xce1121('0x1c')],_0x4e3697[_0xce1121('0x6')](_0x4846bd)[_0xce1121('0x23')](_0x244732);};}exports[_0x28268c('0x24')]=function(_0x13b8c9,_0x50024f){const _0x584f1c=_0x28268c;let _0x3b5a75={};const _0x4a3c32={},_0x2d1580={'count':0x0,'rows':[]},_0x332101=_['map'](db[_0x584f1c('0x14')][_0x584f1c('0x9')],function(_0x4b6fed){const _0x35f913=_0x584f1c;return{'name':_0x4b6fed[_0x35f913('0x25')],'type':_0x4b6fed['type'][_0x35f913('0x0')]};});_0x4a3c32[_0x584f1c('0xc')]=_[_0x584f1c('0x2')](_0x332101,_0x584f1c('0x1c')),_0x4a3c32[_0x584f1c('0xb')]=_['keys'](_0x13b8c9[_0x584f1c('0xb')]),_0x4a3c32['filters']=_[_0x584f1c('0x19')](_0x4a3c32['model'],_0x4a3c32[_0x584f1c('0xb')]),_0x3b5a75['attributes']=_[_0x584f1c('0x19')](_0x4a3c32[_0x584f1c('0xc')],qs[_0x584f1c('0x1')](_0x13b8c9[_0x584f1c('0xb')]['fields'])),_0x3b5a75[_0x584f1c('0x1f')]=_0x3b5a75[_0x584f1c('0x1f')][_0x584f1c('0x16')]?_0x3b5a75[_0x584f1c('0x1f')]:_0x4a3c32[_0x584f1c('0xc')];typeof _0x13b8c9[_0x584f1c('0xb')]['nolimit']==='undefined'&&(_0x3b5a75[_0x584f1c('0x3')]=qs[_0x584f1c('0x3')](_0x13b8c9[_0x584f1c('0xb')][_0x584f1c('0x3')]),_0x3b5a75[_0x584f1c('0x17')]=qs[_0x584f1c('0x17')](_0x13b8c9[_0x584f1c('0xb')][_0x584f1c('0x17')]));_0x3b5a75[_0x584f1c('0x1a')]=qs['sort'](_0x13b8c9[_0x584f1c('0xb')][_0x584f1c('0x18')]),_0x3b5a75[_0x584f1c('0x27')]=qs[_0x584f1c('0xd')](_[_0x584f1c('0x26')](_0x13b8c9[_0x584f1c('0xb')],_0x4a3c32['filters']),_0x332101);_0x13b8c9[_0x584f1c('0xb')][_0x584f1c('0x29')]&&(_0x3b5a75[_0x584f1c('0x27')]=_['merge'](_0x3b5a75[_0x584f1c('0x27')],{[Op['or']]:_[_0x584f1c('0x2')](_0x332101,function(_0x17d0cb){const _0x11a10f=_0x584f1c;if(_0x17d0cb[_0x11a10f('0xa')]!==_0x11a10f('0x1d')){const _0x45d5d8={};return _0x45d5d8[_0x17d0cb['name']]={[Op['like']]:'%'+_0x13b8c9[_0x11a10f('0xb')]['filter']+'%'},_0x45d5d8;}})}));_0x3b5a75=_[_0x584f1c('0x11')]({},_0x3b5a75,_0x13b8c9[_0x584f1c('0x7')]);const _0x3358a6={'where':_0x3b5a75[_0x584f1c('0x27')]};return db[_0x584f1c('0x14')]['count'](_0x3358a6)[_0x584f1c('0x4')](function(_0x550f69){const _0xe14b34=_0x584f1c;return _0x2d1580[_0xe14b34('0x21')]=_0x550f69,_0x13b8c9[_0xe14b34('0xb')]['includeAll']&&(_0x3b5a75[_0xe14b34('0x1e')]=[{'all':!![]}]),db[_0xe14b34('0x14')]['findAll'](_0x3b5a75);})[_0x584f1c('0x4')](function(_0x26e70c){const _0x414fd2=_0x584f1c;return _0x2d1580[_0x414fd2('0x2d')]=_0x26e70c,_0x2d1580;})[_0x584f1c('0x4')](respondWithFilteredResult(_0x50024f,_0x3b5a75))[_0x584f1c('0x32')](handleError(_0x50024f,null));},exports[_0x28268c('0x28')]=function(_0x28ba8d,_0x203399){const _0x567f9f=_0x28268c;let _0xa77358={'raw':!![],'where':{'id':_0x28ba8d[_0x567f9f('0x5')]['id']}};const _0x58cf89={};return _0x58cf89['model']=_[_0x567f9f('0x8')](db[_0x567f9f('0x14')][_0x567f9f('0x9')]),_0x58cf89[_0x567f9f('0xb')]=_['keys'](_0x28ba8d[_0x567f9f('0xb')]),_0x58cf89[_0x567f9f('0xd')]=_['intersection'](_0x58cf89[_0x567f9f('0xc')],_0x58cf89[_0x567f9f('0xb')]),_0xa77358['attributes']=_[_0x567f9f('0x19')](_0x58cf89[_0x567f9f('0xc')],qs[_0x567f9f('0x1')](_0x28ba8d['query']['fields'])),_0xa77358[_0x567f9f('0x1f')]=_0xa77358[_0x567f9f('0x1f')][_0x567f9f('0x16')]?_0xa77358[_0x567f9f('0x1f')]:_0x58cf89[_0x567f9f('0xc')],_0x28ba8d[_0x567f9f('0xb')][_0x567f9f('0x13')]&&(_0xa77358[_0x567f9f('0x1e')]=[{'all':!![]}]),_0xa77358=_[_0x567f9f('0x11')]({},_0xa77358,_0x28ba8d['options']),db[_0x567f9f('0x14')][_0x567f9f('0xf')](_0xa77358)[_0x567f9f('0x4')](handleEntityNotFound(_0x203399,null))['then'](respondWithResult(_0x203399,null))['catch'](handleError(_0x203399,null));},exports['create']=function(_0x317d23,_0x2f2ef7){const _0x573df1=_0x28268c;return db[_0x573df1('0x14')][_0x573df1('0x31')](_0x317d23[_0x573df1('0x2b')],{})[_0x573df1('0x4')](respondWithResult(_0x2f2ef7,0xc9))[_0x573df1('0x32')](handleError(_0x2f2ef7,null));},exports['update']=function(_0x2a3422,_0x10b399){const _0x174eb6=_0x28268c;return _0x2a3422[_0x174eb6('0x2b')]['id']&&delete _0x2a3422[_0x174eb6('0x2b')]['id'],db[_0x174eb6('0x14')][_0x174eb6('0xf')]({'where':{'id':_0x2a3422[_0x174eb6('0x5')]['id']}})[_0x174eb6('0x4')](handleEntityNotFound(_0x10b399,null))[_0x174eb6('0x4')](saveUpdates(_0x2a3422[_0x174eb6('0x2b')],null))[_0x174eb6('0x4')](respondWithResult(_0x10b399,null))[_0x174eb6('0x32')](handleError(_0x10b399,null));},exports[_0x28268c('0x1b')]=function(_0x40d116,_0x422f4e){const _0x61a739=_0x28268c;return db[_0x61a739('0x14')]['findOne']({'where':{'id':_0x40d116[_0x61a739('0x5')]['id']}})[_0x61a739('0x4')](handleEntityNotFound(_0x422f4e,null))['then'](removeEntity(_0x422f4e,null))[_0x61a739('0x32')](handleError(_0x422f4e,null));},exports['describe']=function(_0x630a46,_0x2bcfa4){const _0x57041f=_0x28268c;return db[_0x57041f('0x14')][_0x57041f('0x2c')]()[_0x57041f('0x4')](respondWithResult(_0x2bcfa4,null))[_0x57041f('0x32')](handleError(_0x2bcfa4,null));};
\ No newline at end of file
+const a102_0x2faa=['map','count','set','describe','destroy','../../config/logger','ChatQueueReport','includeAll','fieldName','like','options','key','merge','offset','query','create','stack','attributes','index','nolimit','intersection','../../mysqldb','status','params','lodash','keys','catch','then','order','pick','show','body','filters','name','include','../../components/parsers/qs','VIRTUAL','where','filter','sort','limit','model','type','update','send','length','rawAttributes','fields','findOne','end','json','findAll'];(function(_0x53e601,_0x2faaac){const _0x2070c7=function(_0x38b580){while(--_0x38b580){_0x53e601['push'](_0x53e601['shift']());}};_0x2070c7(++_0x2faaac);}(a102_0x2faa,0x171));const a102_0x2070=function(_0x53e601,_0x2faaac){_0x53e601=_0x53e601-0x0;let _0x2070c7=a102_0x2faa[_0x53e601];return _0x2070c7;};const _0x35b420=a102_0x2070;'use strict';const _=require(_0x35b420('0x13')),qs=require(_0x35b420('0x1e')),logger=require(_0x35b420('0x0'))('api'),db=require(_0x35b420('0x10'))['db'],{Op}=require('sequelize');function respondWithResult(_0x38b580,_0x3b9e2a){return _0x3b9e2a=_0x3b9e2a||0xc8,function(_0x2143d5){const _0x4764fb=a102_0x2070;if(_0x2143d5)return _0x38b580[_0x4764fb('0x11')](_0x3b9e2a)[_0x4764fb('0x2d')](_0x2143d5);};}function respondWithFilteredResult(_0x48ce9c,_0x6b1f5d){return function(_0x438fb6){const _0x541872=a102_0x2070;if(_0x438fb6){const _0x1e2b68=_0x438fb6[_0x541872('0x30')],_0x4c7419=_0x6b1f5d[_0x541872('0x8')];let _0x580f7a=_0x6b1f5d['offset']+_0x6b1f5d[_0x541872('0x23')],_0x2cb501;return _0x580f7a>=_0x1e2b68?(_0x580f7a=_0x1e2b68,_0x2cb501=0xc8):_0x2cb501=0xce,_0x48ce9c['status'](_0x2cb501),_0x48ce9c[_0x541872('0x31')]('Content-Range',_0x4c7419+'-'+_0x580f7a+'/'+_0x1e2b68)[_0x541872('0x2d')](_0x438fb6);}return null;};}function saveUpdates(_0x4b9bfc){return function(_0x288271){const _0x58f123=a102_0x2070;if(_0x288271)return _0x288271[_0x58f123('0x26')](_0x4b9bfc)[_0x58f123('0x16')](function(_0x125da0){return _0x125da0;});return null;};}function removeEntity(_0x40e876){return function(_0x28cd12){const _0x25c48c=a102_0x2070;if(_0x28cd12)return _0x28cd12[_0x25c48c('0x33')]()[_0x25c48c('0x16')](function(){const _0xe25900=_0x25c48c;_0x40e876[_0xe25900('0x11')](0xcc)[_0xe25900('0x2c')]();});};}function handleEntityNotFound(_0x17f52e){return function(_0x136cc8){return!_0x136cc8&&_0x17f52e['sendStatus'](0x194),_0x136cc8;};}function handleError(_0x32bacf,_0x45f8ee){return _0x45f8ee=_0x45f8ee||0x1f4,function(_0x52c0a2){const _0x263304=a102_0x2070;logger['error'](_0x52c0a2[_0x263304('0xb')]),_0x52c0a2[_0x263304('0x1c')]&&delete _0x52c0a2[_0x263304('0x1c')],_0x32bacf[_0x263304('0x11')](_0x45f8ee)[_0x263304('0x27')](_0x52c0a2);};}exports[_0x35b420('0xd')]=function(_0x1bf863,_0x23f787){const _0x4ebe3f=_0x35b420;let _0x120665={};const _0x5617ce={},_0x46b717={'count':0x0,'rows':[]},_0x3ec2b4=_['map'](db[_0x4ebe3f('0x1')][_0x4ebe3f('0x29')],function(_0x7b4e15){const _0x465813=_0x4ebe3f;return{'name':_0x7b4e15[_0x465813('0x3')],'type':_0x7b4e15[_0x465813('0x25')][_0x465813('0x6')]};});_0x5617ce[_0x4ebe3f('0x24')]=_[_0x4ebe3f('0x2f')](_0x3ec2b4,'name'),_0x5617ce[_0x4ebe3f('0x9')]=_[_0x4ebe3f('0x14')](_0x1bf863[_0x4ebe3f('0x9')]),_0x5617ce[_0x4ebe3f('0x1b')]=_[_0x4ebe3f('0xf')](_0x5617ce['model'],_0x5617ce[_0x4ebe3f('0x9')]),_0x120665[_0x4ebe3f('0xc')]=_[_0x4ebe3f('0xf')](_0x5617ce['model'],qs[_0x4ebe3f('0x2a')](_0x1bf863[_0x4ebe3f('0x9')][_0x4ebe3f('0x2a')])),_0x120665['attributes']=_0x120665['attributes']['length']?_0x120665['attributes']:_0x5617ce['model'];typeof _0x1bf863['query'][_0x4ebe3f('0xe')]==='undefined'&&(_0x120665[_0x4ebe3f('0x23')]=qs[_0x4ebe3f('0x23')](_0x1bf863[_0x4ebe3f('0x9')][_0x4ebe3f('0x23')]),_0x120665['offset']=qs[_0x4ebe3f('0x8')](_0x1bf863[_0x4ebe3f('0x9')][_0x4ebe3f('0x8')]));_0x120665[_0x4ebe3f('0x17')]=qs[_0x4ebe3f('0x22')](_0x1bf863[_0x4ebe3f('0x9')][_0x4ebe3f('0x22')]),_0x120665[_0x4ebe3f('0x20')]=qs[_0x4ebe3f('0x1b')](_[_0x4ebe3f('0x18')](_0x1bf863[_0x4ebe3f('0x9')],_0x5617ce[_0x4ebe3f('0x1b')]),_0x3ec2b4);_0x1bf863[_0x4ebe3f('0x9')]['filter']&&(_0x120665[_0x4ebe3f('0x20')]=_[_0x4ebe3f('0x7')](_0x120665['where'],{[Op['or']]:_['map'](_0x3ec2b4,function(_0x2a8f46){const _0x36d032=_0x4ebe3f;if(_0x2a8f46['type']!==_0x36d032('0x1f')){const _0x383b8f={};return _0x383b8f[_0x2a8f46[_0x36d032('0x1c')]]={[Op[_0x36d032('0x4')]]:'%'+_0x1bf863[_0x36d032('0x9')][_0x36d032('0x21')]+'%'},_0x383b8f;}})}));_0x120665=_[_0x4ebe3f('0x7')]({},_0x120665,_0x1bf863[_0x4ebe3f('0x5')]);const _0x1af890={'where':_0x120665[_0x4ebe3f('0x20')]};return db['ChatQueueReport']['count'](_0x1af890)[_0x4ebe3f('0x16')](function(_0x5d6ca7){const _0x11fd4d=_0x4ebe3f;return _0x46b717[_0x11fd4d('0x30')]=_0x5d6ca7,_0x1bf863['query'][_0x11fd4d('0x2')]&&(_0x120665[_0x11fd4d('0x1d')]=[{'all':!![]}]),db[_0x11fd4d('0x1')][_0x11fd4d('0x2e')](_0x120665);})[_0x4ebe3f('0x16')](function(_0x2fa5f1){return _0x46b717['rows']=_0x2fa5f1,_0x46b717;})[_0x4ebe3f('0x16')](respondWithFilteredResult(_0x23f787,_0x120665))['catch'](handleError(_0x23f787,null));},exports[_0x35b420('0x19')]=function(_0x4ee32f,_0x11fbff){const _0x5a6c52=_0x35b420;let _0x31fc95={'raw':!![],'where':{'id':_0x4ee32f[_0x5a6c52('0x12')]['id']}};const _0x540df4={};return _0x540df4[_0x5a6c52('0x24')]=_[_0x5a6c52('0x14')](db['ChatQueueReport'][_0x5a6c52('0x29')]),_0x540df4['query']=_[_0x5a6c52('0x14')](_0x4ee32f[_0x5a6c52('0x9')]),_0x540df4[_0x5a6c52('0x1b')]=_[_0x5a6c52('0xf')](_0x540df4[_0x5a6c52('0x24')],_0x540df4[_0x5a6c52('0x9')]),_0x31fc95[_0x5a6c52('0xc')]=_[_0x5a6c52('0xf')](_0x540df4[_0x5a6c52('0x24')],qs[_0x5a6c52('0x2a')](_0x4ee32f[_0x5a6c52('0x9')]['fields'])),_0x31fc95[_0x5a6c52('0xc')]=_0x31fc95[_0x5a6c52('0xc')][_0x5a6c52('0x28')]?_0x31fc95[_0x5a6c52('0xc')]:_0x540df4[_0x5a6c52('0x24')],_0x4ee32f[_0x5a6c52('0x9')][_0x5a6c52('0x2')]&&(_0x31fc95['include']=[{'all':!![]}]),_0x31fc95=_[_0x5a6c52('0x7')]({},_0x31fc95,_0x4ee32f[_0x5a6c52('0x5')]),db[_0x5a6c52('0x1')][_0x5a6c52('0x2b')](_0x31fc95)[_0x5a6c52('0x16')](handleEntityNotFound(_0x11fbff,null))['then'](respondWithResult(_0x11fbff,null))[_0x5a6c52('0x15')](handleError(_0x11fbff,null));},exports[_0x35b420('0xa')]=function(_0x1fcc3b,_0x5a50b4){const _0x14738a=_0x35b420;return db['ChatQueueReport'][_0x14738a('0xa')](_0x1fcc3b[_0x14738a('0x1a')],{})[_0x14738a('0x16')](respondWithResult(_0x5a50b4,0xc9))['catch'](handleError(_0x5a50b4,null));},exports['update']=function(_0x4df32d,_0x81644f){const _0x4b7943=_0x35b420;return _0x4df32d[_0x4b7943('0x1a')]['id']&&delete _0x4df32d[_0x4b7943('0x1a')]['id'],db[_0x4b7943('0x1')][_0x4b7943('0x2b')]({'where':{'id':_0x4df32d['params']['id']}})[_0x4b7943('0x16')](handleEntityNotFound(_0x81644f,null))[_0x4b7943('0x16')](saveUpdates(_0x4df32d[_0x4b7943('0x1a')],null))['then'](respondWithResult(_0x81644f,null))['catch'](handleError(_0x81644f,null));},exports[_0x35b420('0x33')]=function(_0x4b2834,_0x3de406){const _0x33e557=_0x35b420;return db['ChatQueueReport']['findOne']({'where':{'id':_0x4b2834[_0x33e557('0x12')]['id']}})[_0x33e557('0x16')](handleEntityNotFound(_0x3de406,null))[_0x33e557('0x16')](removeEntity(_0x3de406,null))[_0x33e557('0x15')](handleError(_0x3de406,null));},exports[_0x35b420('0x32')]=function(_0xe5d66,_0x2477d3){const _0x6ee5eb=_0x35b420;return db[_0x6ee5eb('0x1')][_0x6ee5eb('0x32')]()[_0x6ee5eb('0x16')](respondWithResult(_0x2477d3,null))[_0x6ee5eb('0x15')](handleError(_0x2477d3,null));};
\ No newline at end of file