Built motion from commit 709aa6fb5ed03aa61bc373fcdbf622215d37d30b. Version 3.0.0...
[motion-next.git] / server / api / voiceQueuesLog / voiceQueuesLog.controller.js
1 const a767_0x2070=['VIRTUAL','../../config/logger','includeAll','rows','../../components/parsers/qs','create','length','sort','api','sequelize','status','order','send','options','error','count','fields','stack','then','destroy','body','index','query','type','sendStatus','name','filters','limit','catch','params','findAll','pick','update','model','findOne','VoiceQueuesLog','map','set','attributes','keys','fieldName','json','../../mysqldb','end','lodash','merge','undefined','filter','where','rawAttributes','like','intersection','offset','include'];(function(_0x5dd2d8,_0x20709c){const _0x2c1cf4=function(_0x505fdb){while(--_0x505fdb){_0x5dd2d8['push'](_0x5dd2d8['shift']());}};_0x2c1cf4(++_0x20709c);}(a767_0x2070,0x15e));const a767_0x2c1c=function(_0x5dd2d8,_0x20709c){_0x5dd2d8=_0x5dd2d8-0x0;let _0x2c1cf4=a767_0x2070[_0x5dd2d8];return _0x2c1cf4;};const _0x5af6bf=a767_0x2c1c;'use strict';const _=require(_0x5af6bf('0x12')),qs=require(_0x5af6bf('0x20')),logger=require(_0x5af6bf('0x1d'))(_0x5af6bf('0x24')),db=require(_0x5af6bf('0x10'))['db'],{Op}=require(_0x5af6bf('0x25'));function respondWithResult(_0x505fdb,_0x3f5594){return _0x3f5594=_0x3f5594||0xc8,function(_0x5d297d){const _0x3dc6da=a767_0x2c1c;if(_0x5d297d)return _0x505fdb[_0x3dc6da('0x26')](_0x3f5594)[_0x3dc6da('0xf')](_0x5d297d);};}function respondWithFilteredResult(_0x56f092,_0x40950c){return function(_0x16f236){const _0x5ee9dc=a767_0x2c1c;if(_0x16f236){const _0x20b7e2=_0x16f236[_0x5ee9dc('0x2b')],_0x20511f=_0x40950c['offset'];let _0x545a91=_0x40950c[_0x5ee9dc('0x1a')]+_0x40950c[_0x5ee9dc('0x1')],_0x567aac;return _0x545a91>=_0x20b7e2?(_0x545a91=_0x20b7e2,_0x567aac=0xc8):_0x567aac=0xce,_0x56f092[_0x5ee9dc('0x26')](_0x567aac),_0x56f092[_0x5ee9dc('0xb')]('Content-Range',_0x20511f+'-'+_0x545a91+'/'+_0x20b7e2)['json'](_0x16f236);}return null;};}function saveUpdates(_0x1c8328){return function(_0x17a0fc){if(_0x17a0fc)return _0x17a0fc['update'](_0x1c8328)['then'](function(_0x2de58b){return _0x2de58b;});return null;};}function removeEntity(_0x3b04da){return function(_0x5019ef){const _0x207149=a767_0x2c1c;if(_0x5019ef)return _0x5019ef[_0x207149('0x2f')]()[_0x207149('0x2e')](function(){const _0x76d443=_0x207149;_0x3b04da[_0x76d443('0x26')](0xcc)[_0x76d443('0x11')]();});};}function handleEntityNotFound(_0x39a4f4){return function(_0x514313){const _0x2a12f3=a767_0x2c1c;return!_0x514313&&_0x39a4f4[_0x2a12f3('0x34')](0x194),_0x514313;};}function handleError(_0xe9caae,_0x19ba40){return _0x19ba40=_0x19ba40||0x1f4,function(_0x4b0b25){const _0x49e529=a767_0x2c1c;logger[_0x49e529('0x2a')](_0x4b0b25[_0x49e529('0x2d')]),_0x4b0b25[_0x49e529('0x35')]&&delete _0x4b0b25[_0x49e529('0x35')],_0xe9caae[_0x49e529('0x26')](_0x19ba40)[_0x49e529('0x28')](_0x4b0b25);};}exports[_0x5af6bf('0x31')]=function(_0x3ed423,_0x310055){const _0x48cbbb=_0x5af6bf;let _0xfe9b61={};const _0x1c9619={},_0x274dc2={'count':0x0,'rows':[]},_0x1caef1=_[_0x48cbbb('0xa')](db['VoiceQueuesLog'][_0x48cbbb('0x17')],function(_0x536d68){const _0x588cc9=_0x48cbbb;return{'name':_0x536d68[_0x588cc9('0xe')],'type':_0x536d68[_0x588cc9('0x33')]['key']};});_0x1c9619[_0x48cbbb('0x7')]=_[_0x48cbbb('0xa')](_0x1caef1,_0x48cbbb('0x35')),_0x1c9619['query']=_[_0x48cbbb('0xd')](_0x3ed423[_0x48cbbb('0x32')]),_0x1c9619[_0x48cbbb('0x0')]=_[_0x48cbbb('0x19')](_0x1c9619['model'],_0x1c9619[_0x48cbbb('0x32')]),_0xfe9b61[_0x48cbbb('0xc')]=_[_0x48cbbb('0x19')](_0x1c9619['model'],qs['fields'](_0x3ed423[_0x48cbbb('0x32')]['fields'])),_0xfe9b61['attributes']=_0xfe9b61[_0x48cbbb('0xc')][_0x48cbbb('0x22')]?_0xfe9b61[_0x48cbbb('0xc')]:_0x1c9619[_0x48cbbb('0x7')];typeof _0x3ed423['query']['nolimit']===_0x48cbbb('0x14')&&(_0xfe9b61[_0x48cbbb('0x1')]=qs[_0x48cbbb('0x1')](_0x3ed423['query']['limit']),_0xfe9b61[_0x48cbbb('0x1a')]=qs[_0x48cbbb('0x1a')](_0x3ed423[_0x48cbbb('0x32')]['offset']));_0xfe9b61[_0x48cbbb('0x27')]=qs[_0x48cbbb('0x23')](_0x3ed423['query'][_0x48cbbb('0x23')]),_0xfe9b61[_0x48cbbb('0x16')]=qs[_0x48cbbb('0x0')](_[_0x48cbbb('0x5')](_0x3ed423[_0x48cbbb('0x32')],_0x1c9619[_0x48cbbb('0x0')]),_0x1caef1);_0x3ed423[_0x48cbbb('0x32')][_0x48cbbb('0x15')]&&(_0xfe9b61[_0x48cbbb('0x16')]=_[_0x48cbbb('0x13')](_0xfe9b61[_0x48cbbb('0x16')],{[Op['or']]:_[_0x48cbbb('0xa')](_0x1caef1,function(_0x4bd874){const _0x14c6fd=_0x48cbbb;if(_0x4bd874[_0x14c6fd('0x33')]!==_0x14c6fd('0x1c')){const _0x24aba9={};return _0x24aba9[_0x4bd874[_0x14c6fd('0x35')]]={[Op[_0x14c6fd('0x18')]]:'%'+_0x3ed423[_0x14c6fd('0x32')][_0x14c6fd('0x15')]+'%'},_0x24aba9;}})}));_0xfe9b61=_[_0x48cbbb('0x13')]({},_0xfe9b61,_0x3ed423[_0x48cbbb('0x29')]);const _0x33ee00={'where':_0xfe9b61[_0x48cbbb('0x16')]};return db['VoiceQueuesLog'][_0x48cbbb('0x2b')](_0x33ee00)[_0x48cbbb('0x2e')](function(_0x2d844a){const _0x3f3f59=_0x48cbbb;return _0x274dc2['count']=_0x2d844a,_0x3ed423['query'][_0x3f3f59('0x1e')]&&(_0xfe9b61[_0x3f3f59('0x1b')]=[{'all':!![]}]),db[_0x3f3f59('0x9')][_0x3f3f59('0x4')](_0xfe9b61);})[_0x48cbbb('0x2e')](function(_0x2b4250){const _0x140a9f=_0x48cbbb;return _0x274dc2[_0x140a9f('0x1f')]=_0x2b4250,_0x274dc2;})['then'](respondWithFilteredResult(_0x310055,_0xfe9b61))['catch'](handleError(_0x310055,null));},exports['show']=function(_0xb0022c,_0x274b0e){const _0x389aca=_0x5af6bf;let _0xffdc75={'raw':!![],'where':{'id':_0xb0022c[_0x389aca('0x3')]['id']}};const _0x3d6a54={};return _0x3d6a54[_0x389aca('0x7')]=_[_0x389aca('0xd')](db[_0x389aca('0x9')][_0x389aca('0x17')]),_0x3d6a54[_0x389aca('0x32')]=_['keys'](_0xb0022c[_0x389aca('0x32')]),_0x3d6a54['filters']=_[_0x389aca('0x19')](_0x3d6a54[_0x389aca('0x7')],_0x3d6a54['query']),_0xffdc75[_0x389aca('0xc')]=_['intersection'](_0x3d6a54[_0x389aca('0x7')],qs[_0x389aca('0x2c')](_0xb0022c[_0x389aca('0x32')][_0x389aca('0x2c')])),_0xffdc75[_0x389aca('0xc')]=_0xffdc75['attributes']['length']?_0xffdc75[_0x389aca('0xc')]:_0x3d6a54['model'],_0xb0022c[_0x389aca('0x32')]['includeAll']&&(_0xffdc75['include']=[{'all':!![]}]),_0xffdc75=_[_0x389aca('0x13')]({},_0xffdc75,_0xb0022c['options']),db['VoiceQueuesLog'][_0x389aca('0x8')](_0xffdc75)[_0x389aca('0x2e')](handleEntityNotFound(_0x274b0e,null))[_0x389aca('0x2e')](respondWithResult(_0x274b0e,null))[_0x389aca('0x2')](handleError(_0x274b0e,null));},exports['create']=function(_0x1e8c25,_0x343f2b){const _0x37eb99=_0x5af6bf;return db[_0x37eb99('0x9')][_0x37eb99('0x21')](_0x1e8c25[_0x37eb99('0x30')],{})[_0x37eb99('0x2e')](respondWithResult(_0x343f2b,0xc9))[_0x37eb99('0x2')](handleError(_0x343f2b,null));},exports[_0x5af6bf('0x6')]=function(_0xbb85d2,_0x2bb3b9){const _0x1c9b4d=_0x5af6bf;return _0xbb85d2[_0x1c9b4d('0x30')]['id']&&delete _0xbb85d2[_0x1c9b4d('0x30')]['id'],db[_0x1c9b4d('0x9')][_0x1c9b4d('0x8')]({'where':{'id':_0xbb85d2[_0x1c9b4d('0x3')]['id']}})[_0x1c9b4d('0x2e')](handleEntityNotFound(_0x2bb3b9,null))['then'](saveUpdates(_0xbb85d2['body'],null))[_0x1c9b4d('0x2e')](respondWithResult(_0x2bb3b9,null))[_0x1c9b4d('0x2')](handleError(_0x2bb3b9,null));},exports[_0x5af6bf('0x2f')]=function(_0x4fa0e2,_0x32d31d){const _0x5a427c=_0x5af6bf;return db['VoiceQueuesLog'][_0x5a427c('0x8')]({'where':{'id':_0x4fa0e2[_0x5a427c('0x3')]['id']}})['then'](handleEntityNotFound(_0x32d31d,null))[_0x5a427c('0x2e')](removeEntity(_0x32d31d,null))[_0x5a427c('0x2')](handleError(_0x32d31d,null));};