Built motion from commit 4a18b36e645f5fa4a517d36f9783bde259878164. Version 3.0.0...
[motion-next.git] / server / api / voiceCallReport / voiceCallReport.controller.js
index 410877b..7e2d801 100644 (file)
@@ -1 +1 @@
-const a709_0x164e=['offset','query','Content-Range','../../mysqldb','destroy','model','send','length','rows','merge','then','../../components/parsers/qs','stack','attributes','include','user','../../config/logger','User','keys','sort','filter','type','options','includeAll','rawAttributes','set','findAll','VIRTUAL','filters','body','create','show','error','name','findOne','VoiceCallReport','map','update','end','json','nolimit','uniqueid','status','like','where','limit','undefined','fields','key','pick','sendStatus','catch','fullname','params','intersection','count'];(function(_0x19f874,_0x164e72){const _0x223037=function(_0x202166){while(--_0x202166){_0x19f874['push'](_0x19f874['shift']());}};_0x223037(++_0x164e72);}(a709_0x164e,0xed));const a709_0x2230=function(_0x19f874,_0x164e72){_0x19f874=_0x19f874-0x0;let _0x223037=a709_0x164e[_0x19f874];return _0x223037;};const _0x5e05c0=a709_0x2230;'use strict';const _=require('lodash'),qs=require(_0x5e05c0('0x36')),logger=require(_0x5e05c0('0x3'))('api'),db=require(_0x5e05c0('0x2e'))['db'],{Op}=require('sequelize');function respondWithResult(_0x202166,_0x9ecdcd){return _0x9ecdcd=_0x9ecdcd||0xc8,function(_0x39b907){const _0x12e0dd=a709_0x2230;if(_0x39b907)return _0x202166[_0x12e0dd('0x1d')](_0x9ecdcd)[_0x12e0dd('0x1a')](_0x39b907);};}function respondWithFilteredResult(_0x533eb5,_0x5dc355){return function(_0x55660a){const _0x1aed38=a709_0x2230;if(_0x55660a){const _0x506fff=_0x55660a['count'],_0x470c70=_0x5dc355[_0x1aed38('0x2b')];let _0x2b110d=_0x5dc355[_0x1aed38('0x2b')]+_0x5dc355[_0x1aed38('0x20')],_0x20dcf7;return _0x2b110d>=_0x506fff?(_0x2b110d=_0x506fff,_0x20dcf7=0xc8):_0x20dcf7=0xce,_0x533eb5[_0x1aed38('0x1d')](_0x20dcf7),_0x533eb5[_0x1aed38('0xc')](_0x1aed38('0x2d'),_0x470c70+'-'+_0x2b110d+'/'+_0x506fff)[_0x1aed38('0x1a')](_0x55660a);}return null;};}function saveUpdates(_0x522218){return function(_0x4d402d){const _0x419da7=a709_0x2230;if(_0x4d402d)return _0x4d402d[_0x419da7('0x18')](_0x522218)[_0x419da7('0x35')](function(_0x255d5b){return _0x255d5b;});return null;};}function removeEntity(_0x17149f){return function(_0x31c3bd){if(_0x31c3bd)return _0x31c3bd['destroy']()['then'](function(){const _0x35df56=a709_0x2230;_0x17149f[_0x35df56('0x1d')](0xcc)[_0x35df56('0x19')]();});};}function handleEntityNotFound(_0x35924f){return function(_0x1f5d76){const _0x424486=a709_0x2230;return!_0x1f5d76&&_0x35924f[_0x424486('0x25')](0x194),_0x1f5d76;};}function handleError(_0x8193fa,_0x36d55a){return _0x36d55a=_0x36d55a||0x1f4,function(_0x5ed080){const _0x3a1314=a709_0x2230;logger[_0x3a1314('0x13')](_0x5ed080[_0x3a1314('0x37')]),_0x5ed080['name']&&delete _0x5ed080[_0x3a1314('0x14')],_0x8193fa['status'](_0x36d55a)[_0x3a1314('0x31')](_0x5ed080);};}exports['index']=function(_0x5d68e4,_0xd59613){const _0x4d9f36=_0x5e05c0;let _0x3f12f7={};const _0x311db1={},_0x3e0693={'count':0x0,'rows':[]},_0x5a93e5=_[_0x4d9f36('0x17')](db[_0x4d9f36('0x16')][_0x4d9f36('0xb')],function(_0xcfda5){const _0xe94106=_0x4d9f36;return{'name':_0xcfda5['fieldName'],'type':_0xcfda5[_0xe94106('0x8')][_0xe94106('0x23')]};});_0x311db1[_0x4d9f36('0x30')]=_[_0x4d9f36('0x17')](_0x5a93e5,'name'),_0x311db1['query']=_[_0x4d9f36('0x5')](_0x5d68e4[_0x4d9f36('0x2c')]),_0x311db1[_0x4d9f36('0xf')]=_[_0x4d9f36('0x29')](_0x311db1[_0x4d9f36('0x30')],_0x311db1[_0x4d9f36('0x2c')]),_0x3f12f7[_0x4d9f36('0x0')]=_[_0x4d9f36('0x29')](_0x311db1[_0x4d9f36('0x30')],qs[_0x4d9f36('0x22')](_0x5d68e4['query'][_0x4d9f36('0x22')])),_0x3f12f7['attributes']=_0x3f12f7['attributes'][_0x4d9f36('0x32')]?_0x3f12f7[_0x4d9f36('0x0')]:_0x311db1[_0x4d9f36('0x30')];typeof _0x5d68e4[_0x4d9f36('0x2c')][_0x4d9f36('0x1b')]===_0x4d9f36('0x21')&&(_0x3f12f7[_0x4d9f36('0x20')]=qs[_0x4d9f36('0x20')](_0x5d68e4[_0x4d9f36('0x2c')][_0x4d9f36('0x20')]),_0x3f12f7[_0x4d9f36('0x2b')]=qs[_0x4d9f36('0x2b')](_0x5d68e4[_0x4d9f36('0x2c')][_0x4d9f36('0x2b')]));_0x3f12f7['order']=qs[_0x4d9f36('0x6')](_0x5d68e4[_0x4d9f36('0x2c')][_0x4d9f36('0x6')]),_0x3f12f7[_0x4d9f36('0x1f')]=qs[_0x4d9f36('0xf')](_[_0x4d9f36('0x24')](_0x5d68e4[_0x4d9f36('0x2c')],_0x311db1['filters']),_0x5a93e5);_0x5d68e4[_0x4d9f36('0x2c')][_0x4d9f36('0x7')]&&(_0x3f12f7[_0x4d9f36('0x1f')]=_[_0x4d9f36('0x34')](_0x3f12f7[_0x4d9f36('0x1f')],{[Op['or']]:_[_0x4d9f36('0x17')](_0x5a93e5,function(_0x380b05){const _0x12d2fb=_0x4d9f36;if(_0x380b05['type']!==_0x12d2fb('0xe')){const _0x42db88={};return _0x42db88[_0x380b05[_0x12d2fb('0x14')]]={[Op[_0x12d2fb('0x1e')]]:'%'+_0x5d68e4[_0x12d2fb('0x2c')][_0x12d2fb('0x7')]+'%'},_0x42db88;}})}));_0x3f12f7=_[_0x4d9f36('0x34')]({},_0x3f12f7,_0x5d68e4[_0x4d9f36('0x9')]);const _0x245db6={'where':_0x3f12f7[_0x4d9f36('0x1f')]};return db[_0x4d9f36('0x16')][_0x4d9f36('0x2a')](_0x245db6)[_0x4d9f36('0x35')](function(_0x1a2771){const _0x5107a2=_0x4d9f36;return _0x3e0693[_0x5107a2('0x2a')]=_0x1a2771,_0x5d68e4[_0x5107a2('0x2c')][_0x5107a2('0xa')]&&(_0x3f12f7[_0x5107a2('0x1')]=[{'attributes':['id',_0x5107a2('0x14'),_0x5107a2('0x27'),'alias'],'model':db[_0x5107a2('0x4')],'as':'User'}]),db[_0x5107a2('0x16')][_0x5107a2('0xd')](_0x3f12f7);})['then'](function(_0x456e18){const _0x4caeca=_0x4d9f36;return _0x3e0693[_0x4caeca('0x33')]=_0x456e18,_0x3e0693;})[_0x4d9f36('0x35')](respondWithFilteredResult(_0xd59613,_0x3f12f7))[_0x4d9f36('0x26')](handleError(_0xd59613,null));},exports[_0x5e05c0('0x12')]=function(_0xb4760d,_0x89d567){const _0x3669ea=_0x5e05c0;let _0x22dfa6={'raw':!![],'where':{'id':_0xb4760d['params']['id']}};const _0x475ac1={};return _0x475ac1[_0x3669ea('0x30')]=_['keys'](db[_0x3669ea('0x16')][_0x3669ea('0xb')]),_0x475ac1[_0x3669ea('0x2c')]=_[_0x3669ea('0x5')](_0xb4760d[_0x3669ea('0x2c')]),_0x475ac1['filters']=_['intersection'](_0x475ac1[_0x3669ea('0x30')],_0x475ac1['query']),_0x22dfa6['attributes']=_['intersection'](_0x475ac1['model'],qs[_0x3669ea('0x22')](_0xb4760d[_0x3669ea('0x2c')][_0x3669ea('0x22')])),_0x22dfa6[_0x3669ea('0x0')]=_0x22dfa6[_0x3669ea('0x0')]['length']?_0x22dfa6[_0x3669ea('0x0')]:_0x475ac1[_0x3669ea('0x30')],_0xb4760d[_0x3669ea('0x2c')]['includeAll']&&(_0x22dfa6['include']=[{'all':!![]}]),_0x22dfa6=_[_0x3669ea('0x34')]({},_0x22dfa6,_0xb4760d[_0x3669ea('0x9')]),db[_0x3669ea('0x16')][_0x3669ea('0x15')](_0x22dfa6)[_0x3669ea('0x35')](handleEntityNotFound(_0x89d567,null))[_0x3669ea('0x35')](respondWithResult(_0x89d567,null))[_0x3669ea('0x26')](handleError(_0x89d567,null));},exports[_0x5e05c0('0x11')]=function(_0x3bee89,_0x58a288){const _0x157097=_0x5e05c0;return db[_0x157097('0x16')][_0x157097('0x11')](_0x3bee89[_0x157097('0x10')],{})[_0x157097('0x35')](respondWithResult(_0x58a288,0xc9))[_0x157097('0x26')](handleError(_0x58a288,null));},exports[_0x5e05c0('0x2f')]=function(_0x341930,_0x1e4297){const _0x443b0f=_0x5e05c0;return db['VoiceCallReport'][_0x443b0f('0x15')]({'where':{'id':_0x341930[_0x443b0f('0x28')]['id']}})[_0x443b0f('0x35')](handleEntityNotFound(_0x1e4297,null))[_0x443b0f('0x35')](removeEntity(_0x1e4297,null))[_0x443b0f('0x26')](handleError(_0x1e4297,null));},exports['describe']=function(_0x567610,_0x51d01c){const _0x4671f5=_0x5e05c0;return db[_0x4671f5('0x16')]['describe']()[_0x4671f5('0x35')](respondWithResult(_0x51d01c,null))[_0x4671f5('0x26')](handleError(_0x51d01c,null));},exports['update']=function(_0x37e8cb,_0x586201){const _0x336505=_0x5e05c0;return _0x37e8cb['body'][_0x336505('0x1c')]&&delete _0x37e8cb[_0x336505('0x10')]['uniqueid'],db[_0x336505('0x16')][_0x336505('0x15')]({'where':{'uniqueid':_0x37e8cb[_0x336505('0x28')]['id'],'UserId':{[Op['or']]:[null,_0x37e8cb[_0x336505('0x2')]['id']]}}})[_0x336505('0x35')](handleEntityNotFound(_0x586201,null))[_0x336505('0x35')](saveUpdates(_0x37e8cb[_0x336505('0x10')],null))[_0x336505('0x35')](respondWithResult(_0x586201,null))[_0x336505('0x26')](handleError(_0x586201,null));};
\ No newline at end of file
+const a709_0x3f37=['limit','includeAll','options','sort','key','status','../../config/logger','index','model','send','pick','findOne','offset','undefined','create','Content-Range','fullname','findAll','json','alias','merge','keys','VoiceCallReport','then','rawAttributes','filters','count','length','User','like','VIRTUAL','sendStatus','include','map','order','user','type','fieldName','body','params','end','where','attributes','update','catch','query','sequelize','destroy','error','rows','intersection','filter','lodash','show','fields','describe','uniqueid','nolimit','../../mysqldb','name'];(function(_0x7aebb7,_0x3f37ad){const _0x58d4b3=function(_0xa45e9d){while(--_0xa45e9d){_0x7aebb7['push'](_0x7aebb7['shift']());}};_0x58d4b3(++_0x3f37ad);}(a709_0x3f37,0x141));const a709_0x58d4=function(_0x7aebb7,_0x3f37ad){_0x7aebb7=_0x7aebb7-0x0;let _0x58d4b3=a709_0x3f37[_0x7aebb7];return _0x58d4b3;};const _0x5dd732=a709_0x58d4;'use strict';const _=require(_0x5dd732('0x1f')),qs=require('../../components/parsers/qs'),logger=require(_0x5dd732('0x2d'))('api'),db=require(_0x5dd732('0x25'))['db'],{Op}=require(_0x5dd732('0x19'));function respondWithResult(_0xa45e9d,_0x1586bd){return _0x1586bd=_0x1586bd||0xc8,function(_0x41ae4c){const _0x1d12ff=a709_0x58d4;if(_0x41ae4c)return _0xa45e9d[_0x1d12ff('0x2c')](_0x1586bd)[_0x1d12ff('0x39')](_0x41ae4c);};}function respondWithFilteredResult(_0x4634e3,_0x3b8233){return function(_0xaac5d4){const _0xc78d7c=a709_0x58d4;if(_0xaac5d4){const _0x24d323=_0xaac5d4[_0xc78d7c('0x5')],_0x238bb6=_0x3b8233[_0xc78d7c('0x33')];let _0x2e7e0e=_0x3b8233['offset']+_0x3b8233['limit'],_0x9ede38;return _0x2e7e0e>=_0x24d323?(_0x2e7e0e=_0x24d323,_0x9ede38=0xc8):_0x9ede38=0xce,_0x4634e3['status'](_0x9ede38),_0x4634e3['set'](_0xc78d7c('0x36'),_0x238bb6+'-'+_0x2e7e0e+'/'+_0x24d323)[_0xc78d7c('0x39')](_0xaac5d4);}return null;};}function saveUpdates(_0x37f400){return function(_0x259712){const _0x374e13=a709_0x58d4;if(_0x259712)return _0x259712[_0x374e13('0x16')](_0x37f400)[_0x374e13('0x2')](function(_0x49fa45){return _0x49fa45;});return null;};}function removeEntity(_0x16c665){return function(_0x4ebf1c){const _0x47e1ae=a709_0x58d4;if(_0x4ebf1c)return _0x4ebf1c[_0x47e1ae('0x1a')]()[_0x47e1ae('0x2')](function(){const _0x417b5d=_0x47e1ae;_0x16c665[_0x417b5d('0x2c')](0xcc)[_0x417b5d('0x13')]();});};}function handleEntityNotFound(_0x446835){return function(_0x46da95){const _0xeb7eb4=a709_0x58d4;return!_0x46da95&&_0x446835[_0xeb7eb4('0xa')](0x194),_0x46da95;};}function handleError(_0x200fa9,_0x483c2a){return _0x483c2a=_0x483c2a||0x1f4,function(_0x2db7be){const _0x53962c=a709_0x58d4;logger[_0x53962c('0x1b')](_0x2db7be['stack']),_0x2db7be[_0x53962c('0x26')]&&delete _0x2db7be[_0x53962c('0x26')],_0x200fa9[_0x53962c('0x2c')](_0x483c2a)[_0x53962c('0x30')](_0x2db7be);};}exports[_0x5dd732('0x2e')]=function(_0x42e2f1,_0x1f9145){const _0x54bb13=_0x5dd732;let _0x4656c9={};const _0x1ed03d={},_0x387c69={'count':0x0,'rows':[]},_0x5f354=_[_0x54bb13('0xc')](db['VoiceCallReport'][_0x54bb13('0x3')],function(_0x26175e){const _0x1c0d8c=_0x54bb13;return{'name':_0x26175e[_0x1c0d8c('0x10')],'type':_0x26175e[_0x1c0d8c('0xf')][_0x1c0d8c('0x2b')]};});_0x1ed03d[_0x54bb13('0x2f')]=_[_0x54bb13('0xc')](_0x5f354,_0x54bb13('0x26')),_0x1ed03d[_0x54bb13('0x18')]=_[_0x54bb13('0x0')](_0x42e2f1[_0x54bb13('0x18')]),_0x1ed03d['filters']=_['intersection'](_0x1ed03d['model'],_0x1ed03d[_0x54bb13('0x18')]),_0x4656c9['attributes']=_[_0x54bb13('0x1d')](_0x1ed03d[_0x54bb13('0x2f')],qs[_0x54bb13('0x21')](_0x42e2f1[_0x54bb13('0x18')][_0x54bb13('0x21')])),_0x4656c9[_0x54bb13('0x15')]=_0x4656c9[_0x54bb13('0x15')][_0x54bb13('0x6')]?_0x4656c9[_0x54bb13('0x15')]:_0x1ed03d[_0x54bb13('0x2f')];typeof _0x42e2f1[_0x54bb13('0x18')][_0x54bb13('0x24')]===_0x54bb13('0x34')&&(_0x4656c9[_0x54bb13('0x27')]=qs['limit'](_0x42e2f1[_0x54bb13('0x18')][_0x54bb13('0x27')]),_0x4656c9[_0x54bb13('0x33')]=qs[_0x54bb13('0x33')](_0x42e2f1[_0x54bb13('0x18')][_0x54bb13('0x33')]));_0x4656c9[_0x54bb13('0xd')]=qs[_0x54bb13('0x2a')](_0x42e2f1[_0x54bb13('0x18')][_0x54bb13('0x2a')]),_0x4656c9[_0x54bb13('0x14')]=qs['filters'](_[_0x54bb13('0x31')](_0x42e2f1[_0x54bb13('0x18')],_0x1ed03d[_0x54bb13('0x4')]),_0x5f354);_0x42e2f1[_0x54bb13('0x18')][_0x54bb13('0x1e')]&&(_0x4656c9[_0x54bb13('0x14')]=_['merge'](_0x4656c9[_0x54bb13('0x14')],{[Op['or']]:_[_0x54bb13('0xc')](_0x5f354,function(_0x1f738c){const _0x556686=_0x54bb13;if(_0x1f738c[_0x556686('0xf')]!==_0x556686('0x9')){const _0x46df04={};return _0x46df04[_0x1f738c[_0x556686('0x26')]]={[Op[_0x556686('0x8')]]:'%'+_0x42e2f1[_0x556686('0x18')][_0x556686('0x1e')]+'%'},_0x46df04;}})}));_0x4656c9=_['merge']({},_0x4656c9,_0x42e2f1[_0x54bb13('0x29')]);const _0x31e61a={'where':_0x4656c9['where']};return db[_0x54bb13('0x1')]['count'](_0x31e61a)[_0x54bb13('0x2')](function(_0x1fe69b){const _0x47f3d7=_0x54bb13;return _0x387c69[_0x47f3d7('0x5')]=_0x1fe69b,_0x42e2f1[_0x47f3d7('0x18')][_0x47f3d7('0x28')]&&(_0x4656c9[_0x47f3d7('0xb')]=[{'attributes':['id',_0x47f3d7('0x26'),_0x47f3d7('0x37'),_0x47f3d7('0x3a')],'model':db['User'],'as':_0x47f3d7('0x7')}]),db[_0x47f3d7('0x1')][_0x47f3d7('0x38')](_0x4656c9);})[_0x54bb13('0x2')](function(_0x4ae887){const _0x177bc2=_0x54bb13;return _0x387c69[_0x177bc2('0x1c')]=_0x4ae887,_0x387c69;})[_0x54bb13('0x2')](respondWithFilteredResult(_0x1f9145,_0x4656c9))['catch'](handleError(_0x1f9145,null));},exports[_0x5dd732('0x20')]=function(_0x4b11a0,_0x4389f0){const _0xecb50d=_0x5dd732;let _0x175949={'raw':!![],'where':{'id':_0x4b11a0['params']['id']}};const _0x3cd570={};return _0x3cd570['model']=_[_0xecb50d('0x0')](db[_0xecb50d('0x1')][_0xecb50d('0x3')]),_0x3cd570['query']=_[_0xecb50d('0x0')](_0x4b11a0[_0xecb50d('0x18')]),_0x3cd570['filters']=_[_0xecb50d('0x1d')](_0x3cd570[_0xecb50d('0x2f')],_0x3cd570[_0xecb50d('0x18')]),_0x175949[_0xecb50d('0x15')]=_[_0xecb50d('0x1d')](_0x3cd570[_0xecb50d('0x2f')],qs['fields'](_0x4b11a0[_0xecb50d('0x18')][_0xecb50d('0x21')])),_0x175949[_0xecb50d('0x15')]=_0x175949[_0xecb50d('0x15')][_0xecb50d('0x6')]?_0x175949[_0xecb50d('0x15')]:_0x3cd570['model'],_0x4b11a0[_0xecb50d('0x18')][_0xecb50d('0x28')]&&(_0x175949['include']=[{'all':!![]}]),_0x175949=_[_0xecb50d('0x3b')]({},_0x175949,_0x4b11a0['options']),db[_0xecb50d('0x1')][_0xecb50d('0x32')](_0x175949)[_0xecb50d('0x2')](handleEntityNotFound(_0x4389f0,null))['then'](respondWithResult(_0x4389f0,null))[_0xecb50d('0x17')](handleError(_0x4389f0,null));},exports[_0x5dd732('0x35')]=function(_0x288c11,_0xa37779){const _0x312a08=_0x5dd732;return db[_0x312a08('0x1')][_0x312a08('0x35')](_0x288c11[_0x312a08('0x11')],{})['then'](respondWithResult(_0xa37779,0xc9))[_0x312a08('0x17')](handleError(_0xa37779,null));},exports[_0x5dd732('0x1a')]=function(_0x40bc6a,_0x2e9bf7){const _0x343c1d=_0x5dd732;return db[_0x343c1d('0x1')][_0x343c1d('0x32')]({'where':{'id':_0x40bc6a[_0x343c1d('0x12')]['id']}})[_0x343c1d('0x2')](handleEntityNotFound(_0x2e9bf7,null))[_0x343c1d('0x2')](removeEntity(_0x2e9bf7,null))[_0x343c1d('0x17')](handleError(_0x2e9bf7,null));},exports['describe']=function(_0x26f11d,_0x2ce14f){const _0x318d11=_0x5dd732;return db[_0x318d11('0x1')][_0x318d11('0x22')]()[_0x318d11('0x2')](respondWithResult(_0x2ce14f,null))[_0x318d11('0x17')](handleError(_0x2ce14f,null));},exports['update']=function(_0x42772a,_0x4943f6){const _0x33a691=_0x5dd732;return _0x42772a[_0x33a691('0x11')][_0x33a691('0x23')]&&delete _0x42772a[_0x33a691('0x11')]['uniqueid'],db[_0x33a691('0x1')][_0x33a691('0x32')]({'where':{'uniqueid':_0x42772a[_0x33a691('0x12')]['id'],'UserId':{[Op['or']]:[null,_0x42772a[_0x33a691('0xe')]['id']]}}})[_0x33a691('0x2')](handleEntityNotFound(_0x4943f6,null))[_0x33a691('0x2')](saveUpdates(_0x42772a[_0x33a691('0x11')],null))[_0x33a691('0x2')](respondWithResult(_0x4943f6,null))['catch'](handleError(_0x4943f6,null));};
\ No newline at end of file