Built motion from commit f738f9592c388b9f9eb3948f400a5c9d717a3561. Version 3.0.0...
[motion-next.git] / server / api / chatQueueReport / chatQueueReport.controller.js
index 4cbeca7..f2348f1 100644 (file)
@@ -1 +1 @@
-const a122_0x35a9=['filters','order','limit','where','attributes','type','status','index','merge','pick','api','stack','fieldName','body','map','ChatQueueReport','options','intersection','count','then','rows','catch','sort','like','Content-Range','send','model','create','query','includeAll','params','rawAttributes','../../config/logger','update','filter','include','keys','findOne','lodash','set','VIRTUAL','fields','offset','sendStatus','../../components/parsers/qs','json','name','length','describe'];(function(_0x10e6b6,_0x4a8de5){const _0x35a988=function(_0x4d4288){while(--_0x4d4288){_0x10e6b6['push'](_0x10e6b6['shift']());}};_0x35a988(++_0x4a8de5);}(a122_0x35a9,0x92));const a122_0x4d42=function(_0x10e6b6,_0x4a8de5){_0x10e6b6=_0x10e6b6-0x1ef;let _0x35a988=a122_0x35a9[_0x10e6b6];return _0x35a988;};const a122_0x5a55af=a122_0x4d42;'use strict';const _=require(a122_0x5a55af(0x216)),qs=require(a122_0x5a55af(0x21c)),logger=require(a122_0x5a55af(0x210))(a122_0x5a55af(0x1fa)),{db}=require('../../mysqldb'),{Op}=require('sequelize');function respondWithResult(_0x28601d,_0x34a01a){return _0x34a01a=_0x34a01a||0xc8,function(_0x2b2e6f){const _0x2d6823=a122_0x4d42;if(_0x2b2e6f)return _0x28601d[_0x2d6823(0x1f6)](_0x34a01a)[_0x2d6823(0x21d)](_0x2b2e6f);};}function respondWithFilteredResult(_0x2a6c52,_0x5e9f23){return function(_0x4ebf9a){const _0x1c9c19=a122_0x4d42;if(_0x4ebf9a){const _0xc2f242=_0x4ebf9a[_0x1c9c19(0x202)],_0x28ca21=_0x5e9f23['offset'];let _0x3497a1=_0x5e9f23['offset']+_0x5e9f23['limit'],_0x4d1378;return _0x3497a1>=_0xc2f242?(_0x3497a1=_0xc2f242,_0x4d1378=0xc8):_0x4d1378=0xce,_0x2a6c52[_0x1c9c19(0x1f6)](_0x4d1378),_0x2a6c52[_0x1c9c19(0x217)](_0x1c9c19(0x208),_0x28ca21+'-'+_0x3497a1+'/'+_0xc2f242)[_0x1c9c19(0x21d)](_0x4ebf9a);}return null;};}function saveUpdates(_0x22f12b){return function(_0x2a9ce7){const _0x9f849f=a122_0x4d42;if(_0x2a9ce7)return _0x2a9ce7[_0x9f849f(0x211)](_0x22f12b)[_0x9f849f(0x203)](function(_0x18b40d){return _0x18b40d;});return null;};}function removeEntity(_0x452eb6){return function(_0x43d198){if(_0x43d198)return _0x43d198['destroy']()['then'](function(){const _0x68eb7c=a122_0x4d42;_0x452eb6[_0x68eb7c(0x1f6)](0xcc)['end']();});};}function handleEntityNotFound(_0x50d75e){return function(_0x347002){const _0x35efb2=a122_0x4d42;return!_0x347002&&_0x50d75e[_0x35efb2(0x21b)](0x194),_0x347002;};}function handleError(_0x2a9268,_0x1bff96){return _0x1bff96=_0x1bff96||0x1f4,function(_0xef0c06){const _0x53d8e8=a122_0x4d42;logger['error'](_0xef0c06[_0x53d8e8(0x1fb)]),_0xef0c06[_0x53d8e8(0x21e)]&&delete _0xef0c06[_0x53d8e8(0x21e)],_0x2a9268['status'](_0x1bff96)[_0x53d8e8(0x209)](_0xef0c06);};}exports[a122_0x5a55af(0x1f7)]=function(_0xb86bc8,_0x3a9c8b){const _0xdf17b0=a122_0x5a55af;let _0x5f1563={};const _0x4f12c6={},_0x57a5d9={'count':0x0,'rows':[]},_0x40e638=_[_0xdf17b0(0x1fe)](db[_0xdf17b0(0x1ff)]['rawAttributes'],function(_0x2b743f){const _0x93fbce=_0xdf17b0;return{'name':_0x2b743f[_0x93fbce(0x1fc)],'type':_0x2b743f[_0x93fbce(0x1f5)]['key']};});_0x4f12c6[_0xdf17b0(0x20a)]=_[_0xdf17b0(0x1fe)](_0x40e638,_0xdf17b0(0x21e)),_0x4f12c6[_0xdf17b0(0x20c)]=_[_0xdf17b0(0x214)](_0xb86bc8[_0xdf17b0(0x20c)]),_0x4f12c6[_0xdf17b0(0x1f0)]=_[_0xdf17b0(0x201)](_0x4f12c6[_0xdf17b0(0x20a)],_0x4f12c6['query']),_0x5f1563[_0xdf17b0(0x1f4)]=_['intersection'](_0x4f12c6[_0xdf17b0(0x20a)],qs[_0xdf17b0(0x219)](_0xb86bc8[_0xdf17b0(0x20c)][_0xdf17b0(0x219)])),_0x5f1563['attributes']=_0x5f1563[_0xdf17b0(0x1f4)]['length']?_0x5f1563[_0xdf17b0(0x1f4)]:_0x4f12c6[_0xdf17b0(0x20a)];typeof _0xb86bc8['query']['nolimit']==='undefined'&&(_0x5f1563['limit']=qs[_0xdf17b0(0x1f2)](_0xb86bc8[_0xdf17b0(0x20c)][_0xdf17b0(0x1f2)]),_0x5f1563[_0xdf17b0(0x21a)]=qs[_0xdf17b0(0x21a)](_0xb86bc8[_0xdf17b0(0x20c)]['offset']));_0x5f1563[_0xdf17b0(0x1f1)]=qs[_0xdf17b0(0x206)](_0xb86bc8[_0xdf17b0(0x20c)][_0xdf17b0(0x206)]),_0x5f1563[_0xdf17b0(0x1f3)]=qs[_0xdf17b0(0x1f0)](_[_0xdf17b0(0x1f9)](_0xb86bc8['query'],_0x4f12c6[_0xdf17b0(0x1f0)]),_0x40e638);_0xb86bc8['query'][_0xdf17b0(0x212)]&&(_0x5f1563[_0xdf17b0(0x1f3)]=_['merge'](_0x5f1563[_0xdf17b0(0x1f3)],{[Op['or']]:_[_0xdf17b0(0x1fe)](_0x40e638,function(_0x1ed12e){const _0x2d8807=_0xdf17b0;if(_0x1ed12e[_0x2d8807(0x1f5)]!==_0x2d8807(0x218)){const _0x55a7c0={};return _0x55a7c0[_0x1ed12e[_0x2d8807(0x21e)]]={[Op[_0x2d8807(0x207)]]:'%'+_0xb86bc8['query'][_0x2d8807(0x212)]+'%'},_0x55a7c0;}})}));_0x5f1563=_['merge']({},_0x5f1563,_0xb86bc8[_0xdf17b0(0x200)]);const _0x324b60={'where':_0x5f1563[_0xdf17b0(0x1f3)]};return db[_0xdf17b0(0x1ff)]['count'](_0x324b60)[_0xdf17b0(0x203)](function(_0x28f698){const _0x4b0402=_0xdf17b0;return _0x57a5d9['count']=_0x28f698,_0xb86bc8['query'][_0x4b0402(0x20d)]&&(_0x5f1563[_0x4b0402(0x213)]=[{'all':!![]}]),db['ChatQueueReport']['findAll'](_0x5f1563);})[_0xdf17b0(0x203)](function(_0x440a01){const _0x34586c=_0xdf17b0;return _0x57a5d9[_0x34586c(0x204)]=_0x440a01,_0x57a5d9;})[_0xdf17b0(0x203)](respondWithFilteredResult(_0x3a9c8b,_0x5f1563))['catch'](handleError(_0x3a9c8b,null));},exports['show']=function(_0x4a8f13,_0x2656a9){const _0x29aeb3=a122_0x5a55af;let _0x15504a={'raw':!![],'where':{'id':_0x4a8f13[_0x29aeb3(0x20e)]['id']}};const _0x1499e3={};return _0x1499e3[_0x29aeb3(0x20a)]=_[_0x29aeb3(0x214)](db[_0x29aeb3(0x1ff)][_0x29aeb3(0x20f)]),_0x1499e3[_0x29aeb3(0x20c)]=_[_0x29aeb3(0x214)](_0x4a8f13[_0x29aeb3(0x20c)]),_0x1499e3[_0x29aeb3(0x1f0)]=_[_0x29aeb3(0x201)](_0x1499e3[_0x29aeb3(0x20a)],_0x1499e3[_0x29aeb3(0x20c)]),_0x15504a[_0x29aeb3(0x1f4)]=_[_0x29aeb3(0x201)](_0x1499e3[_0x29aeb3(0x20a)],qs['fields'](_0x4a8f13['query'][_0x29aeb3(0x219)])),_0x15504a[_0x29aeb3(0x1f4)]=_0x15504a[_0x29aeb3(0x1f4)][_0x29aeb3(0x21f)]?_0x15504a[_0x29aeb3(0x1f4)]:_0x1499e3['model'],_0x4a8f13['query'][_0x29aeb3(0x20d)]&&(_0x15504a[_0x29aeb3(0x213)]=[{'all':!![]}]),_0x15504a=_[_0x29aeb3(0x1f8)]({},_0x15504a,_0x4a8f13[_0x29aeb3(0x200)]),db[_0x29aeb3(0x1ff)][_0x29aeb3(0x215)](_0x15504a)[_0x29aeb3(0x203)](handleEntityNotFound(_0x2656a9,null))[_0x29aeb3(0x203)](respondWithResult(_0x2656a9,null))['catch'](handleError(_0x2656a9,null));},exports[a122_0x5a55af(0x20b)]=function(_0x374c40,_0x38b39e){const _0x97c22d=a122_0x5a55af;return db['ChatQueueReport'][_0x97c22d(0x20b)](_0x374c40[_0x97c22d(0x1fd)],{})['then'](respondWithResult(_0x38b39e,0xc9))[_0x97c22d(0x205)](handleError(_0x38b39e,null));},exports[a122_0x5a55af(0x211)]=function(_0xa46007,_0xfb8418){const _0x1f38d3=a122_0x5a55af;return _0xa46007[_0x1f38d3(0x1fd)]['id']&&delete _0xa46007[_0x1f38d3(0x1fd)]['id'],db['ChatQueueReport']['findOne']({'where':{'id':_0xa46007[_0x1f38d3(0x20e)]['id']}})[_0x1f38d3(0x203)](handleEntityNotFound(_0xfb8418,null))['then'](saveUpdates(_0xa46007['body'],null))[_0x1f38d3(0x203)](respondWithResult(_0xfb8418,null))[_0x1f38d3(0x205)](handleError(_0xfb8418,null));},exports['destroy']=function(_0x3af87d,_0xa2696a){const _0x5d8889=a122_0x5a55af;return db[_0x5d8889(0x1ff)][_0x5d8889(0x215)]({'where':{'id':_0x3af87d[_0x5d8889(0x20e)]['id']}})[_0x5d8889(0x203)](handleEntityNotFound(_0xa2696a,null))[_0x5d8889(0x203)](removeEntity(_0xa2696a,null))['catch'](handleError(_0xa2696a,null));},exports[a122_0x5a55af(0x1ef)]=function(_0xa93a65,_0x1c8d29){const _0x58a4f9=a122_0x5a55af;return db[_0x58a4f9(0x1ff)][_0x58a4f9(0x1ef)]()[_0x58a4f9(0x203)](respondWithResult(_0x1c8d29,null))[_0x58a4f9(0x205)](handleError(_0x1c8d29,null));};
\ No newline at end of file
+const a122_0x7965=['include','count','ChatQueueReport','error','then','offset','key','undefined','json','body','includeAll','filter','filters','type','send','model','catch','pick','describe','show','query','../../components/parsers/qs','limit','sort','findOne','order','params','nolimit','fieldName','name','merge','length','findAll','intersection','fields','status','rawAttributes','options','lodash','create','keys','attributes','where','VIRTUAL','sequelize','map'];(function(_0x428fa9,_0x30aa09){const _0x7965ca=function(_0x475cea){while(--_0x475cea){_0x428fa9['push'](_0x428fa9['shift']());}};_0x7965ca(++_0x30aa09);}(a122_0x7965,0x1f3));const a122_0x475c=function(_0x428fa9,_0x30aa09){_0x428fa9=_0x428fa9-0x1c5;let _0x7965ca=a122_0x7965[_0x428fa9];return _0x7965ca;};const a122_0xd6f0e0=a122_0x475c;'use strict';const _=require(a122_0xd6f0e0(0x1f2)),qs=require(a122_0xd6f0e0(0x1e1)),logger=require('../../config/logger')('api'),{db}=require('../../mysqldb'),{Op}=require(a122_0xd6f0e0(0x1ca));function respondWithResult(_0xbb4398,_0x4cdfcd){return _0x4cdfcd=_0x4cdfcd||0xc8,function(_0x144b58){const _0x285235=a122_0x475c;if(_0x144b58)return _0xbb4398['status'](_0x4cdfcd)[_0x285235(0x1d4)](_0x144b58);};}function respondWithFilteredResult(_0x4f1998,_0x5ec890){return function(_0x171260){const _0x54d49d=a122_0x475c;if(_0x171260){const _0x211b16=_0x171260[_0x54d49d(0x1cd)],_0x5099b9=_0x5ec890[_0x54d49d(0x1d1)];let _0x54a2d1=_0x5ec890[_0x54d49d(0x1d1)]+_0x5ec890[_0x54d49d(0x1e2)],_0x595b5e;return _0x54a2d1>=_0x211b16?(_0x54a2d1=_0x211b16,_0x595b5e=0xc8):_0x595b5e=0xce,_0x4f1998[_0x54d49d(0x1ef)](_0x595b5e),_0x4f1998['set']('Content-Range',_0x5099b9+'-'+_0x54a2d1+'/'+_0x211b16)[_0x54d49d(0x1d4)](_0x171260);}return null;};}function saveUpdates(_0x5e4f9e){return function(_0x10f021){if(_0x10f021)return _0x10f021['update'](_0x5e4f9e)['then'](function(_0x430588){return _0x430588;});return null;};}function removeEntity(_0x5afc99){return function(_0x28e0b2){const _0x31774a=a122_0x475c;if(_0x28e0b2)return _0x28e0b2['destroy']()[_0x31774a(0x1d0)](function(){const _0x5dcc38=_0x31774a;_0x5afc99[_0x5dcc38(0x1ef)](0xcc)['end']();});};}function handleEntityNotFound(_0x2cdf91){return function(_0x322a83){return!_0x322a83&&_0x2cdf91['sendStatus'](0x194),_0x322a83;};}function handleError(_0x30db62,_0x21b0ac){return _0x21b0ac=_0x21b0ac||0x1f4,function(_0x5d9020){const _0x497119=a122_0x475c;logger[_0x497119(0x1cf)](_0x5d9020['stack']),_0x5d9020['name']&&delete _0x5d9020['name'],_0x30db62[_0x497119(0x1ef)](_0x21b0ac)[_0x497119(0x1da)](_0x5d9020);};}exports['index']=function(_0x36f87a,_0x5ed6d8){const _0x561230=a122_0xd6f0e0;let _0x395f50={};const _0x47ea12={},_0x57beef={'count':0x0,'rows':[]},_0x19c2e7=_[_0x561230(0x1cb)](db[_0x561230(0x1ce)][_0x561230(0x1f0)],function(_0x42c7e6){const _0x45aa94=_0x561230;return{'name':_0x42c7e6[_0x45aa94(0x1e8)],'type':_0x42c7e6[_0x45aa94(0x1d9)][_0x45aa94(0x1d2)]};});_0x47ea12[_0x561230(0x1db)]=_[_0x561230(0x1cb)](_0x19c2e7,_0x561230(0x1e9)),_0x47ea12[_0x561230(0x1e0)]=_[_0x561230(0x1c6)](_0x36f87a[_0x561230(0x1e0)]),_0x47ea12[_0x561230(0x1d8)]=_[_0x561230(0x1ed)](_0x47ea12['model'],_0x47ea12[_0x561230(0x1e0)]),_0x395f50[_0x561230(0x1c7)]=_[_0x561230(0x1ed)](_0x47ea12[_0x561230(0x1db)],qs[_0x561230(0x1ee)](_0x36f87a[_0x561230(0x1e0)]['fields'])),_0x395f50[_0x561230(0x1c7)]=_0x395f50['attributes']['length']?_0x395f50[_0x561230(0x1c7)]:_0x47ea12[_0x561230(0x1db)];typeof _0x36f87a[_0x561230(0x1e0)][_0x561230(0x1e7)]===_0x561230(0x1d3)&&(_0x395f50[_0x561230(0x1e2)]=qs[_0x561230(0x1e2)](_0x36f87a[_0x561230(0x1e0)]['limit']),_0x395f50[_0x561230(0x1d1)]=qs[_0x561230(0x1d1)](_0x36f87a[_0x561230(0x1e0)][_0x561230(0x1d1)]));_0x395f50[_0x561230(0x1e5)]=qs[_0x561230(0x1e3)](_0x36f87a['query'][_0x561230(0x1e3)]),_0x395f50[_0x561230(0x1c8)]=qs[_0x561230(0x1d8)](_[_0x561230(0x1dd)](_0x36f87a[_0x561230(0x1e0)],_0x47ea12[_0x561230(0x1d8)]),_0x19c2e7);_0x36f87a[_0x561230(0x1e0)][_0x561230(0x1d7)]&&(_0x395f50[_0x561230(0x1c8)]=_['merge'](_0x395f50[_0x561230(0x1c8)],{[Op['or']]:_['map'](_0x19c2e7,function(_0x20cf67){const _0x4b5a67=_0x561230;if(_0x20cf67[_0x4b5a67(0x1d9)]!==_0x4b5a67(0x1c9)){const _0x2b6ca9={};return _0x2b6ca9[_0x20cf67[_0x4b5a67(0x1e9)]]={[Op['like']]:'%'+_0x36f87a[_0x4b5a67(0x1e0)][_0x4b5a67(0x1d7)]+'%'},_0x2b6ca9;}})}));_0x395f50=_[_0x561230(0x1ea)]({},_0x395f50,_0x36f87a['options']);const _0x5ab4f3={'where':_0x395f50[_0x561230(0x1c8)]};return db[_0x561230(0x1ce)]['count'](_0x5ab4f3)[_0x561230(0x1d0)](function(_0x133807){const _0x322a8a=_0x561230;return _0x57beef[_0x322a8a(0x1cd)]=_0x133807,_0x36f87a[_0x322a8a(0x1e0)][_0x322a8a(0x1d6)]&&(_0x395f50['include']=[{'all':!![]}]),db[_0x322a8a(0x1ce)][_0x322a8a(0x1ec)](_0x395f50);})[_0x561230(0x1d0)](function(_0x2f3743){return _0x57beef['rows']=_0x2f3743,_0x57beef;})[_0x561230(0x1d0)](respondWithFilteredResult(_0x5ed6d8,_0x395f50))[_0x561230(0x1dc)](handleError(_0x5ed6d8,null));},exports[a122_0xd6f0e0(0x1df)]=function(_0x11e498,_0x50344b){const _0x593071=a122_0xd6f0e0;let _0x346c27={'raw':!![],'where':{'id':_0x11e498[_0x593071(0x1e6)]['id']}};const _0xf9a6f5={};return _0xf9a6f5[_0x593071(0x1db)]=_[_0x593071(0x1c6)](db[_0x593071(0x1ce)][_0x593071(0x1f0)]),_0xf9a6f5['query']=_['keys'](_0x11e498[_0x593071(0x1e0)]),_0xf9a6f5['filters']=_[_0x593071(0x1ed)](_0xf9a6f5[_0x593071(0x1db)],_0xf9a6f5[_0x593071(0x1e0)]),_0x346c27[_0x593071(0x1c7)]=_[_0x593071(0x1ed)](_0xf9a6f5[_0x593071(0x1db)],qs[_0x593071(0x1ee)](_0x11e498[_0x593071(0x1e0)]['fields'])),_0x346c27['attributes']=_0x346c27[_0x593071(0x1c7)][_0x593071(0x1eb)]?_0x346c27[_0x593071(0x1c7)]:_0xf9a6f5[_0x593071(0x1db)],_0x11e498['query'][_0x593071(0x1d6)]&&(_0x346c27[_0x593071(0x1cc)]=[{'all':!![]}]),_0x346c27=_[_0x593071(0x1ea)]({},_0x346c27,_0x11e498[_0x593071(0x1f1)]),db[_0x593071(0x1ce)][_0x593071(0x1e4)](_0x346c27)[_0x593071(0x1d0)](handleEntityNotFound(_0x50344b,null))['then'](respondWithResult(_0x50344b,null))[_0x593071(0x1dc)](handleError(_0x50344b,null));},exports['create']=function(_0x57cf92,_0x194561){const _0x3541ed=a122_0xd6f0e0;return db[_0x3541ed(0x1ce)][_0x3541ed(0x1c5)](_0x57cf92[_0x3541ed(0x1d5)],{})[_0x3541ed(0x1d0)](respondWithResult(_0x194561,0xc9))['catch'](handleError(_0x194561,null));},exports['update']=function(_0x2a5fe0,_0x2b34d0){const _0x5f5979=a122_0xd6f0e0;return _0x2a5fe0[_0x5f5979(0x1d5)]['id']&&delete _0x2a5fe0['body']['id'],db['ChatQueueReport']['findOne']({'where':{'id':_0x2a5fe0[_0x5f5979(0x1e6)]['id']}})['then'](handleEntityNotFound(_0x2b34d0,null))[_0x5f5979(0x1d0)](saveUpdates(_0x2a5fe0[_0x5f5979(0x1d5)],null))[_0x5f5979(0x1d0)](respondWithResult(_0x2b34d0,null))['catch'](handleError(_0x2b34d0,null));},exports['destroy']=function(_0x143a12,_0x33b119){const _0x2bab65=a122_0xd6f0e0;return db['ChatQueueReport'][_0x2bab65(0x1e4)]({'where':{'id':_0x143a12[_0x2bab65(0x1e6)]['id']}})[_0x2bab65(0x1d0)](handleEntityNotFound(_0x33b119,null))[_0x2bab65(0x1d0)](removeEntity(_0x33b119,null))[_0x2bab65(0x1dc)](handleError(_0x33b119,null));},exports[a122_0xd6f0e0(0x1de)]=function(_0x3c44ba,_0x2cbc32){const _0x3ee0f9=a122_0xd6f0e0;return db[_0x3ee0f9(0x1ce)][_0x3ee0f9(0x1de)]()[_0x3ee0f9(0x1d0)](respondWithResult(_0x2cbc32,null))[_0x3ee0f9(0x1dc)](handleError(_0x2cbc32,null));};
\ No newline at end of file