Built motion from commit e493b9a4954b50a8ee6d0034ba3601cd210d989d. Version 3.0.0...
[motion-next.git] / server / api / voiceDialReport / voiceDialReport.controller.js
index 199177a..54cba18 100644 (file)
@@ -1 +1 @@
-const a866_0x2ed9=['status','keys','attributes','VIRTUAL','filter','catch','api','intersection','params','pick','filters','fields','set','query','include','map','name','create','describe','nolimit','merge','sendStatus','stack','error','show','like','limit','findOne','count','destroy','index','sort','includeAll','Content-Range','where','findAll','lodash','../../config/logger','rawAttributes','update','body','send','options','json','offset','VoiceDialReport','../../mysqldb','end','then','model','fieldName','length'];(function(_0x2ef35a,_0x1254f7){const _0x2ed981=function(_0x18f9cf){while(--_0x18f9cf){_0x2ef35a['push'](_0x2ef35a['shift']());}};_0x2ed981(++_0x1254f7);}(a866_0x2ed9,0xe9));const a866_0x18f9=function(_0x2ef35a,_0x1254f7){_0x2ef35a=_0x2ef35a-0x1a8;let _0x2ed981=a866_0x2ed9[_0x2ef35a];return _0x2ed981;};const a866_0x4c2da1=a866_0x18f9;'use strict';const _=require(a866_0x4c2da1(0x1b3)),qs=require('../../components/parsers/qs'),logger=require(a866_0x4c2da1(0x1b4))(a866_0x4c2da1(0x1c9)),{db}=require(a866_0x4c2da1(0x1bd)),{Op}=require('sequelize');function respondWithResult(_0x30c0c6,_0x4a72b5){return _0x4a72b5=_0x4a72b5||0xc8,function(_0x46eecb){const _0x51b358=a866_0x18f9;if(_0x46eecb)return _0x30c0c6[_0x51b358(0x1c3)](_0x4a72b5)[_0x51b358(0x1ba)](_0x46eecb);};}function respondWithFilteredResult(_0x37bfae,_0x67a776){return function(_0x1abff6){const _0x4416d1=a866_0x18f9;if(_0x1abff6){const _0x1d5cdc=_0x1abff6[_0x4416d1(0x1ab)],_0x813c19=_0x67a776[_0x4416d1(0x1bb)];let _0x3d876b=_0x67a776[_0x4416d1(0x1bb)]+_0x67a776[_0x4416d1(0x1a9)],_0x3cf395;return _0x3d876b>=_0x1d5cdc?(_0x3d876b=_0x1d5cdc,_0x3cf395=0xc8):_0x3cf395=0xce,_0x37bfae[_0x4416d1(0x1c3)](_0x3cf395),_0x37bfae[_0x4416d1(0x1cf)](_0x4416d1(0x1b0),_0x813c19+'-'+_0x3d876b+'/'+_0x1d5cdc)[_0x4416d1(0x1ba)](_0x1abff6);}return null;};}function saveUpdates(_0x19db17){return function(_0xe9007a){const _0x4f5c1b=a866_0x18f9;if(_0xe9007a)return _0xe9007a[_0x4f5c1b(0x1b6)](_0x19db17)['then'](function(_0x5249ab){return _0x5249ab;});return null;};}function removeEntity(_0x3c4e9e){return function(_0x635e3e){const _0x3f73a2=a866_0x18f9;if(_0x635e3e)return _0x635e3e[_0x3f73a2(0x1ac)]()['then'](function(){const _0x256b4d=_0x3f73a2;_0x3c4e9e['status'](0xcc)[_0x256b4d(0x1be)]();});};}function handleEntityNotFound(_0x2b98be){return function(_0x4384d3){const _0x14a544=a866_0x18f9;return!_0x4384d3&&_0x2b98be[_0x14a544(0x1d8)](0x194),_0x4384d3;};}function handleError(_0x5179f2,_0x4264d6){return _0x4264d6=_0x4264d6||0x1f4,function(_0x29ab45){const _0x264cf2=a866_0x18f9;logger[_0x264cf2(0x1da)](_0x29ab45[_0x264cf2(0x1d9)]),_0x29ab45[_0x264cf2(0x1d3)]&&delete _0x29ab45[_0x264cf2(0x1d3)],_0x5179f2[_0x264cf2(0x1c3)](_0x4264d6)[_0x264cf2(0x1b8)](_0x29ab45);};}exports[a866_0x4c2da1(0x1ad)]=function(_0x2a4623,_0x5248c5){const _0x4ae9d8=a866_0x4c2da1;let _0x562575={};const _0x3a2ba4={},_0x2f5664={'count':0x0,'rows':[]},_0x27cb87=_[_0x4ae9d8(0x1d2)](db['VoiceDialReport'][_0x4ae9d8(0x1b5)],function(_0x166771){const _0x4156f2=_0x4ae9d8;return{'name':_0x166771[_0x4156f2(0x1c1)],'type':_0x166771['type']['key']};});_0x3a2ba4['model']=_[_0x4ae9d8(0x1d2)](_0x27cb87,'name'),_0x3a2ba4[_0x4ae9d8(0x1d0)]=_[_0x4ae9d8(0x1c4)](_0x2a4623['query']),_0x3a2ba4[_0x4ae9d8(0x1cd)]=_[_0x4ae9d8(0x1ca)](_0x3a2ba4[_0x4ae9d8(0x1c0)],_0x3a2ba4['query']),_0x562575[_0x4ae9d8(0x1c5)]=_['intersection'](_0x3a2ba4['model'],qs[_0x4ae9d8(0x1ce)](_0x2a4623[_0x4ae9d8(0x1d0)][_0x4ae9d8(0x1ce)])),_0x562575[_0x4ae9d8(0x1c5)]=_0x562575[_0x4ae9d8(0x1c5)]['length']?_0x562575[_0x4ae9d8(0x1c5)]:_0x3a2ba4[_0x4ae9d8(0x1c0)];typeof _0x2a4623['query'][_0x4ae9d8(0x1d6)]==='undefined'&&(_0x562575[_0x4ae9d8(0x1a9)]=qs['limit'](_0x2a4623['query']['limit']),_0x562575['offset']=qs[_0x4ae9d8(0x1bb)](_0x2a4623[_0x4ae9d8(0x1d0)][_0x4ae9d8(0x1bb)]));_0x562575['order']=qs['sort'](_0x2a4623[_0x4ae9d8(0x1d0)][_0x4ae9d8(0x1ae)]),_0x562575[_0x4ae9d8(0x1b1)]=qs[_0x4ae9d8(0x1cd)](_[_0x4ae9d8(0x1cc)](_0x2a4623[_0x4ae9d8(0x1d0)],_0x3a2ba4[_0x4ae9d8(0x1cd)]),_0x27cb87);_0x2a4623[_0x4ae9d8(0x1d0)]['filter']&&(_0x562575[_0x4ae9d8(0x1b1)]=_[_0x4ae9d8(0x1d7)](_0x562575[_0x4ae9d8(0x1b1)],{[Op['or']]:_['map'](_0x27cb87,function(_0x380a51){const _0x2fc575=_0x4ae9d8;if(_0x380a51['type']!==_0x2fc575(0x1c6)){const _0x42356d={};return _0x42356d[_0x380a51[_0x2fc575(0x1d3)]]={[Op[_0x2fc575(0x1a8)]]:'%'+_0x2a4623['query'][_0x2fc575(0x1c7)]+'%'},_0x42356d;}})}));_0x562575=_[_0x4ae9d8(0x1d7)]({},_0x562575,_0x2a4623[_0x4ae9d8(0x1b9)]);const _0x5362ea={'where':_0x562575[_0x4ae9d8(0x1b1)]};return db['VoiceDialReport'][_0x4ae9d8(0x1ab)](_0x5362ea)[_0x4ae9d8(0x1bf)](function(_0x26c0fd){const _0x57242a=_0x4ae9d8;return _0x2f5664[_0x57242a(0x1ab)]=_0x26c0fd,_0x2a4623[_0x57242a(0x1d0)][_0x57242a(0x1af)]&&(_0x562575[_0x57242a(0x1d1)]=[{'all':!![]}]),db['VoiceDialReport'][_0x57242a(0x1b2)](_0x562575);})[_0x4ae9d8(0x1bf)](function(_0x38a876){return _0x2f5664['rows']=_0x38a876,_0x2f5664;})[_0x4ae9d8(0x1bf)](respondWithFilteredResult(_0x5248c5,_0x562575))[_0x4ae9d8(0x1c8)](handleError(_0x5248c5,null));},exports[a866_0x4c2da1(0x1db)]=function(_0xf1977a,_0x2b9d4b){const _0x403e0c=a866_0x4c2da1;let _0xb1d644={'raw':!![],'where':{'id':_0xf1977a[_0x403e0c(0x1cb)]['id']}};const _0x14ee53={};return _0x14ee53[_0x403e0c(0x1c0)]=_[_0x403e0c(0x1c4)](db[_0x403e0c(0x1bc)][_0x403e0c(0x1b5)]),_0x14ee53[_0x403e0c(0x1d0)]=_[_0x403e0c(0x1c4)](_0xf1977a[_0x403e0c(0x1d0)]),_0x14ee53[_0x403e0c(0x1cd)]=_[_0x403e0c(0x1ca)](_0x14ee53['model'],_0x14ee53[_0x403e0c(0x1d0)]),_0xb1d644[_0x403e0c(0x1c5)]=_['intersection'](_0x14ee53['model'],qs['fields'](_0xf1977a[_0x403e0c(0x1d0)][_0x403e0c(0x1ce)])),_0xb1d644[_0x403e0c(0x1c5)]=_0xb1d644[_0x403e0c(0x1c5)][_0x403e0c(0x1c2)]?_0xb1d644[_0x403e0c(0x1c5)]:_0x14ee53['model'],_0xf1977a[_0x403e0c(0x1d0)][_0x403e0c(0x1af)]&&(_0xb1d644['include']=[{'all':!![]}]),_0xb1d644=_[_0x403e0c(0x1d7)]({},_0xb1d644,_0xf1977a[_0x403e0c(0x1b9)]),db[_0x403e0c(0x1bc)]['findOne'](_0xb1d644)[_0x403e0c(0x1bf)](handleEntityNotFound(_0x2b9d4b,null))[_0x403e0c(0x1bf)](respondWithResult(_0x2b9d4b,null))[_0x403e0c(0x1c8)](handleError(_0x2b9d4b,null));},exports[a866_0x4c2da1(0x1d4)]=function(_0x3f764d,_0x21c4b3){const _0x402a3f=a866_0x4c2da1;return db[_0x402a3f(0x1bc)][_0x402a3f(0x1d4)](_0x3f764d[_0x402a3f(0x1b7)],{})[_0x402a3f(0x1bf)](respondWithResult(_0x21c4b3,0xc9))[_0x402a3f(0x1c8)](handleError(_0x21c4b3,null));},exports['update']=function(_0x4e0543,_0xe0ee8d){const _0x36f513=a866_0x4c2da1;return _0x4e0543[_0x36f513(0x1b7)]['id']&&delete _0x4e0543[_0x36f513(0x1b7)]['id'],db[_0x36f513(0x1bc)][_0x36f513(0x1aa)]({'where':{'id':_0x4e0543[_0x36f513(0x1cb)]['id']}})[_0x36f513(0x1bf)](handleEntityNotFound(_0xe0ee8d,null))['then'](saveUpdates(_0x4e0543[_0x36f513(0x1b7)],null))['then'](respondWithResult(_0xe0ee8d,null))['catch'](handleError(_0xe0ee8d,null));},exports[a866_0x4c2da1(0x1ac)]=function(_0x73462f,_0x43efff){const _0x3cbf41=a866_0x4c2da1;return db[_0x3cbf41(0x1bc)][_0x3cbf41(0x1aa)]({'where':{'id':_0x73462f['params']['id']}})[_0x3cbf41(0x1bf)](handleEntityNotFound(_0x43efff,null))[_0x3cbf41(0x1bf)](removeEntity(_0x43efff,null))[_0x3cbf41(0x1c8)](handleError(_0x43efff,null));},exports[a866_0x4c2da1(0x1d5)]=function(_0x5252c3,_0x21811e){const _0x624667=a866_0x4c2da1;return db['VoiceDialReport'][_0x624667(0x1d5)]()['then'](respondWithResult(_0x21811e,null))[_0x624667(0x1c8)](handleError(_0x21811e,null));};
\ No newline at end of file
+'use strict';const a866_0x1dc7=['key','destroy','943066yHmfGg','1409581wqdEiH','show','limit','rows','rawAttributes','nolimit','fieldName','api','@config/logger','1441bQtzRL','sendStatus','251dXrLZY','name','where','query','count','index','keys','create','send','error','Content-Range','includeAll','offset','map','pick','params','1690964IdSzln','VoiceDialReport','then','filter','@utils/filter-attributes','6094RSpfAA','stack','@components/parsers/qs','type','options','model','length','sort','catch','642638vBvlaJ','findAll','@mysqldb','fields','filters','include','849zVygdL','intersection','14nZoJlL','1wttvEh','status','update','json','attributes','merge','findOne','357456qacHEi','1Qytvfq','body'];const a866_0x4c17=function(_0x3ea25b,_0xaa6f0c){_0x3ea25b=_0x3ea25b-0x1c4;let _0x1dc7c6=a866_0x1dc7[_0x3ea25b];return _0x1dc7c6;};const a866_0x2f275c=a866_0x4c17;(function(_0x43b359,_0x73e8e8){const _0xf95116=a866_0x4c17;while(!![]){try{const _0x1aef61=parseInt(_0xf95116(0x1cb))+-parseInt(_0xf95116(0x1ea))*parseInt(_0xf95116(0x1d9))+-parseInt(_0xf95116(0x1df))*parseInt(_0xf95116(0x1f8))+parseInt(_0xf95116(0x1e2))*-parseInt(_0xf95116(0x1ee))+parseInt(_0xf95116(0x1d0))*-parseInt(_0xf95116(0x1fa))+-parseInt(_0xf95116(0x1ef))+-parseInt(_0xf95116(0x1e9))*-parseInt(_0xf95116(0x1e1));if(_0x1aef61===_0x73e8e8)break;else _0x43b359['push'](_0x43b359['shift']());}catch(_0x57622e){_0x43b359['push'](_0x43b359['shift']());}}}(a866_0x1dc7,0xe7374));const _=require('lodash'),qs=require(a866_0x2f275c(0x1d2)),logger=require(a866_0x2f275c(0x1f7))(a866_0x2f275c(0x1f6)),{db}=require(a866_0x2f275c(0x1db)),{filterAttributes}=require(a866_0x2f275c(0x1cf));function respondWithResult(_0x3a1862,_0x54b4e){return _0x54b4e=_0x54b4e||0xc8,function(_0x383b80){const _0x2a2344=a866_0x4c17;if(_0x383b80)return _0x3a1862[_0x2a2344(0x1e3)](_0x54b4e)[_0x2a2344(0x1e5)](_0x383b80);};}function respondWithFilteredResult(_0x4d1892,_0x4fe4d5){return function(_0x429b3c){const _0x5eae3c=a866_0x4c17;if(_0x429b3c){const _0x45c23e=_0x429b3c[_0x5eae3c(0x1fe)],_0x31bcb5=_0x4fe4d5[_0x5eae3c(0x1c7)];let _0x33deff=_0x4fe4d5[_0x5eae3c(0x1c7)]+_0x4fe4d5[_0x5eae3c(0x1f1)],_0x2e844f;return _0x33deff>=_0x45c23e?(_0x33deff=_0x45c23e,_0x2e844f=0xc8):_0x2e844f=0xce,_0x4d1892['status'](_0x2e844f),_0x4d1892['set'](_0x5eae3c(0x1c5),_0x31bcb5+'-'+_0x33deff+'/'+_0x45c23e)[_0x5eae3c(0x1e5)](_0x429b3c);}return null;};}function saveUpdates(_0x205e88){return function(_0x58c867){const _0xd24dbc=a866_0x4c17;if(_0x58c867)return _0x58c867[_0xd24dbc(0x1e4)](_0x205e88)[_0xd24dbc(0x1cd)](function(_0x18b3b1){return _0x18b3b1;});return null;};}function removeEntity(_0x374f8b){return function(_0x4c0024){const _0x360376=a866_0x4c17;if(_0x4c0024)return _0x4c0024[_0x360376(0x1ed)]()['then'](function(){const _0x3ffd43=_0x360376;_0x374f8b[_0x3ffd43(0x1e3)](0xcc)['end']();});};}function handleEntityNotFound(_0x52dba9){return function(_0x586e20){const _0x5b7cc4=a866_0x4c17;return!_0x586e20&&_0x52dba9[_0x5b7cc4(0x1f9)](0x194),_0x586e20;};}function handleError(_0xe56bc0,_0x42e889){return _0x42e889=_0x42e889||0x1f4,function(_0x14ac23){const _0x10ef21=a866_0x4c17;logger[_0x10ef21(0x1c4)](_0x14ac23[_0x10ef21(0x1d1)]),_0x14ac23['name']&&delete _0x14ac23[_0x10ef21(0x1fb)],_0xe56bc0['status'](_0x42e889)[_0x10ef21(0x202)](_0x14ac23);};}exports[a866_0x2f275c(0x1ff)]=function(_0x567acc,_0x4fedbe){const _0x4a5bad=a866_0x2f275c;let _0xd17d2e={};const _0x161025={},_0x216cdc={'count':0x0,'rows':[]},_0x250f90=_[_0x4a5bad(0x1c8)](db[_0x4a5bad(0x1cc)]['rawAttributes'],function(_0x21b52c){const _0x1a017e=_0x4a5bad;return{'name':_0x21b52c[_0x1a017e(0x1f5)],'type':_0x21b52c[_0x1a017e(0x1d3)][_0x1a017e(0x1ec)]};});_0x161025[_0x4a5bad(0x1d5)]=_['map'](_0x250f90,_0x4a5bad(0x1fb)),_0x161025[_0x4a5bad(0x1fd)]=_['keys'](_0x567acc[_0x4a5bad(0x1fd)]),_0x161025[_0x4a5bad(0x1dd)]=_[_0x4a5bad(0x1e0)](_0x161025['model'],_0x161025[_0x4a5bad(0x1fd)]),_0xd17d2e[_0x4a5bad(0x1e6)]=_[_0x4a5bad(0x1e0)](_0x161025['model'],qs['fields'](_0x567acc[_0x4a5bad(0x1fd)][_0x4a5bad(0x1dc)])),_0xd17d2e['attributes']=_0xd17d2e['attributes'][_0x4a5bad(0x1d6)]?_0xd17d2e[_0x4a5bad(0x1e6)]:_0x161025[_0x4a5bad(0x1d5)];typeof _0x567acc[_0x4a5bad(0x1fd)][_0x4a5bad(0x1f4)]==='undefined'&&(_0xd17d2e[_0x4a5bad(0x1f1)]=qs[_0x4a5bad(0x1f1)](_0x567acc[_0x4a5bad(0x1fd)][_0x4a5bad(0x1f1)]),_0xd17d2e[_0x4a5bad(0x1c7)]=qs[_0x4a5bad(0x1c7)](_0x567acc['query'][_0x4a5bad(0x1c7)]));_0xd17d2e['order']=qs[_0x4a5bad(0x1d7)](_0x567acc[_0x4a5bad(0x1fd)][_0x4a5bad(0x1d7)]),_0xd17d2e[_0x4a5bad(0x1fc)]=qs[_0x4a5bad(0x1dd)](_[_0x4a5bad(0x1c9)](_0x567acc['query'],_0x161025[_0x4a5bad(0x1dd)]),_0x250f90),_0xd17d2e=filterAttributes(_0xd17d2e,_0x567acc[_0x4a5bad(0x1fd)][_0x4a5bad(0x1ce)],_0x250f90,_0x567acc['options']);const _0x5e0153={'where':_0xd17d2e['where']};return db['VoiceDialReport'][_0x4a5bad(0x1fe)](_0x5e0153)['then'](function(_0x46bf37){const _0x410543=_0x4a5bad;return _0x216cdc[_0x410543(0x1fe)]=_0x46bf37,_0x567acc[_0x410543(0x1fd)][_0x410543(0x1c6)]&&(_0xd17d2e['include']=[{'all':!![]}]),db['VoiceDialReport'][_0x410543(0x1da)](_0xd17d2e);})[_0x4a5bad(0x1cd)](function(_0xbcb19d){const _0x1cef52=_0x4a5bad;return _0x216cdc[_0x1cef52(0x1f2)]=_0xbcb19d,_0x216cdc;})['then'](respondWithFilteredResult(_0x4fedbe,_0xd17d2e))[_0x4a5bad(0x1d8)](handleError(_0x4fedbe,null));},exports[a866_0x2f275c(0x1f0)]=function(_0x304238,_0x28cd70){const _0x136fa3=a866_0x2f275c;let _0x1af689={'raw':!![],'where':{'id':_0x304238[_0x136fa3(0x1ca)]['id']}};const _0x359841={};return _0x359841['model']=_[_0x136fa3(0x200)](db['VoiceDialReport'][_0x136fa3(0x1f3)]),_0x359841[_0x136fa3(0x1fd)]=_[_0x136fa3(0x200)](_0x304238['query']),_0x359841[_0x136fa3(0x1dd)]=_['intersection'](_0x359841['model'],_0x359841[_0x136fa3(0x1fd)]),_0x1af689['attributes']=_[_0x136fa3(0x1e0)](_0x359841[_0x136fa3(0x1d5)],qs[_0x136fa3(0x1dc)](_0x304238['query'][_0x136fa3(0x1dc)])),_0x1af689['attributes']=_0x1af689['attributes'][_0x136fa3(0x1d6)]?_0x1af689[_0x136fa3(0x1e6)]:_0x359841[_0x136fa3(0x1d5)],_0x304238['query'][_0x136fa3(0x1c6)]&&(_0x1af689[_0x136fa3(0x1de)]=[{'all':!![]}]),_0x1af689=_[_0x136fa3(0x1e7)]({},_0x1af689,_0x304238[_0x136fa3(0x1d4)]),db[_0x136fa3(0x1cc)]['findOne'](_0x1af689)['then'](handleEntityNotFound(_0x28cd70,null))[_0x136fa3(0x1cd)](respondWithResult(_0x28cd70,null))[_0x136fa3(0x1d8)](handleError(_0x28cd70,null));},exports[a866_0x2f275c(0x201)]=function(_0x51440c,_0x3b606c){const _0x335031=a866_0x2f275c;return db[_0x335031(0x1cc)][_0x335031(0x201)](_0x51440c[_0x335031(0x1eb)],{})[_0x335031(0x1cd)](respondWithResult(_0x3b606c,0xc9))[_0x335031(0x1d8)](handleError(_0x3b606c,null));},exports['update']=function(_0x29108f,_0x1f1d67){const _0x4dad6f=a866_0x2f275c;return _0x29108f[_0x4dad6f(0x1eb)]['id']&&delete _0x29108f[_0x4dad6f(0x1eb)]['id'],db[_0x4dad6f(0x1cc)][_0x4dad6f(0x1e8)]({'where':{'id':_0x29108f[_0x4dad6f(0x1ca)]['id']}})[_0x4dad6f(0x1cd)](handleEntityNotFound(_0x1f1d67,null))['then'](saveUpdates(_0x29108f['body'],null))['then'](respondWithResult(_0x1f1d67,null))[_0x4dad6f(0x1d8)](handleError(_0x1f1d67,null));},exports[a866_0x2f275c(0x1ed)]=function(_0x4ba180,_0x1ab62f){const _0x4cf959=a866_0x2f275c;return db[_0x4cf959(0x1cc)]['findOne']({'where':{'id':_0x4ba180[_0x4cf959(0x1ca)]['id']}})['then'](handleEntityNotFound(_0x1ab62f,null))[_0x4cf959(0x1cd)](removeEntity(_0x1ab62f,null))['catch'](handleError(_0x1ab62f,null));},exports['describe']=function(_0x431e46,_0x587617){const _0x503c98=a866_0x2f275c;return db['VoiceDialReport']['describe']()[_0x503c98(0x1cd)](respondWithResult(_0x587617,null))['catch'](handleError(_0x587617,null));};
\ No newline at end of file