Built motion from commit f861bcb808219e66da88ba48b61bddb35224a65e. Version 3.0.0...
[motion-next.git] / server / api / voiceAgentReport / voiceAgentReport.controller.js
index c93586a..7b85c41 100644 (file)
@@ -1 +1 @@
-'use strict';const a844_0x4148=['model','map','send','attributes','19isafoG','@mysqldb','includeAll','end','pick','length','body','Content-Range','filter','filters','undefined','6353iiANxd','rows','json','13uwDkih','195581TfrxTl','fields','38562KaGuCt','where','rawAttributes','order','include','findAll','fieldName','destroy','create','keys','@config/logger','VoiceAgentReport','22991aSrToz','@components/parsers/qs','507054FrQAEM','nolimit','update','error','offset','options','371902JbFjaJ','params','describe','815ngeBbZ','intersection','1WXmKlj','catch','1SPqplf','@utils/filter-attributes','limit','2vCjTgw','lodash','stack','status','merge','sort','set','findOne','then','408wYovlX','count','query','key'];const a844_0x5118=function(_0xde9721,_0x484be3){_0xde9721=_0xde9721-0x1ca;let _0x414833=a844_0x4148[_0xde9721];return _0x414833;};const a844_0x3ae440=a844_0x5118;(function(_0x51c271,_0xe27e8e){const _0xb6238d=a844_0x5118;while(!![]){try{const _0x22bcbc=-parseInt(_0xb6238d(0x1d5))*-parseInt(_0xb6238d(0x1ce))+parseInt(_0xb6238d(0x208))+-parseInt(_0xb6238d(0x1e9))*-parseInt(_0xb6238d(0x206))+-parseInt(_0xb6238d(0x1d8))*parseInt(_0xb6238d(0x1f4))+parseInt(_0xb6238d(0x1d1))*-parseInt(_0xb6238d(0x1e1))+parseInt(_0xb6238d(0x1f7))*-parseInt(_0xb6238d(0x1fa))+parseInt(_0xb6238d(0x1d3))*-parseInt(_0xb6238d(0x1f8));if(_0x22bcbc===_0xe27e8e)break;else _0x51c271['push'](_0x51c271['shift']());}catch(_0x12689f){_0x51c271['push'](_0x51c271['shift']());}}}(a844_0x4148,0x42d08));const _=require(a844_0x3ae440(0x1d9)),qs=require(a844_0x3ae440(0x207)),logger=require(a844_0x3ae440(0x204))('api'),{db}=require(a844_0x3ae440(0x1ea)),{filterAttributes}=require(a844_0x3ae440(0x1d6));function respondWithResult(_0xc03f0c,_0x6e8bc4){return _0x6e8bc4=_0x6e8bc4||0xc8,function(_0x1e4b96){const _0x36f20c=a844_0x5118;if(_0x1e4b96)return _0xc03f0c[_0x36f20c(0x1db)](_0x6e8bc4)[_0x36f20c(0x1f6)](_0x1e4b96);};}function respondWithFilteredResult(_0x5cc339,_0x524e4d){return function(_0x207aa6){const _0x4955cd=a844_0x5118;if(_0x207aa6){const _0x1a2ca4=_0x207aa6['count'],_0x54e837=_0x524e4d[_0x4955cd(0x1cc)];let _0x4189e2=_0x524e4d[_0x4955cd(0x1cc)]+_0x524e4d['limit'],_0x28e73c;return _0x4189e2>=_0x1a2ca4?(_0x4189e2=_0x1a2ca4,_0x28e73c=0xc8):_0x28e73c=0xce,_0x5cc339[_0x4955cd(0x1db)](_0x28e73c),_0x5cc339[_0x4955cd(0x1de)](_0x4955cd(0x1f0),_0x54e837+'-'+_0x4189e2+'/'+_0x1a2ca4)[_0x4955cd(0x1f6)](_0x207aa6);}return null;};}function saveUpdates(_0x57b8){return function(_0x42672b){const _0x1659b9=a844_0x5118;if(_0x42672b)return _0x42672b['update'](_0x57b8)[_0x1659b9(0x1e0)](function(_0x990b4){return _0x990b4;});return null;};}function removeEntity(_0x438630){return function(_0x12ce62){const _0x70c8aa=a844_0x5118;if(_0x12ce62)return _0x12ce62['destroy']()[_0x70c8aa(0x1e0)](function(){const _0x2e87a7=_0x70c8aa;_0x438630[_0x2e87a7(0x1db)](0xcc)[_0x2e87a7(0x1ec)]();});};}function handleEntityNotFound(_0x63b8af){return function(_0x4f9905){return!_0x4f9905&&_0x63b8af['sendStatus'](0x194),_0x4f9905;};}function handleError(_0x50edc2,_0x913d48){return _0x913d48=_0x913d48||0x1f4,function(_0xd7b923){const _0x503ec7=a844_0x5118;logger[_0x503ec7(0x1cb)](_0xd7b923[_0x503ec7(0x1da)]),_0xd7b923['name']&&delete _0xd7b923['name'],_0x50edc2['status'](_0x913d48)[_0x503ec7(0x1e7)](_0xd7b923);};}exports['index']=function(_0x3d2c27,_0x42d7d5){const _0x44513f=a844_0x3ae440;let _0x3112c5={};const _0x67cc14={},_0x1fc60b={'count':0x0,'rows':[]},_0x4933ba=_[_0x44513f(0x1e6)](db[_0x44513f(0x205)][_0x44513f(0x1fc)],function(_0x13704e){const _0x186c31=_0x44513f;return{'name':_0x13704e[_0x186c31(0x200)],'type':_0x13704e['type'][_0x186c31(0x1e4)]};});_0x67cc14[_0x44513f(0x1e5)]=_[_0x44513f(0x1e6)](_0x4933ba,'name'),_0x67cc14['query']=_[_0x44513f(0x203)](_0x3d2c27[_0x44513f(0x1e3)]),_0x67cc14[_0x44513f(0x1f2)]=_[_0x44513f(0x1d2)](_0x67cc14[_0x44513f(0x1e5)],_0x67cc14[_0x44513f(0x1e3)]),_0x3112c5[_0x44513f(0x1e8)]=_[_0x44513f(0x1d2)](_0x67cc14[_0x44513f(0x1e5)],qs[_0x44513f(0x1f9)](_0x3d2c27['query'][_0x44513f(0x1f9)])),_0x3112c5[_0x44513f(0x1e8)]=_0x3112c5['attributes']['length']?_0x3112c5['attributes']:_0x67cc14[_0x44513f(0x1e5)];typeof _0x3d2c27[_0x44513f(0x1e3)][_0x44513f(0x209)]===_0x44513f(0x1f3)&&(_0x3112c5[_0x44513f(0x1d7)]=qs['limit'](_0x3d2c27[_0x44513f(0x1e3)]['limit']),_0x3112c5[_0x44513f(0x1cc)]=qs[_0x44513f(0x1cc)](_0x3d2c27[_0x44513f(0x1e3)][_0x44513f(0x1cc)]));_0x3112c5[_0x44513f(0x1fd)]=qs[_0x44513f(0x1dd)](_0x3d2c27[_0x44513f(0x1e3)][_0x44513f(0x1dd)]),_0x3112c5[_0x44513f(0x1fb)]=qs[_0x44513f(0x1f2)](_[_0x44513f(0x1ed)](_0x3d2c27['query'],_0x67cc14[_0x44513f(0x1f2)]),_0x4933ba),_0x3112c5=filterAttributes(_0x3112c5,_0x3d2c27[_0x44513f(0x1e3)][_0x44513f(0x1f1)],_0x4933ba,_0x3d2c27[_0x44513f(0x1cd)]);const _0x58b6b6={'where':_0x3112c5[_0x44513f(0x1fb)]};return db['VoiceAgentReport']['count'](_0x58b6b6)[_0x44513f(0x1e0)](function(_0x5e9c76){const _0x366280=_0x44513f;return _0x1fc60b[_0x366280(0x1e2)]=_0x5e9c76,_0x3d2c27[_0x366280(0x1e3)][_0x366280(0x1eb)]&&(_0x3112c5[_0x366280(0x1fe)]=[{'all':!![]}]),db[_0x366280(0x205)][_0x366280(0x1ff)](_0x3112c5);})[_0x44513f(0x1e0)](function(_0x236b9f){const _0x19f678=_0x44513f;return _0x1fc60b[_0x19f678(0x1f5)]=_0x236b9f,_0x1fc60b;})[_0x44513f(0x1e0)](respondWithFilteredResult(_0x42d7d5,_0x3112c5))[_0x44513f(0x1d4)](handleError(_0x42d7d5,null));},exports['show']=function(_0x1c240d,_0x27e2a9){const _0x249c90=a844_0x3ae440;let _0x332417={'raw':![],'where':{'id':_0x1c240d[_0x249c90(0x1cf)]['id']}};const _0x5de5bb={};return _0x5de5bb[_0x249c90(0x1e5)]=_[_0x249c90(0x203)](db['VoiceAgentReport']['rawAttributes']),_0x5de5bb[_0x249c90(0x1e3)]=_[_0x249c90(0x203)](_0x1c240d[_0x249c90(0x1e3)]),_0x5de5bb['filters']=_[_0x249c90(0x1d2)](_0x5de5bb[_0x249c90(0x1e5)],_0x5de5bb[_0x249c90(0x1e3)]),_0x332417['attributes']=_[_0x249c90(0x1d2)](_0x5de5bb['model'],qs[_0x249c90(0x1f9)](_0x1c240d['query']['fields'])),_0x332417[_0x249c90(0x1e8)]=_0x332417[_0x249c90(0x1e8)][_0x249c90(0x1ee)]?_0x332417[_0x249c90(0x1e8)]:_0x5de5bb[_0x249c90(0x1e5)],_0x1c240d['query']['includeAll']&&(_0x332417[_0x249c90(0x1fe)]=[{'all':!![]}]),_0x332417=_[_0x249c90(0x1dc)]({},_0x332417,_0x1c240d[_0x249c90(0x1cd)]),db[_0x249c90(0x205)][_0x249c90(0x1df)](_0x332417)[_0x249c90(0x1e0)](handleEntityNotFound(_0x27e2a9,null))[_0x249c90(0x1e0)](respondWithResult(_0x27e2a9,null))[_0x249c90(0x1d4)](handleError(_0x27e2a9,null));},exports['create']=function(_0x23d5c5,_0x1a5fd8){const _0x189aa9=a844_0x3ae440;return db[_0x189aa9(0x205)][_0x189aa9(0x202)](_0x23d5c5[_0x189aa9(0x1ef)],{})[_0x189aa9(0x1e0)](respondWithResult(_0x1a5fd8,0xc9))[_0x189aa9(0x1d4)](handleError(_0x1a5fd8,null));},exports[a844_0x3ae440(0x1ca)]=function(_0x1a77c6,_0x2d6c46){const _0x559d7c=a844_0x3ae440;return _0x1a77c6[_0x559d7c(0x1ef)]['id']&&delete _0x1a77c6['body']['id'],db[_0x559d7c(0x205)][_0x559d7c(0x1df)]({'where':{'id':_0x1a77c6[_0x559d7c(0x1cf)]['id']}})[_0x559d7c(0x1e0)](handleEntityNotFound(_0x2d6c46,null))[_0x559d7c(0x1e0)](saveUpdates(_0x1a77c6[_0x559d7c(0x1ef)],null))[_0x559d7c(0x1e0)](respondWithResult(_0x2d6c46,null))[_0x559d7c(0x1d4)](handleError(_0x2d6c46,null));},exports[a844_0x3ae440(0x201)]=function(_0x322be2,_0x11fcc5){const _0x253563=a844_0x3ae440;return db['VoiceAgentReport'][_0x253563(0x1df)]({'where':{'id':_0x322be2[_0x253563(0x1cf)]['id']}})['then'](handleEntityNotFound(_0x11fcc5,null))[_0x253563(0x1e0)](removeEntity(_0x11fcc5,null))[_0x253563(0x1d4)](handleError(_0x11fcc5,null));},exports[a844_0x3ae440(0x1d0)]=function(_0x590dc8,_0x490eed){const _0x821c1c=a844_0x3ae440;return db[_0x821c1c(0x205)][_0x821c1c(0x1d0)]()[_0x821c1c(0x1e0)](respondWithResult(_0x490eed,null))[_0x821c1c(0x1d4)](handleError(_0x490eed,null));};
\ No newline at end of file
+'use strict';const a848_0x1af7=['undefined','where','1AbYcKn','keys','113iryWgy','144oIAlOv','describe','filter','rows','count','options','fields','query','type','attributes','@mysqldb','lodash','147946zfNDdY','29EMdvyd','179UpNAmS','870393sDcJcj','findOne','error','body','pick','name','74fySVQm','set','rawAttributes','destroy','fieldName','length','offset','intersection','map','include','catch','end','findAll','json','create','key','VoiceAgentReport','params','sendStatus','246347XffDjN','index','model','filters','status','sort','1339AHwgpE','update','then','limit','1219fbLLtk','stack','send','8861aQBchK','show','Content-Range'];const a848_0x54f4=function(_0x46e588,_0x2a25f2){_0x46e588=_0x46e588-0xc1;let _0x1af79c=a848_0x1af7[_0x46e588];return _0x1af79c;};const a848_0x1ec521=a848_0x54f4;(function(_0x30c730,_0x4103f0){const _0x48af97=a848_0x54f4;while(!![]){try{const _0x5574fb=-parseInt(_0x48af97(0xcd))*-parseInt(_0x48af97(0xe2))+-parseInt(_0x48af97(0xf5))+parseInt(_0x48af97(0xcc))*-parseInt(_0x48af97(0xc2))+parseInt(_0x48af97(0xd9))+parseInt(_0x48af97(0xda))*-parseInt(_0x48af97(0xc5))+parseInt(_0x48af97(0xdb))*-parseInt(_0x48af97(0xfb))+parseInt(_0x48af97(0xdc))*parseInt(_0x48af97(0xca));if(_0x5574fb===_0x4103f0)break;else _0x30c730['push'](_0x30c730['shift']());}catch(_0x53fb62){_0x30c730['push'](_0x30c730['shift']());}}}(a848_0x1af7,0x2431b));const _=require(a848_0x1ec521(0xd8)),qs=require('@components/parsers/qs'),logger=require('@config/logger')('api'),{db}=require(a848_0x1ec521(0xd7)),{filterAttributes}=require('@utils/filter-attributes');function respondWithResult(_0x65fbde,_0x2470e3){return _0x2470e3=_0x2470e3||0xc8,function(_0xf6bf3){const _0x54c21e=a848_0x54f4;if(_0xf6bf3)return _0x65fbde[_0x54c21e(0xf9)](_0x2470e3)['json'](_0xf6bf3);};}function respondWithFilteredResult(_0x5f4c7f,_0x45124b){return function(_0x17d644){const _0x55f97f=a848_0x54f4;if(_0x17d644){const _0x3a04d1=_0x17d644[_0x55f97f(0xd1)],_0x420e8a=_0x45124b[_0x55f97f(0xe8)];let _0x503e10=_0x45124b[_0x55f97f(0xe8)]+_0x45124b[_0x55f97f(0xc1)],_0x2a67af;return _0x503e10>=_0x3a04d1?(_0x503e10=_0x3a04d1,_0x2a67af=0xc8):_0x2a67af=0xce,_0x5f4c7f[_0x55f97f(0xf9)](_0x2a67af),_0x5f4c7f[_0x55f97f(0xe3)](_0x55f97f(0xc7),_0x420e8a+'-'+_0x503e10+'/'+_0x3a04d1)[_0x55f97f(0xef)](_0x17d644);}return null;};}function saveUpdates(_0x56ff8e){return function(_0x2c759b){const _0x5a36fe=a848_0x54f4;if(_0x2c759b)return _0x2c759b[_0x5a36fe(0xfc)](_0x56ff8e)[_0x5a36fe(0xfd)](function(_0x1aa0a4){return _0x1aa0a4;});return null;};}function removeEntity(_0x32a25b){return function(_0x2cd1be){const _0x461d7d=a848_0x54f4;if(_0x2cd1be)return _0x2cd1be[_0x461d7d(0xe5)]()['then'](function(){const _0x2c3584=_0x461d7d;_0x32a25b[_0x2c3584(0xf9)](0xcc)[_0x2c3584(0xed)]();});};}function handleEntityNotFound(_0x384003){return function(_0x5bb215){const _0x2ffe58=a848_0x54f4;return!_0x5bb215&&_0x384003[_0x2ffe58(0xf4)](0x194),_0x5bb215;};}function handleError(_0x417a5a,_0x4794fc){return _0x4794fc=_0x4794fc||0x1f4,function(_0x552143){const _0x3039ca=a848_0x54f4;logger[_0x3039ca(0xde)](_0x552143[_0x3039ca(0xc3)]),_0x552143[_0x3039ca(0xe1)]&&delete _0x552143[_0x3039ca(0xe1)],_0x417a5a['status'](_0x4794fc)[_0x3039ca(0xc4)](_0x552143);};}exports[a848_0x1ec521(0xf6)]=function(_0x351f91,_0x1c0176){const _0x38cb6f=a848_0x1ec521;let _0x56d61c={};const _0x263ba2={},_0x31f9ae={'count':0x0,'rows':[]},_0x39ef64=_[_0x38cb6f(0xea)](db['VoiceAgentReport'][_0x38cb6f(0xe4)],function(_0x43c988){const _0x392e81=_0x38cb6f;return{'name':_0x43c988[_0x392e81(0xe6)],'type':_0x43c988[_0x392e81(0xd5)][_0x392e81(0xf1)]};});_0x263ba2[_0x38cb6f(0xf7)]=_[_0x38cb6f(0xea)](_0x39ef64,_0x38cb6f(0xe1)),_0x263ba2['query']=_['keys'](_0x351f91[_0x38cb6f(0xd4)]),_0x263ba2[_0x38cb6f(0xf8)]=_[_0x38cb6f(0xe9)](_0x263ba2[_0x38cb6f(0xf7)],_0x263ba2[_0x38cb6f(0xd4)]),_0x56d61c[_0x38cb6f(0xd6)]=_[_0x38cb6f(0xe9)](_0x263ba2[_0x38cb6f(0xf7)],qs[_0x38cb6f(0xd3)](_0x351f91[_0x38cb6f(0xd4)]['fields'])),_0x56d61c[_0x38cb6f(0xd6)]=_0x56d61c[_0x38cb6f(0xd6)][_0x38cb6f(0xe7)]?_0x56d61c['attributes']:_0x263ba2[_0x38cb6f(0xf7)];typeof _0x351f91['query']['nolimit']===_0x38cb6f(0xc8)&&(_0x56d61c[_0x38cb6f(0xc1)]=qs[_0x38cb6f(0xc1)](_0x351f91[_0x38cb6f(0xd4)][_0x38cb6f(0xc1)]),_0x56d61c[_0x38cb6f(0xe8)]=qs[_0x38cb6f(0xe8)](_0x351f91[_0x38cb6f(0xd4)][_0x38cb6f(0xe8)]));_0x56d61c['order']=qs[_0x38cb6f(0xfa)](_0x351f91[_0x38cb6f(0xd4)]['sort']),_0x56d61c['where']=qs['filters'](_[_0x38cb6f(0xe0)](_0x351f91['query'],_0x263ba2[_0x38cb6f(0xf8)]),_0x39ef64),_0x56d61c=filterAttributes(_0x56d61c,_0x351f91[_0x38cb6f(0xd4)][_0x38cb6f(0xcf)],_0x39ef64,_0x351f91[_0x38cb6f(0xd2)]);const _0x110d9f={'where':_0x56d61c[_0x38cb6f(0xc9)]};return db[_0x38cb6f(0xf2)]['count'](_0x110d9f)['then'](function(_0x7986d){const _0x13115b=_0x38cb6f;return _0x31f9ae[_0x13115b(0xd1)]=_0x7986d,_0x351f91[_0x13115b(0xd4)]['includeAll']&&(_0x56d61c[_0x13115b(0xeb)]=[{'all':!![]}]),db['VoiceAgentReport'][_0x13115b(0xee)](_0x56d61c);})['then'](function(_0x27b5b0){const _0x243e9e=_0x38cb6f;return _0x31f9ae[_0x243e9e(0xd0)]=_0x27b5b0,_0x31f9ae;})[_0x38cb6f(0xfd)](respondWithFilteredResult(_0x1c0176,_0x56d61c))['catch'](handleError(_0x1c0176,null));},exports[a848_0x1ec521(0xc6)]=function(_0x10095f,_0x3d8b45){const _0x56315b=a848_0x1ec521;let _0x583342={'raw':![],'where':{'id':_0x10095f[_0x56315b(0xf3)]['id']}};const _0x5b7b76={};return _0x5b7b76[_0x56315b(0xf7)]=_[_0x56315b(0xcb)](db[_0x56315b(0xf2)][_0x56315b(0xe4)]),_0x5b7b76['query']=_[_0x56315b(0xcb)](_0x10095f['query']),_0x5b7b76['filters']=_[_0x56315b(0xe9)](_0x5b7b76[_0x56315b(0xf7)],_0x5b7b76[_0x56315b(0xd4)]),_0x583342[_0x56315b(0xd6)]=_['intersection'](_0x5b7b76[_0x56315b(0xf7)],qs[_0x56315b(0xd3)](_0x10095f['query']['fields'])),_0x583342[_0x56315b(0xd6)]=_0x583342[_0x56315b(0xd6)][_0x56315b(0xe7)]?_0x583342['attributes']:_0x5b7b76[_0x56315b(0xf7)],_0x10095f[_0x56315b(0xd4)]['includeAll']&&(_0x583342['include']=[{'all':!![]}]),_0x583342=_['merge']({},_0x583342,_0x10095f[_0x56315b(0xd2)]),db[_0x56315b(0xf2)][_0x56315b(0xdd)](_0x583342)[_0x56315b(0xfd)](handleEntityNotFound(_0x3d8b45,null))[_0x56315b(0xfd)](respondWithResult(_0x3d8b45,null))[_0x56315b(0xec)](handleError(_0x3d8b45,null));},exports[a848_0x1ec521(0xf0)]=function(_0x13a783,_0x268612){const _0x5544c2=a848_0x1ec521;return db[_0x5544c2(0xf2)][_0x5544c2(0xf0)](_0x13a783['body'],{})['then'](respondWithResult(_0x268612,0xc9))[_0x5544c2(0xec)](handleError(_0x268612,null));},exports[a848_0x1ec521(0xfc)]=function(_0xde4e8e,_0x5d6285){const _0x377838=a848_0x1ec521;return _0xde4e8e[_0x377838(0xdf)]['id']&&delete _0xde4e8e['body']['id'],db[_0x377838(0xf2)]['findOne']({'where':{'id':_0xde4e8e[_0x377838(0xf3)]['id']}})['then'](handleEntityNotFound(_0x5d6285,null))[_0x377838(0xfd)](saveUpdates(_0xde4e8e[_0x377838(0xdf)],null))[_0x377838(0xfd)](respondWithResult(_0x5d6285,null))[_0x377838(0xec)](handleError(_0x5d6285,null));},exports[a848_0x1ec521(0xe5)]=function(_0x111e67,_0x2e74c9){const _0x71ff44=a848_0x1ec521;return db[_0x71ff44(0xf2)][_0x71ff44(0xdd)]({'where':{'id':_0x111e67[_0x71ff44(0xf3)]['id']}})[_0x71ff44(0xfd)](handleEntityNotFound(_0x2e74c9,null))['then'](removeEntity(_0x2e74c9,null))[_0x71ff44(0xec)](handleError(_0x2e74c9,null));},exports[a848_0x1ec521(0xce)]=function(_0x593a25,_0xd4aa91){const _0x301ee0=a848_0x1ec521;return db[_0x301ee0(0xf2)][_0x301ee0(0xce)]()[_0x301ee0(0xfd)](respondWithResult(_0xd4aa91,null))[_0x301ee0(0xec)](handleError(_0xd4aa91,null));};
\ No newline at end of file