Built motion from commit ded33658aad58fc8de845a8299a9db59a88cc353. Version 3.0.0...
[motion-next.git] / server / api / voiceCallReport / voiceCallReport.controller.js
index 424064b..373ba77 100644 (file)
@@ -1 +1 @@
-const a709_0x11dd=['stack','json','query','then','rawAttributes','create','send','api','nolimit','params','name','error','show','count','status','sort','like','length','intersection','merge','../../components/parsers/qs','rows','undefined','includeAll','fullname','VoiceCallReport','sequelize','catch','body','uniqueid','update','lodash','describe','pick','keys','options','set','destroy','../../config/logger','limit','attributes','model','include','offset','where','findAll','User','map','fieldName','findOne','fields','filter','key','filters'];(function(_0xfcbdf3,_0x11dd7c){const _0x1a520c=function(_0x2edd89){while(--_0x2edd89){_0xfcbdf3['push'](_0xfcbdf3['shift']());}};_0x1a520c(++_0x11dd7c);}(a709_0x11dd,0x8f));const a709_0x1a52=function(_0xfcbdf3,_0x11dd7c){_0xfcbdf3=_0xfcbdf3-0x0;let _0x1a520c=a709_0x11dd[_0xfcbdf3];return _0x1a520c;};const _0x3f4f4e=a709_0x1a52;'use strict';const _=require(_0x3f4f4e('0x32')),qs=require(_0x3f4f4e('0x27')),logger=require(_0x3f4f4e('0x3'))(_0x3f4f4e('0x1a')),db=require('../../mysqldb')['db'],{Op}=require(_0x3f4f4e('0x2d'));function respondWithResult(_0x2edd89,_0x5e3895){return _0x5e3895=_0x5e3895||0xc8,function(_0x35a448){const _0x33ccf9=a709_0x1a52;if(_0x35a448)return _0x2edd89[_0x33ccf9('0x21')](_0x5e3895)[_0x33ccf9('0x14')](_0x35a448);};}function respondWithFilteredResult(_0x875fef,_0x43345b){return function(_0x35381c){const _0x4277f2=a709_0x1a52;if(_0x35381c){const _0xfc9b7a=_0x35381c['count'],_0x5e6f89=_0x43345b[_0x4277f2('0x8')];let _0x218a25=_0x43345b[_0x4277f2('0x8')]+_0x43345b['limit'],_0x1734a8;return _0x218a25>=_0xfc9b7a?(_0x218a25=_0xfc9b7a,_0x1734a8=0xc8):_0x1734a8=0xce,_0x875fef[_0x4277f2('0x21')](_0x1734a8),_0x875fef[_0x4277f2('0x1')]('Content-Range',_0x5e6f89+'-'+_0x218a25+'/'+_0xfc9b7a)[_0x4277f2('0x14')](_0x35381c);}return null;};}function saveUpdates(_0x412c57){return function(_0x8eca2d){const _0x5e66ce=a709_0x1a52;if(_0x8eca2d)return _0x8eca2d[_0x5e66ce('0x31')](_0x412c57)[_0x5e66ce('0x16')](function(_0x3f098c){return _0x3f098c;});return null;};}function removeEntity(_0xeeb77d){return function(_0x3068fa){if(_0x3068fa)return _0x3068fa['destroy']()['then'](function(){const _0x3d6405=a709_0x1a52;_0xeeb77d[_0x3d6405('0x21')](0xcc)['end']();});};}function handleEntityNotFound(_0x3f15ee){return function(_0x2071f0){return!_0x2071f0&&_0x3f15ee['sendStatus'](0x194),_0x2071f0;};}function handleError(_0x32e3a1,_0x4eff4f){return _0x4eff4f=_0x4eff4f||0x1f4,function(_0x3dd805){const _0x27e01e=a709_0x1a52;logger[_0x27e01e('0x1e')](_0x3dd805[_0x27e01e('0x13')]),_0x3dd805[_0x27e01e('0x1d')]&&delete _0x3dd805['name'],_0x32e3a1[_0x27e01e('0x21')](_0x4eff4f)[_0x27e01e('0x19')](_0x3dd805);};}exports['index']=function(_0x3e6602,_0x36e595){const _0x5c81cc=_0x3f4f4e;let _0x5f2383={};const _0xf8a27c={},_0x5c1b91={'count':0x0,'rows':[]},_0x1f33b2=_['map'](db[_0x5c81cc('0x2c')][_0x5c81cc('0x17')],function(_0x19d3c1){const _0x2f0a47=_0x5c81cc;return{'name':_0x19d3c1[_0x2f0a47('0xd')],'type':_0x19d3c1['type'][_0x2f0a47('0x11')]};});_0xf8a27c[_0x5c81cc('0x6')]=_[_0x5c81cc('0xc')](_0x1f33b2,_0x5c81cc('0x1d')),_0xf8a27c[_0x5c81cc('0x15')]=_['keys'](_0x3e6602[_0x5c81cc('0x15')]),_0xf8a27c[_0x5c81cc('0x12')]=_['intersection'](_0xf8a27c['model'],_0xf8a27c[_0x5c81cc('0x15')]),_0x5f2383['attributes']=_[_0x5c81cc('0x25')](_0xf8a27c[_0x5c81cc('0x6')],qs[_0x5c81cc('0xf')](_0x3e6602[_0x5c81cc('0x15')][_0x5c81cc('0xf')])),_0x5f2383[_0x5c81cc('0x5')]=_0x5f2383['attributes'][_0x5c81cc('0x24')]?_0x5f2383[_0x5c81cc('0x5')]:_0xf8a27c[_0x5c81cc('0x6')];typeof _0x3e6602[_0x5c81cc('0x15')][_0x5c81cc('0x1b')]===_0x5c81cc('0x29')&&(_0x5f2383[_0x5c81cc('0x4')]=qs['limit'](_0x3e6602['query'][_0x5c81cc('0x4')]),_0x5f2383[_0x5c81cc('0x8')]=qs[_0x5c81cc('0x8')](_0x3e6602[_0x5c81cc('0x15')][_0x5c81cc('0x8')]));_0x5f2383['order']=qs['sort'](_0x3e6602[_0x5c81cc('0x15')][_0x5c81cc('0x22')]),_0x5f2383[_0x5c81cc('0x9')]=qs[_0x5c81cc('0x12')](_[_0x5c81cc('0x34')](_0x3e6602[_0x5c81cc('0x15')],_0xf8a27c[_0x5c81cc('0x12')]),_0x1f33b2);_0x3e6602[_0x5c81cc('0x15')]['filter']&&(_0x5f2383['where']=_['merge'](_0x5f2383[_0x5c81cc('0x9')],{[Op['or']]:_[_0x5c81cc('0xc')](_0x1f33b2,function(_0x337204){const _0x20c12d=_0x5c81cc;if(_0x337204['type']!=='VIRTUAL'){const _0xdfb8cc={};return _0xdfb8cc[_0x337204[_0x20c12d('0x1d')]]={[Op[_0x20c12d('0x23')]]:'%'+_0x3e6602[_0x20c12d('0x15')][_0x20c12d('0x10')]+'%'},_0xdfb8cc;}})}));_0x5f2383=_[_0x5c81cc('0x26')]({},_0x5f2383,_0x3e6602['options']);const _0x142d44={'where':_0x5f2383[_0x5c81cc('0x9')]};return db['VoiceCallReport']['count'](_0x142d44)[_0x5c81cc('0x16')](function(_0x15c324){const _0x35deb5=_0x5c81cc;return _0x5c1b91[_0x35deb5('0x20')]=_0x15c324,_0x3e6602[_0x35deb5('0x15')][_0x35deb5('0x2a')]&&(_0x5f2383[_0x35deb5('0x7')]=[{'attributes':['id',_0x35deb5('0x1d'),_0x35deb5('0x2b'),'alias'],'model':db[_0x35deb5('0xb')],'as':_0x35deb5('0xb')}]),db[_0x35deb5('0x2c')][_0x35deb5('0xa')](_0x5f2383);})['then'](function(_0x2d3415){const _0x36e3b3=_0x5c81cc;return _0x5c1b91[_0x36e3b3('0x28')]=_0x2d3415,_0x5c1b91;})[_0x5c81cc('0x16')](respondWithFilteredResult(_0x36e595,_0x5f2383))[_0x5c81cc('0x2e')](handleError(_0x36e595,null));},exports[_0x3f4f4e('0x1f')]=function(_0x24121c,_0xf60533){const _0x5268da=_0x3f4f4e;let _0x1fbf3b={'raw':!![],'where':{'id':_0x24121c['params']['id']}};const _0x12f6f4={};return _0x12f6f4[_0x5268da('0x6')]=_['keys'](db[_0x5268da('0x2c')][_0x5268da('0x17')]),_0x12f6f4[_0x5268da('0x15')]=_[_0x5268da('0x35')](_0x24121c[_0x5268da('0x15')]),_0x12f6f4['filters']=_[_0x5268da('0x25')](_0x12f6f4[_0x5268da('0x6')],_0x12f6f4['query']),_0x1fbf3b[_0x5268da('0x5')]=_[_0x5268da('0x25')](_0x12f6f4[_0x5268da('0x6')],qs[_0x5268da('0xf')](_0x24121c['query'][_0x5268da('0xf')])),_0x1fbf3b[_0x5268da('0x5')]=_0x1fbf3b[_0x5268da('0x5')][_0x5268da('0x24')]?_0x1fbf3b[_0x5268da('0x5')]:_0x12f6f4[_0x5268da('0x6')],_0x24121c['query'][_0x5268da('0x2a')]&&(_0x1fbf3b[_0x5268da('0x7')]=[{'all':!![]}]),_0x1fbf3b=_[_0x5268da('0x26')]({},_0x1fbf3b,_0x24121c[_0x5268da('0x0')]),db['VoiceCallReport'][_0x5268da('0xe')](_0x1fbf3b)[_0x5268da('0x16')](handleEntityNotFound(_0xf60533,null))[_0x5268da('0x16')](respondWithResult(_0xf60533,null))[_0x5268da('0x2e')](handleError(_0xf60533,null));},exports[_0x3f4f4e('0x18')]=function(_0x4dd765,_0xb0ca9c){const _0x4cc54a=_0x3f4f4e;return db['VoiceCallReport'][_0x4cc54a('0x18')](_0x4dd765[_0x4cc54a('0x2f')],{})[_0x4cc54a('0x16')](respondWithResult(_0xb0ca9c,0xc9))[_0x4cc54a('0x2e')](handleError(_0xb0ca9c,null));},exports[_0x3f4f4e('0x2')]=function(_0x15c3eb,_0x575b62){const _0x446e9f=_0x3f4f4e;return db[_0x446e9f('0x2c')]['findOne']({'where':{'id':_0x15c3eb['params']['id']}})['then'](handleEntityNotFound(_0x575b62,null))[_0x446e9f('0x16')](removeEntity(_0x575b62,null))[_0x446e9f('0x2e')](handleError(_0x575b62,null));},exports[_0x3f4f4e('0x33')]=function(_0x426cc2,_0x26b0bd){const _0x1caf4f=_0x3f4f4e;return db['VoiceCallReport'][_0x1caf4f('0x33')]()[_0x1caf4f('0x16')](respondWithResult(_0x26b0bd,null))['catch'](handleError(_0x26b0bd,null));},exports[_0x3f4f4e('0x31')]=function(_0x525783,_0x91186b){const _0x4e7250=_0x3f4f4e;return _0x525783[_0x4e7250('0x2f')][_0x4e7250('0x30')]&&delete _0x525783[_0x4e7250('0x2f')][_0x4e7250('0x30')],db[_0x4e7250('0x2c')][_0x4e7250('0xe')]({'where':{'uniqueid':_0x525783[_0x4e7250('0x1c')]['id'],'UserId':{[Op['or']]:[null,_0x525783['user']['id']]}}})['then'](handleEntityNotFound(_0x91186b,null))[_0x4e7250('0x16')](saveUpdates(_0x525783[_0x4e7250('0x2f')],null))[_0x4e7250('0x16')](respondWithResult(_0x91186b,null))[_0x4e7250('0x2e')](handleError(_0x91186b,null));};
\ No newline at end of file
+const a709_0x3dc8=['create','offset','includeAll','fullname','describe','../../components/parsers/qs','params','fieldName','json','rawAttributes','error','options','then','type','query','status','../../config/logger','findOne','filter','show','update','fields','intersection','uniqueid','findAll','body','order','where','stack','user','User','merge','Content-Range','sort','length','undefined','lodash','attributes','map','catch','sendStatus','model','pick','rows','destroy','include','limit','name','set','count','api','filters','keys','VoiceCallReport'];(function(_0x355f80,_0x3dc8ba){const _0x22e38e=function(_0x5ecb7f){while(--_0x5ecb7f){_0x355f80['push'](_0x355f80['shift']());}};_0x22e38e(++_0x3dc8ba);}(a709_0x3dc8,0x141));const a709_0x22e3=function(_0x355f80,_0x3dc8ba){_0x355f80=_0x355f80-0x0;let _0x22e38e=a709_0x3dc8[_0x355f80];return _0x22e38e;};const _0x242934=a709_0x22e3;'use strict';const _=require(_0x242934('0x27')),qs=require(_0x242934('0x8')),logger=require(_0x242934('0x13'))(_0x242934('0x35')),db=require('../../mysqldb')['db'],{Op}=require('sequelize');function respondWithResult(_0x5ecb7f,_0xd17dbc){return _0xd17dbc=_0xd17dbc||0xc8,function(_0x17ca5b){const _0x161469=a709_0x22e3;if(_0x17ca5b)return _0x5ecb7f[_0x161469('0x12')](_0xd17dbc)[_0x161469('0xb')](_0x17ca5b);};}function respondWithFilteredResult(_0x260652,_0x3a1184){return function(_0x550c6a){const _0x5a5379=a709_0x22e3;if(_0x550c6a){const _0x1f7aeb=_0x550c6a['count'],_0x3044bf=_0x3a1184[_0x5a5379('0x4')];let _0x44a5c6=_0x3a1184[_0x5a5379('0x4')]+_0x3a1184[_0x5a5379('0x31')],_0x22efc2;return _0x44a5c6>=_0x1f7aeb?(_0x44a5c6=_0x1f7aeb,_0x22efc2=0xc8):_0x22efc2=0xce,_0x260652[_0x5a5379('0x12')](_0x22efc2),_0x260652[_0x5a5379('0x33')](_0x5a5379('0x23'),_0x3044bf+'-'+_0x44a5c6+'/'+_0x1f7aeb)[_0x5a5379('0xb')](_0x550c6a);}return null;};}function saveUpdates(_0x5246ea){return function(_0x3577e3){const _0x5db15d=a709_0x22e3;if(_0x3577e3)return _0x3577e3[_0x5db15d('0x17')](_0x5246ea)[_0x5db15d('0xf')](function(_0x1839e4){return _0x1839e4;});return null;};}function removeEntity(_0x238870){return function(_0x5da005){const _0x407fe7=a709_0x22e3;if(_0x5da005)return _0x5da005[_0x407fe7('0x2f')]()[_0x407fe7('0xf')](function(){const _0x543a07=_0x407fe7;_0x238870[_0x543a07('0x12')](0xcc)['end']();});};}function handleEntityNotFound(_0x123f58){return function(_0x56de3f){const _0x5b65d3=a709_0x22e3;return!_0x56de3f&&_0x123f58[_0x5b65d3('0x2b')](0x194),_0x56de3f;};}function handleError(_0x4ed74f,_0x210851){return _0x210851=_0x210851||0x1f4,function(_0x295509){const _0x5005e5=a709_0x22e3;logger[_0x5005e5('0xd')](_0x295509[_0x5005e5('0x1f')]),_0x295509['name']&&delete _0x295509[_0x5005e5('0x32')],_0x4ed74f[_0x5005e5('0x12')](_0x210851)['send'](_0x295509);};}exports['index']=function(_0x2d5eb2,_0x134713){const _0x39eed4=_0x242934;let _0x3e09f9={};const _0x30f6fa={},_0xb397ad={'count':0x0,'rows':[]},_0x391125=_[_0x39eed4('0x29')](db[_0x39eed4('0x2')]['rawAttributes'],function(_0x3f3882){const _0x26a56e=_0x39eed4;return{'name':_0x3f3882[_0x26a56e('0xa')],'type':_0x3f3882[_0x26a56e('0x10')]['key']};});_0x30f6fa[_0x39eed4('0x2c')]=_[_0x39eed4('0x29')](_0x391125,'name'),_0x30f6fa[_0x39eed4('0x11')]=_[_0x39eed4('0x1')](_0x2d5eb2['query']),_0x30f6fa['filters']=_[_0x39eed4('0x19')](_0x30f6fa[_0x39eed4('0x2c')],_0x30f6fa[_0x39eed4('0x11')]),_0x3e09f9[_0x39eed4('0x28')]=_['intersection'](_0x30f6fa['model'],qs[_0x39eed4('0x18')](_0x2d5eb2['query'][_0x39eed4('0x18')])),_0x3e09f9[_0x39eed4('0x28')]=_0x3e09f9[_0x39eed4('0x28')][_0x39eed4('0x25')]?_0x3e09f9[_0x39eed4('0x28')]:_0x30f6fa[_0x39eed4('0x2c')];typeof _0x2d5eb2[_0x39eed4('0x11')]['nolimit']===_0x39eed4('0x26')&&(_0x3e09f9[_0x39eed4('0x31')]=qs[_0x39eed4('0x31')](_0x2d5eb2['query'][_0x39eed4('0x31')]),_0x3e09f9[_0x39eed4('0x4')]=qs[_0x39eed4('0x4')](_0x2d5eb2[_0x39eed4('0x11')][_0x39eed4('0x4')]));_0x3e09f9[_0x39eed4('0x1d')]=qs[_0x39eed4('0x24')](_0x2d5eb2[_0x39eed4('0x11')][_0x39eed4('0x24')]),_0x3e09f9[_0x39eed4('0x1e')]=qs[_0x39eed4('0x0')](_[_0x39eed4('0x2d')](_0x2d5eb2[_0x39eed4('0x11')],_0x30f6fa['filters']),_0x391125);_0x2d5eb2[_0x39eed4('0x11')][_0x39eed4('0x15')]&&(_0x3e09f9[_0x39eed4('0x1e')]=_['merge'](_0x3e09f9[_0x39eed4('0x1e')],{[Op['or']]:_[_0x39eed4('0x29')](_0x391125,function(_0x836597){const _0x5a9e13=_0x39eed4;if(_0x836597[_0x5a9e13('0x10')]!=='VIRTUAL'){const _0x5563b8={};return _0x5563b8[_0x836597[_0x5a9e13('0x32')]]={[Op['like']]:'%'+_0x2d5eb2[_0x5a9e13('0x11')][_0x5a9e13('0x15')]+'%'},_0x5563b8;}})}));_0x3e09f9=_[_0x39eed4('0x22')]({},_0x3e09f9,_0x2d5eb2[_0x39eed4('0xe')]);const _0x29f979={'where':_0x3e09f9[_0x39eed4('0x1e')]};return db[_0x39eed4('0x2')]['count'](_0x29f979)[_0x39eed4('0xf')](function(_0x459027){const _0x2ff47c=_0x39eed4;return _0xb397ad[_0x2ff47c('0x34')]=_0x459027,_0x2d5eb2[_0x2ff47c('0x11')][_0x2ff47c('0x5')]&&(_0x3e09f9[_0x2ff47c('0x30')]=[{'attributes':['id',_0x2ff47c('0x32'),_0x2ff47c('0x6'),'alias'],'model':db[_0x2ff47c('0x21')],'as':_0x2ff47c('0x21')}]),db[_0x2ff47c('0x2')][_0x2ff47c('0x1b')](_0x3e09f9);})[_0x39eed4('0xf')](function(_0x4478f7){const _0x53ac69=_0x39eed4;return _0xb397ad[_0x53ac69('0x2e')]=_0x4478f7,_0xb397ad;})[_0x39eed4('0xf')](respondWithFilteredResult(_0x134713,_0x3e09f9))[_0x39eed4('0x2a')](handleError(_0x134713,null));},exports[_0x242934('0x16')]=function(_0x1d007f,_0x25f5a7){const _0x4444e2=_0x242934;let _0x987916={'raw':!![],'where':{'id':_0x1d007f['params']['id']}};const _0x114ed2={};return _0x114ed2[_0x4444e2('0x2c')]=_[_0x4444e2('0x1')](db['VoiceCallReport'][_0x4444e2('0xc')]),_0x114ed2[_0x4444e2('0x11')]=_['keys'](_0x1d007f[_0x4444e2('0x11')]),_0x114ed2[_0x4444e2('0x0')]=_[_0x4444e2('0x19')](_0x114ed2[_0x4444e2('0x2c')],_0x114ed2[_0x4444e2('0x11')]),_0x987916[_0x4444e2('0x28')]=_['intersection'](_0x114ed2['model'],qs[_0x4444e2('0x18')](_0x1d007f[_0x4444e2('0x11')]['fields'])),_0x987916[_0x4444e2('0x28')]=_0x987916[_0x4444e2('0x28')]['length']?_0x987916[_0x4444e2('0x28')]:_0x114ed2[_0x4444e2('0x2c')],_0x1d007f[_0x4444e2('0x11')][_0x4444e2('0x5')]&&(_0x987916['include']=[{'all':!![]}]),_0x987916=_[_0x4444e2('0x22')]({},_0x987916,_0x1d007f['options']),db[_0x4444e2('0x2')][_0x4444e2('0x14')](_0x987916)[_0x4444e2('0xf')](handleEntityNotFound(_0x25f5a7,null))[_0x4444e2('0xf')](respondWithResult(_0x25f5a7,null))['catch'](handleError(_0x25f5a7,null));},exports[_0x242934('0x3')]=function(_0x4aae13,_0x3211a3){const _0x20bbe8=_0x242934;return db[_0x20bbe8('0x2')]['create'](_0x4aae13[_0x20bbe8('0x1c')],{})[_0x20bbe8('0xf')](respondWithResult(_0x3211a3,0xc9))[_0x20bbe8('0x2a')](handleError(_0x3211a3,null));},exports[_0x242934('0x2f')]=function(_0x3f6374,_0x40263d){const _0x1f460e=_0x242934;return db[_0x1f460e('0x2')][_0x1f460e('0x14')]({'where':{'id':_0x3f6374[_0x1f460e('0x9')]['id']}})[_0x1f460e('0xf')](handleEntityNotFound(_0x40263d,null))[_0x1f460e('0xf')](removeEntity(_0x40263d,null))[_0x1f460e('0x2a')](handleError(_0x40263d,null));},exports['describe']=function(_0x45f965,_0x66d102){const _0x43766a=_0x242934;return db[_0x43766a('0x2')][_0x43766a('0x7')]()['then'](respondWithResult(_0x66d102,null))[_0x43766a('0x2a')](handleError(_0x66d102,null));},exports[_0x242934('0x17')]=function(_0x17dde0,_0x3fb2f5){const _0x5f4a5c=_0x242934;return _0x17dde0[_0x5f4a5c('0x1c')][_0x5f4a5c('0x1a')]&&delete _0x17dde0[_0x5f4a5c('0x1c')][_0x5f4a5c('0x1a')],db[_0x5f4a5c('0x2')]['findOne']({'where':{'uniqueid':_0x17dde0[_0x5f4a5c('0x9')]['id'],'UserId':{[Op['or']]:[null,_0x17dde0[_0x5f4a5c('0x20')]['id']]}}})[_0x5f4a5c('0xf')](handleEntityNotFound(_0x3fb2f5,null))['then'](saveUpdates(_0x17dde0[_0x5f4a5c('0x1c')],null))[_0x5f4a5c('0xf')](respondWithResult(_0x3fb2f5,null))[_0x5f4a5c('0x2a')](handleError(_0x3fb2f5,null));};
\ No newline at end of file