Built motion from commit b51cdcb3f2cb46634587ce1d55ea1b8f32dacea6. Version 3.0.0...
[motion-next.git] / server / api / voiceDialReport / voiceDialReport.controller.js
index 4ab04f3..94a1716 100644 (file)
@@ -1 +1 @@
-const a722_0x5a7f=['fieldName','attributes','sequelize','set','lodash','count','keys','model','error','../../config/logger','catch','intersection','sort','then','order','filter','send','query','filters','undefined','api','params','name','offset','VoiceDialReport','VIRTUAL','Content-Range','rawAttributes','key','destroy','create','fields','where','sendStatus','end','includeAll','status','map','options','index','include','type','stack','show','body','describe','nolimit','findOne','update','limit','merge','json'];(function(_0x121b7f,_0x5a7fd3){const _0x1c12a4=function(_0xf99e6a){while(--_0xf99e6a){_0x121b7f['push'](_0x121b7f['shift']());}};_0x1c12a4(++_0x5a7fd3);}(a722_0x5a7f,0xa3));const a722_0x1c12=function(_0x121b7f,_0x5a7fd3){_0x121b7f=_0x121b7f-0x0;let _0x1c12a4=a722_0x5a7f[_0x121b7f];return _0x1c12a4;};const _0x56004b=a722_0x1c12;'use strict';const _=require(_0x56004b('0x31')),qs=require('../../components/parsers/qs'),logger=require(_0x56004b('0x2'))(_0x56004b('0xd')),db=require('../../mysqldb')['db'],{Op}=require(_0x56004b('0x2f'));function respondWithResult(_0xf99e6a,_0x6e2256){return _0x6e2256=_0x6e2256||0xc8,function(_0x3617ee){const _0x549f0a=a722_0x1c12;if(_0x3617ee)return _0xf99e6a[_0x549f0a('0x1d')](_0x6e2256)[_0x549f0a('0x2c')](_0x3617ee);};}function respondWithFilteredResult(_0x42038b,_0x418b44){return function(_0x3cb5bf){const _0x492003=a722_0x1c12;if(_0x3cb5bf){const _0x5888ad=_0x3cb5bf[_0x492003('0x32')],_0x122795=_0x418b44[_0x492003('0x10')];let _0x1e0802=_0x418b44['offset']+_0x418b44['limit'],_0x25288c;return _0x1e0802>=_0x5888ad?(_0x1e0802=_0x5888ad,_0x25288c=0xc8):_0x25288c=0xce,_0x42038b[_0x492003('0x1d')](_0x25288c),_0x42038b[_0x492003('0x30')](_0x492003('0x13'),_0x122795+'-'+_0x1e0802+'/'+_0x5888ad)[_0x492003('0x2c')](_0x3cb5bf);}return null;};}function saveUpdates(_0x1a893a){return function(_0x47046c){const _0x505c80=a722_0x1c12;if(_0x47046c)return _0x47046c[_0x505c80('0x29')](_0x1a893a)['then'](function(_0x5243dc){return _0x5243dc;});return null;};}function removeEntity(_0x371c0c){return function(_0x3f2dc5){const _0x4dffac=a722_0x1c12;if(_0x3f2dc5)return _0x3f2dc5[_0x4dffac('0x16')]()[_0x4dffac('0x6')](function(){const _0x57f99a=_0x4dffac;_0x371c0c[_0x57f99a('0x1d')](0xcc)[_0x57f99a('0x1b')]();});};}function handleEntityNotFound(_0x5ca4cd){return function(_0x4bebdb){const _0x2958ae=a722_0x1c12;return!_0x4bebdb&&_0x5ca4cd[_0x2958ae('0x1a')](0x194),_0x4bebdb;};}function handleError(_0x14cac2,_0x49b682){return _0x49b682=_0x49b682||0x1f4,function(_0x281087){const _0x239601=a722_0x1c12;logger[_0x239601('0x1')](_0x281087[_0x239601('0x23')]),_0x281087['name']&&delete _0x281087[_0x239601('0xf')],_0x14cac2[_0x239601('0x1d')](_0x49b682)[_0x239601('0x9')](_0x281087);};}exports[_0x56004b('0x20')]=function(_0x2d5d13,_0x355ede){const _0x45d384=_0x56004b;let _0xa9eea={};const _0x502053={},_0x2a2a7f={'count':0x0,'rows':[]},_0x510392=_[_0x45d384('0x1e')](db['VoiceDialReport'][_0x45d384('0x14')],function(_0x2de403){const _0x429c98=_0x45d384;return{'name':_0x2de403[_0x429c98('0x2d')],'type':_0x2de403['type'][_0x429c98('0x15')]};});_0x502053[_0x45d384('0x0')]=_[_0x45d384('0x1e')](_0x510392,_0x45d384('0xf')),_0x502053[_0x45d384('0xa')]=_[_0x45d384('0x33')](_0x2d5d13[_0x45d384('0xa')]),_0x502053['filters']=_[_0x45d384('0x4')](_0x502053[_0x45d384('0x0')],_0x502053[_0x45d384('0xa')]),_0xa9eea[_0x45d384('0x2e')]=_[_0x45d384('0x4')](_0x502053[_0x45d384('0x0')],qs[_0x45d384('0x18')](_0x2d5d13[_0x45d384('0xa')][_0x45d384('0x18')])),_0xa9eea[_0x45d384('0x2e')]=_0xa9eea[_0x45d384('0x2e')]['length']?_0xa9eea[_0x45d384('0x2e')]:_0x502053['model'];typeof _0x2d5d13[_0x45d384('0xa')][_0x45d384('0x27')]===_0x45d384('0xc')&&(_0xa9eea[_0x45d384('0x2a')]=qs['limit'](_0x2d5d13['query'][_0x45d384('0x2a')]),_0xa9eea[_0x45d384('0x10')]=qs[_0x45d384('0x10')](_0x2d5d13[_0x45d384('0xa')][_0x45d384('0x10')]));_0xa9eea[_0x45d384('0x7')]=qs[_0x45d384('0x5')](_0x2d5d13['query']['sort']),_0xa9eea[_0x45d384('0x19')]=qs[_0x45d384('0xb')](_['pick'](_0x2d5d13[_0x45d384('0xa')],_0x502053[_0x45d384('0xb')]),_0x510392);_0x2d5d13[_0x45d384('0xa')][_0x45d384('0x8')]&&(_0xa9eea[_0x45d384('0x19')]=_[_0x45d384('0x2b')](_0xa9eea[_0x45d384('0x19')],{[Op['or']]:_[_0x45d384('0x1e')](_0x510392,function(_0x8864b7){const _0x489dbe=_0x45d384;if(_0x8864b7[_0x489dbe('0x22')]!==_0x489dbe('0x12')){const _0x3648a7={};return _0x3648a7[_0x8864b7[_0x489dbe('0xf')]]={[Op['like']]:'%'+_0x2d5d13['query'][_0x489dbe('0x8')]+'%'},_0x3648a7;}})}));_0xa9eea=_['merge']({},_0xa9eea,_0x2d5d13['options']);const _0x46f2bb={'where':_0xa9eea['where']};return db[_0x45d384('0x11')][_0x45d384('0x32')](_0x46f2bb)[_0x45d384('0x6')](function(_0x43f62d){const _0x18e91a=_0x45d384;return _0x2a2a7f[_0x18e91a('0x32')]=_0x43f62d,_0x2d5d13['query'][_0x18e91a('0x1c')]&&(_0xa9eea[_0x18e91a('0x21')]=[{'all':!![]}]),db['VoiceDialReport']['findAll'](_0xa9eea);})[_0x45d384('0x6')](function(_0x4d1e00){return _0x2a2a7f['rows']=_0x4d1e00,_0x2a2a7f;})['then'](respondWithFilteredResult(_0x355ede,_0xa9eea))['catch'](handleError(_0x355ede,null));},exports[_0x56004b('0x24')]=function(_0xf34abd,_0x37207b){const _0x668500=_0x56004b;let _0x116f94={'raw':!![],'where':{'id':_0xf34abd[_0x668500('0xe')]['id']}};const _0x49b442={};return _0x49b442[_0x668500('0x0')]=_[_0x668500('0x33')](db[_0x668500('0x11')][_0x668500('0x14')]),_0x49b442[_0x668500('0xa')]=_[_0x668500('0x33')](_0xf34abd[_0x668500('0xa')]),_0x49b442[_0x668500('0xb')]=_['intersection'](_0x49b442[_0x668500('0x0')],_0x49b442[_0x668500('0xa')]),_0x116f94[_0x668500('0x2e')]=_[_0x668500('0x4')](_0x49b442[_0x668500('0x0')],qs[_0x668500('0x18')](_0xf34abd['query']['fields'])),_0x116f94[_0x668500('0x2e')]=_0x116f94[_0x668500('0x2e')]['length']?_0x116f94[_0x668500('0x2e')]:_0x49b442[_0x668500('0x0')],_0xf34abd[_0x668500('0xa')][_0x668500('0x1c')]&&(_0x116f94[_0x668500('0x21')]=[{'all':!![]}]),_0x116f94=_['merge']({},_0x116f94,_0xf34abd[_0x668500('0x1f')]),db['VoiceDialReport'][_0x668500('0x28')](_0x116f94)[_0x668500('0x6')](handleEntityNotFound(_0x37207b,null))[_0x668500('0x6')](respondWithResult(_0x37207b,null))[_0x668500('0x3')](handleError(_0x37207b,null));},exports[_0x56004b('0x17')]=function(_0x5ce8f8,_0x144900){const _0x111b30=_0x56004b;return db[_0x111b30('0x11')][_0x111b30('0x17')](_0x5ce8f8[_0x111b30('0x25')],{})['then'](respondWithResult(_0x144900,0xc9))[_0x111b30('0x3')](handleError(_0x144900,null));},exports[_0x56004b('0x29')]=function(_0x39b47c,_0x29de70){const _0x775b5=_0x56004b;return _0x39b47c[_0x775b5('0x25')]['id']&&delete _0x39b47c['body']['id'],db[_0x775b5('0x11')][_0x775b5('0x28')]({'where':{'id':_0x39b47c['params']['id']}})[_0x775b5('0x6')](handleEntityNotFound(_0x29de70,null))[_0x775b5('0x6')](saveUpdates(_0x39b47c[_0x775b5('0x25')],null))[_0x775b5('0x6')](respondWithResult(_0x29de70,null))['catch'](handleError(_0x29de70,null));},exports[_0x56004b('0x16')]=function(_0x3c5f02,_0x2454f1){const _0xe03d32=_0x56004b;return db[_0xe03d32('0x11')]['findOne']({'where':{'id':_0x3c5f02[_0xe03d32('0xe')]['id']}})[_0xe03d32('0x6')](handleEntityNotFound(_0x2454f1,null))['then'](removeEntity(_0x2454f1,null))[_0xe03d32('0x3')](handleError(_0x2454f1,null));},exports[_0x56004b('0x26')]=function(_0x4e4e56,_0x526451){const _0x78fcd2=_0x56004b;return db[_0x78fcd2('0x11')]['describe']()[_0x78fcd2('0x6')](respondWithResult(_0x526451,null))['catch'](handleError(_0x526451,null));};
\ No newline at end of file
+const a722_0x172f=['rows','sequelize','offset','index','include','options','like','then','fields','end','findOne','query','filters','../../config/logger','where','send','length','describe','update','status','VoiceDialReport','filter','model','map','catch','keys','limit','json','body','name','lodash','merge','create','api','key','findAll','intersection','../../mysqldb','order','type','attributes','pick','error','fieldName','VIRTUAL','rawAttributes','includeAll','params','sendStatus','count','destroy','sort','../../components/parsers/qs'];(function(_0x5ce062,_0x172fde){const _0x29e31b=function(_0x154d52){while(--_0x154d52){_0x5ce062['push'](_0x5ce062['shift']());}};_0x29e31b(++_0x172fde);}(a722_0x172f,0x1a7));const a722_0x29e3=function(_0x5ce062,_0x172fde){_0x5ce062=_0x5ce062-0x0;let _0x29e31b=a722_0x172f[_0x5ce062];return _0x29e31b;};const _0x4ee95c=a722_0x29e3;'use strict';const _=require(_0x4ee95c('0x1f')),qs=require(_0x4ee95c('0x0')),logger=require(_0x4ee95c('0xe'))(_0x4ee95c('0x22')),db=require(_0x4ee95c('0x26'))['db'],{Op}=require(_0x4ee95c('0x2'));function respondWithResult(_0x154d52,_0x448c71){return _0x448c71=_0x448c71||0xc8,function(_0x53d846){const _0x15fd7a=a722_0x29e3;if(_0x53d846)return _0x154d52[_0x15fd7a('0x14')](_0x448c71)[_0x15fd7a('0x1c')](_0x53d846);};}function respondWithFilteredResult(_0x1912ab,_0x310869){return function(_0x351012){const _0x52bd3a=a722_0x29e3;if(_0x351012){const _0x1aa975=_0x351012[_0x52bd3a('0x32')],_0x27bc2e=_0x310869[_0x52bd3a('0x3')];let _0x69f882=_0x310869[_0x52bd3a('0x3')]+_0x310869[_0x52bd3a('0x1b')],_0x3676ba;return _0x69f882>=_0x1aa975?(_0x69f882=_0x1aa975,_0x3676ba=0xc8):_0x3676ba=0xce,_0x1912ab['status'](_0x3676ba),_0x1912ab['set']('Content-Range',_0x27bc2e+'-'+_0x69f882+'/'+_0x1aa975)[_0x52bd3a('0x1c')](_0x351012);}return null;};}function saveUpdates(_0x4dc065){return function(_0x58721c){const _0x2d7c5a=a722_0x29e3;if(_0x58721c)return _0x58721c[_0x2d7c5a('0x13')](_0x4dc065)[_0x2d7c5a('0x8')](function(_0x188148){return _0x188148;});return null;};}function removeEntity(_0x41e4f0){return function(_0x42fd73){const _0x35ae77=a722_0x29e3;if(_0x42fd73)return _0x42fd73[_0x35ae77('0x33')]()[_0x35ae77('0x8')](function(){const _0x5e5e79=_0x35ae77;_0x41e4f0['status'](0xcc)[_0x5e5e79('0xa')]();});};}function handleEntityNotFound(_0xa51f8){return function(_0x1e61d4){const _0x480f2d=a722_0x29e3;return!_0x1e61d4&&_0xa51f8[_0x480f2d('0x31')](0x194),_0x1e61d4;};}function handleError(_0x38d4a9,_0x4f045f){return _0x4f045f=_0x4f045f||0x1f4,function(_0x58d566){const _0x4bc567=a722_0x29e3;logger[_0x4bc567('0x2b')](_0x58d566['stack']),_0x58d566[_0x4bc567('0x1e')]&&delete _0x58d566[_0x4bc567('0x1e')],_0x38d4a9['status'](_0x4f045f)[_0x4bc567('0x10')](_0x58d566);};}exports[_0x4ee95c('0x4')]=function(_0x295c4b,_0x2bde73){const _0x475934=_0x4ee95c;let _0x57ab62={};const _0x14972c={},_0x405e52={'count':0x0,'rows':[]},_0x20d2a3=_[_0x475934('0x18')](db[_0x475934('0x15')][_0x475934('0x2e')],function(_0x375c5a){const _0x560b7e=_0x475934;return{'name':_0x375c5a[_0x560b7e('0x2c')],'type':_0x375c5a[_0x560b7e('0x28')][_0x560b7e('0x23')]};});_0x14972c[_0x475934('0x17')]=_[_0x475934('0x18')](_0x20d2a3,'name'),_0x14972c[_0x475934('0xc')]=_['keys'](_0x295c4b['query']),_0x14972c['filters']=_[_0x475934('0x25')](_0x14972c[_0x475934('0x17')],_0x14972c[_0x475934('0xc')]),_0x57ab62[_0x475934('0x29')]=_[_0x475934('0x25')](_0x14972c[_0x475934('0x17')],qs['fields'](_0x295c4b[_0x475934('0xc')]['fields'])),_0x57ab62[_0x475934('0x29')]=_0x57ab62[_0x475934('0x29')][_0x475934('0x11')]?_0x57ab62[_0x475934('0x29')]:_0x14972c[_0x475934('0x17')];typeof _0x295c4b[_0x475934('0xc')]['nolimit']==='undefined'&&(_0x57ab62[_0x475934('0x1b')]=qs[_0x475934('0x1b')](_0x295c4b[_0x475934('0xc')][_0x475934('0x1b')]),_0x57ab62[_0x475934('0x3')]=qs[_0x475934('0x3')](_0x295c4b[_0x475934('0xc')][_0x475934('0x3')]));_0x57ab62[_0x475934('0x27')]=qs[_0x475934('0x34')](_0x295c4b[_0x475934('0xc')][_0x475934('0x34')]),_0x57ab62[_0x475934('0xf')]=qs['filters'](_[_0x475934('0x2a')](_0x295c4b['query'],_0x14972c[_0x475934('0xd')]),_0x20d2a3);_0x295c4b[_0x475934('0xc')][_0x475934('0x16')]&&(_0x57ab62[_0x475934('0xf')]=_[_0x475934('0x20')](_0x57ab62[_0x475934('0xf')],{[Op['or']]:_[_0x475934('0x18')](_0x20d2a3,function(_0x229bf2){const _0x1b6fd8=_0x475934;if(_0x229bf2['type']!==_0x1b6fd8('0x2d')){const _0x2f2865={};return _0x2f2865[_0x229bf2[_0x1b6fd8('0x1e')]]={[Op[_0x1b6fd8('0x7')]]:'%'+_0x295c4b[_0x1b6fd8('0xc')][_0x1b6fd8('0x16')]+'%'},_0x2f2865;}})}));_0x57ab62=_[_0x475934('0x20')]({},_0x57ab62,_0x295c4b[_0x475934('0x6')]);const _0x58982d={'where':_0x57ab62[_0x475934('0xf')]};return db[_0x475934('0x15')]['count'](_0x58982d)[_0x475934('0x8')](function(_0x1af47c){const _0x1942fe=_0x475934;return _0x405e52[_0x1942fe('0x32')]=_0x1af47c,_0x295c4b['query']['includeAll']&&(_0x57ab62[_0x1942fe('0x5')]=[{'all':!![]}]),db['VoiceDialReport'][_0x1942fe('0x24')](_0x57ab62);})[_0x475934('0x8')](function(_0x4b91ea){const _0x3c0283=_0x475934;return _0x405e52[_0x3c0283('0x1')]=_0x4b91ea,_0x405e52;})['then'](respondWithFilteredResult(_0x2bde73,_0x57ab62))[_0x475934('0x19')](handleError(_0x2bde73,null));},exports['show']=function(_0x2dd04e,_0x1c03ce){const _0x2b8955=_0x4ee95c;let _0x37fc46={'raw':!![],'where':{'id':_0x2dd04e[_0x2b8955('0x30')]['id']}};const _0x42ed72={};return _0x42ed72[_0x2b8955('0x17')]=_['keys'](db[_0x2b8955('0x15')][_0x2b8955('0x2e')]),_0x42ed72[_0x2b8955('0xc')]=_[_0x2b8955('0x1a')](_0x2dd04e[_0x2b8955('0xc')]),_0x42ed72[_0x2b8955('0xd')]=_[_0x2b8955('0x25')](_0x42ed72[_0x2b8955('0x17')],_0x42ed72[_0x2b8955('0xc')]),_0x37fc46[_0x2b8955('0x29')]=_[_0x2b8955('0x25')](_0x42ed72['model'],qs['fields'](_0x2dd04e[_0x2b8955('0xc')][_0x2b8955('0x9')])),_0x37fc46['attributes']=_0x37fc46['attributes'][_0x2b8955('0x11')]?_0x37fc46[_0x2b8955('0x29')]:_0x42ed72[_0x2b8955('0x17')],_0x2dd04e[_0x2b8955('0xc')][_0x2b8955('0x2f')]&&(_0x37fc46['include']=[{'all':!![]}]),_0x37fc46=_['merge']({},_0x37fc46,_0x2dd04e[_0x2b8955('0x6')]),db[_0x2b8955('0x15')]['findOne'](_0x37fc46)[_0x2b8955('0x8')](handleEntityNotFound(_0x1c03ce,null))[_0x2b8955('0x8')](respondWithResult(_0x1c03ce,null))['catch'](handleError(_0x1c03ce,null));},exports[_0x4ee95c('0x21')]=function(_0x141c90,_0x50dd5c){const _0x4ee57a=_0x4ee95c;return db[_0x4ee57a('0x15')][_0x4ee57a('0x21')](_0x141c90[_0x4ee57a('0x1d')],{})['then'](respondWithResult(_0x50dd5c,0xc9))[_0x4ee57a('0x19')](handleError(_0x50dd5c,null));},exports['update']=function(_0x55980f,_0x5dc520){const _0x2c4ad1=_0x4ee95c;return _0x55980f[_0x2c4ad1('0x1d')]['id']&&delete _0x55980f['body']['id'],db[_0x2c4ad1('0x15')]['findOne']({'where':{'id':_0x55980f[_0x2c4ad1('0x30')]['id']}})[_0x2c4ad1('0x8')](handleEntityNotFound(_0x5dc520,null))[_0x2c4ad1('0x8')](saveUpdates(_0x55980f[_0x2c4ad1('0x1d')],null))['then'](respondWithResult(_0x5dc520,null))[_0x2c4ad1('0x19')](handleError(_0x5dc520,null));},exports[_0x4ee95c('0x33')]=function(_0x5ba64a,_0x262f40){const _0xbe6a75=_0x4ee95c;return db[_0xbe6a75('0x15')][_0xbe6a75('0xb')]({'where':{'id':_0x5ba64a[_0xbe6a75('0x30')]['id']}})[_0xbe6a75('0x8')](handleEntityNotFound(_0x262f40,null))[_0xbe6a75('0x8')](removeEntity(_0x262f40,null))[_0xbe6a75('0x19')](handleError(_0x262f40,null));},exports[_0x4ee95c('0x12')]=function(_0x27bb8e,_0x5ea3fd){const _0x5c615a=_0x4ee95c;return db['VoiceDialReport'][_0x5c615a('0x12')]()[_0x5c615a('0x8')](respondWithResult(_0x5ea3fd,null))[_0x5c615a('0x19')](handleError(_0x5ea3fd,null));};
\ No newline at end of file