Built motion from commit a9fb64cc6defd8fb3a5cc199221f878e91c0e969. Version 3.0.0...
[motion-next.git] / server / api / voiceMail / voiceMail.controller.js
index 0efaaa3..13d0cb5 100644 (file)
@@ -1 +1 @@
-const a734_0xea4e=['query','VoiceMail','attributes','fieldName','json','includeAll','../../config/logger','set','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','key','Voicemails','options','catch','keys','show','order','role','like','fields','nolimit','sendStatus','Unable\x20to\x20retrieve\x20the\x20current\x20user','undefined','rawAttributes','getMessages','UserProfileSection','findOne','destroy','where','filter','../../mysqldb','type','stack','UserProfileResource','error','filters','body','end','rows','Content-Range','length','intersection','map','user','../../components/parsers/qs','VIRTUAL','create','name','count','then','model','sort','offset','update','pick','params','autoAssociation','include','limit','index','VoiceMailMessage','merge','get','status'];(function(_0x4d95bb,_0xea4e2c){const _0x5e033f=function(_0x7616d1){while(--_0x7616d1){_0x4d95bb['push'](_0x4d95bb['shift']());}};_0x5e033f(++_0xea4e2c);}(a734_0xea4e,0x92));const a734_0x5e03=function(_0x4d95bb,_0xea4e2c){_0x4d95bb=_0x4d95bb-0x0;let _0x5e033f=a734_0xea4e[_0x4d95bb];return _0x5e033f;};const _0x1b46f5=a734_0x5e03;'use strict';const _=require('lodash'),qs=require(_0x1b46f5('0x1a')),logger=require(_0x1b46f5('0x34'))('api'),db=require(_0x1b46f5('0xc'))['db'],{Op}=require('sequelize');function respondWithResult(_0x7616d1,_0x2cdf19){return _0x2cdf19=_0x2cdf19||0xc8,function(_0x1c7f16){const _0x5a9fa9=a734_0x5e03;if(_0x1c7f16)return _0x7616d1[_0x5a9fa9('0x2d')](_0x2cdf19)['json'](_0x1c7f16);};}function respondWithFilteredResult(_0x5de363,_0x20a248){return function(_0x4ccc1f){const _0x1ada95=a734_0x5e03;if(_0x4ccc1f){const _0x4a2575=_0x4ccc1f[_0x1ada95('0x1e')],_0x4973b0=_0x20a248['offset'];let _0x1c6878=_0x20a248['offset']+_0x20a248['limit'],_0x2033fe;return _0x1c6878>=_0x4a2575?(_0x1c6878=_0x4a2575,_0x2033fe=0xc8):_0x2033fe=0xce,_0x5de363[_0x1ada95('0x2d')](_0x2033fe),_0x5de363[_0x1ada95('0x35')](_0x1ada95('0x15'),_0x4973b0+'-'+_0x1c6878+'/'+_0x4a2575)[_0x1ada95('0x32')](_0x4ccc1f);}return null;};}function saveUpdates(_0x52c6da){return function(_0x2bfc6b){const _0x146ed0=a734_0x5e03;if(_0x2bfc6b)return _0x2bfc6b['update'](_0x52c6da)[_0x146ed0('0x1f')](function(_0x11753d){return _0x11753d;});return null;};}function removeEntity(_0x45fcd1){return function(_0x5c8606){const _0x34474a=a734_0x5e03;if(_0x5c8606)return _0x5c8606['destroy']()['then'](function(){const _0x34f9e6=a734_0x5e03,_0x3b0745=_0x5c8606[_0x34f9e6('0x2c')]({'plain':!![]}),_0x11e778=_0x34f9e6('0x38');return db[_0x34f9e6('0xf')][_0x34f9e6('0x9')]({'where':{'type':_0x11e778,'resourceId':_0x3b0745['id']}})[_0x34f9e6('0x1f')](function(){return _0x5c8606;});})[_0x34474a('0x1f')](function(){const _0x3cd93e=_0x34474a;_0x45fcd1[_0x3cd93e('0x2d')](0xcc)[_0x3cd93e('0x13')]();});};}function handleEntityNotFound(_0x17153b){return function(_0x33bedc){const _0x1c64e3=a734_0x5e03;return!_0x33bedc&&_0x17153b[_0x1c64e3('0x2')](0x194),_0x33bedc;};}function handleError(_0x591844,_0x3b3bce){return _0x3b3bce=_0x3b3bce||0x1f4,function(_0x1d4306){const _0x575844=a734_0x5e03;logger['error'](_0x1d4306[_0x575844('0xe')]),_0x1d4306[_0x575844('0x1d')]&&delete _0x1d4306[_0x575844('0x1d')],_0x591844[_0x575844('0x2d')](_0x3b3bce)['send'](_0x1d4306);};}exports[_0x1b46f5('0x29')]=function(_0x7131b5,_0xaec0ad){const _0x99be1f=_0x1b46f5;let _0x121c1e={};const _0x567a98={},_0x3c4d7e={'count':0x0,'rows':[]},_0x56cdf9=_[_0x99be1f('0x18')](db[_0x99be1f('0x2f')][_0x99be1f('0x5')],function(_0xfb67ea){const _0x5110a2=_0x99be1f;return{'name':_0xfb67ea[_0x5110a2('0x31')],'type':_0xfb67ea[_0x5110a2('0xd')][_0x5110a2('0x37')]};});_0x567a98[_0x99be1f('0x20')]=_[_0x99be1f('0x18')](_0x56cdf9,_0x99be1f('0x1d')),_0x567a98['query']=_[_0x99be1f('0x3b')](_0x7131b5[_0x99be1f('0x2e')]),_0x567a98[_0x99be1f('0x11')]=_[_0x99be1f('0x17')](_0x567a98[_0x99be1f('0x20')],_0x567a98[_0x99be1f('0x2e')]),_0x121c1e['attributes']=_['intersection'](_0x567a98['model'],qs[_0x99be1f('0x0')](_0x7131b5[_0x99be1f('0x2e')]['fields'])),_0x121c1e['attributes']=_0x121c1e['attributes'][_0x99be1f('0x16')]?_0x121c1e[_0x99be1f('0x30')]:_0x567a98[_0x99be1f('0x20')];typeof _0x7131b5[_0x99be1f('0x2e')][_0x99be1f('0x1')]===_0x99be1f('0x4')&&(_0x121c1e['limit']=qs['limit'](_0x7131b5[_0x99be1f('0x2e')][_0x99be1f('0x28')]),_0x121c1e[_0x99be1f('0x22')]=qs[_0x99be1f('0x22')](_0x7131b5['query']['offset']));_0x121c1e[_0x99be1f('0x3d')]=qs['sort'](_0x7131b5[_0x99be1f('0x2e')][_0x99be1f('0x21')]),_0x121c1e['where']=qs[_0x99be1f('0x11')](_[_0x99be1f('0x24')](_0x7131b5[_0x99be1f('0x2e')],_0x567a98[_0x99be1f('0x11')]),_0x56cdf9);_0x7131b5[_0x99be1f('0x2e')][_0x99be1f('0xb')]&&(_0x121c1e[_0x99be1f('0xa')]=_[_0x99be1f('0x2b')](_0x121c1e[_0x99be1f('0xa')],{[Op['or']]:_[_0x99be1f('0x18')](_0x56cdf9,function(_0x4d4c53){const _0x430514=_0x99be1f;if(_0x4d4c53[_0x430514('0xd')]!==_0x430514('0x1b')){const _0x203a47={};return _0x203a47[_0x4d4c53[_0x430514('0x1d')]]={[Op[_0x430514('0x3f')]]:'%'+_0x7131b5[_0x430514('0x2e')][_0x430514('0xb')]+'%'},_0x203a47;}})}));_0x121c1e=_[_0x99be1f('0x2b')]({},_0x121c1e,_0x7131b5[_0x99be1f('0x39')]);const _0x532f58={'where':_0x121c1e[_0x99be1f('0xa')]};return db['VoiceMail'][_0x99be1f('0x1e')](_0x532f58)[_0x99be1f('0x1f')](function(_0x4b652d){const _0x42df59=_0x99be1f;return _0x3c4d7e[_0x42df59('0x1e')]=_0x4b652d,_0x7131b5[_0x42df59('0x2e')][_0x42df59('0x33')]&&(_0x121c1e[_0x42df59('0x27')]=[{'all':!![]}]),db[_0x42df59('0x2f')]['findAll'](_0x121c1e);})['then'](function(_0x11366d){const _0x59a033=_0x99be1f;return _0x3c4d7e[_0x59a033('0x14')]=_0x11366d,_0x3c4d7e;})[_0x99be1f('0x1f')](respondWithFilteredResult(_0xaec0ad,_0x121c1e))[_0x99be1f('0x3a')](handleError(_0xaec0ad,null));},exports[_0x1b46f5('0x3c')]=function(_0x5f35c6,_0x4a2c34){const _0x114e6d=_0x1b46f5;let _0x8c5ed4={'raw':!![],'where':{'id':_0x5f35c6[_0x114e6d('0x25')]['id']}};const _0x4e3850={};return _0x4e3850[_0x114e6d('0x20')]=_['keys'](db[_0x114e6d('0x2f')][_0x114e6d('0x5')]),_0x4e3850[_0x114e6d('0x2e')]=_[_0x114e6d('0x3b')](_0x5f35c6[_0x114e6d('0x2e')]),_0x4e3850[_0x114e6d('0x11')]=_[_0x114e6d('0x17')](_0x4e3850[_0x114e6d('0x20')],_0x4e3850[_0x114e6d('0x2e')]),_0x8c5ed4[_0x114e6d('0x30')]=_[_0x114e6d('0x17')](_0x4e3850[_0x114e6d('0x20')],qs[_0x114e6d('0x0')](_0x5f35c6['query']['fields'])),_0x8c5ed4[_0x114e6d('0x30')]=_0x8c5ed4[_0x114e6d('0x30')][_0x114e6d('0x16')]?_0x8c5ed4[_0x114e6d('0x30')]:_0x4e3850[_0x114e6d('0x20')],_0x5f35c6[_0x114e6d('0x2e')][_0x114e6d('0x33')]&&(_0x8c5ed4[_0x114e6d('0x27')]=[{'all':!![]}]),_0x8c5ed4=_[_0x114e6d('0x2b')]({},_0x8c5ed4,_0x5f35c6[_0x114e6d('0x39')]),db[_0x114e6d('0x2f')][_0x114e6d('0x8')](_0x8c5ed4)[_0x114e6d('0x1f')](handleEntityNotFound(_0x4a2c34,null))[_0x114e6d('0x1f')](respondWithResult(_0x4a2c34,null))[_0x114e6d('0x3a')](handleError(_0x4a2c34,null));},exports[_0x1b46f5('0x1c')]=function(_0xcd1c8d,_0x3d2dbd){const _0x19168e=_0x1b46f5;return db[_0x19168e('0x2f')][_0x19168e('0x1c')](_0xcd1c8d[_0x19168e('0x12')],{})[_0x19168e('0x1f')](function(_0x5cedff){const _0x9fb539=_0x19168e,_0x1b8ed7=_0xcd1c8d[_0x9fb539('0x19')][_0x9fb539('0x2c')]({'plain':!![]});if(!_0x1b8ed7)throw new Error(_0x9fb539('0x3'));if(_0x1b8ed7[_0x9fb539('0x3e')]===_0x9fb539('0x19')){const _0x22c351=_0x5cedff[_0x9fb539('0x2c')]({'plain':!![]}),_0x482fa8=_0x9fb539('0x38');return db[_0x9fb539('0x7')][_0x9fb539('0x8')]({'where':{'name':_0x482fa8,'userProfileId':_0x1b8ed7['userProfileId']},'raw':!![]})[_0x9fb539('0x1f')](function(_0x57e22a){const _0x1a3f01=_0x9fb539;return _0x57e22a&&_0x57e22a[_0x1a3f01('0x26')]===0x0?db[_0x1a3f01('0xf')]['create']({'name':_0x22c351[_0x1a3f01('0x1d')],'resourceId':_0x22c351['id'],'type':_0x57e22a[_0x1a3f01('0x1d')],'sectionId':_0x57e22a['id']},{})['then'](function(){return _0x5cedff;}):_0x5cedff;})[_0x9fb539('0x3a')](function(_0x47f418){const _0x1e2fc0=_0x9fb539;logger[_0x1e2fc0('0x10')](_0x1e2fc0('0x36'),_0x47f418);throw _0x47f418;});}return _0x5cedff;})['then'](respondWithResult(_0x3d2dbd,0xc9))[_0x19168e('0x3a')](handleError(_0x3d2dbd,null));},exports[_0x1b46f5('0x23')]=function(_0x463479,_0x162456){const _0x2f711c=_0x1b46f5;return _0x463479['body']['id']&&delete _0x463479[_0x2f711c('0x12')]['id'],db['VoiceMail'][_0x2f711c('0x8')]({'where':{'id':_0x463479[_0x2f711c('0x25')]['id']}})[_0x2f711c('0x1f')](handleEntityNotFound(_0x162456,null))[_0x2f711c('0x1f')](saveUpdates(_0x463479[_0x2f711c('0x12')],null))[_0x2f711c('0x1f')](respondWithResult(_0x162456,null))[_0x2f711c('0x3a')](handleError(_0x162456,null));},exports[_0x1b46f5('0x9')]=function(_0x413c8b,_0x421264){const _0x5f0a90=_0x1b46f5;return db[_0x5f0a90('0x2f')]['findOne']({'where':{'id':_0x413c8b['params']['id']}})[_0x5f0a90('0x1f')](handleEntityNotFound(_0x421264,null))[_0x5f0a90('0x1f')](removeEntity(_0x421264,null))[_0x5f0a90('0x3a')](handleError(_0x421264,null));},exports[_0x1b46f5('0x6')]=function(_0x2aac4b,_0x50bdc2){const _0x447b5c=_0x1b46f5;return db[_0x447b5c('0x2f')][_0x447b5c('0x8')]({'where':{'id':_0x2aac4b[_0x447b5c('0x25')]['id']}})[_0x447b5c('0x1f')](handleEntityNotFound(_0x50bdc2,null))['then'](function(_0xa7089a){const _0x31bae5=_0x447b5c;let _0x24c471={};const _0x4a637a={};return _0x4a637a['model']=_['keys'](db[_0x31bae5('0x2a')][_0x31bae5('0x5')]),_0x4a637a[_0x31bae5('0x2e')]=_[_0x31bae5('0x3b')](_0x2aac4b[_0x31bae5('0x2e')]),_0x4a637a[_0x31bae5('0x11')]=_['intersection'](_0x4a637a[_0x31bae5('0x20')],_0x4a637a[_0x31bae5('0x2e')]),_0x24c471['attributes']=_['intersection'](_0x4a637a[_0x31bae5('0x20')],qs[_0x31bae5('0x0')](_0x2aac4b[_0x31bae5('0x2e')][_0x31bae5('0x0')])),_0x24c471[_0x31bae5('0x30')]=_0x24c471[_0x31bae5('0x30')][_0x31bae5('0x16')]?_0x24c471[_0x31bae5('0x30')]:_0x4a637a['model'],typeof _0x2aac4b[_0x31bae5('0x2e')][_0x31bae5('0x1')]==='undefined'&&(_0x24c471[_0x31bae5('0x28')]=qs[_0x31bae5('0x28')](_0x2aac4b['query'][_0x31bae5('0x28')]),_0x24c471[_0x31bae5('0x22')]=qs[_0x31bae5('0x22')](_0x2aac4b[_0x31bae5('0x2e')]['offset'])),_0x24c471['order']=qs[_0x31bae5('0x21')](_0x2aac4b[_0x31bae5('0x2e')][_0x31bae5('0x21')]),_0x24c471['where']=qs[_0x31bae5('0x11')](_[_0x31bae5('0x24')](_0x2aac4b[_0x31bae5('0x2e')],_0x4a637a[_0x31bae5('0x11')])),_0x2aac4b[_0x31bae5('0x2e')][_0x31bae5('0xb')]&&(_0x24c471['where']=_[_0x31bae5('0x2b')](_0x24c471[_0x31bae5('0xa')],{[Op['or']]:_['map'](_0x24c471[_0x31bae5('0x30')],function(_0x5c5b36){const _0x3e9930=_0x31bae5,_0x5673b1={};return _0x5673b1[_0x5c5b36]={[Op[_0x3e9930('0x3f')]]:'%'+_0x2aac4b[_0x3e9930('0x2e')]['filter']+'%'},_0x5673b1;})})),_0x24c471[_0x31bae5('0xa')]=_['merge'](_0x24c471[_0x31bae5('0xa')],{'mailboxuser':_0xa7089a['mailbox']}),_0x24c471=_[_0x31bae5('0x2b')]({},_0x24c471,_0x2aac4b['options']),db[_0x31bae5('0x2a')]['findAndCountAll'](_0x24c471)[_0x31bae5('0x1f')](respondWithFilteredResult(_0x50bdc2,_0x24c471));})['catch'](handleError(_0x50bdc2,null));};
\ No newline at end of file
+const a734_0x511d=['Unable\x20to\x20retrieve\x20the\x20current\x20user','undefined','map','sort','intersection','VoiceMail','get','order','json','../../mysqldb','mailbox','type','sendStatus','stack','lodash','VoiceMailMessage','api','params','role','findOne','destroy','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','rawAttributes','pick','findAndCountAll','then','filters','update','sequelize','rows','options','autoAssociation','query','set','filter','count','keys','attributes','length','VIRTUAL','create','getMessages','where','include','findAll','status','model','end','nolimit','includeAll','send','key','like','UserProfileResource','user','merge','limit','body','userProfileId','fields','offset','name','../../components/parsers/qs'];(function(_0x3ada78,_0x511dbf){const _0x191354=function(_0x22f799){while(--_0x22f799){_0x3ada78['push'](_0x3ada78['shift']());}};_0x191354(++_0x511dbf);}(a734_0x511d,0x1d8));const a734_0x1913=function(_0x3ada78,_0x511dbf){_0x3ada78=_0x3ada78-0x0;let _0x191354=a734_0x511d[_0x3ada78];return _0x191354;};const _0x588bba=a734_0x1913;'use strict';const _=require(_0x588bba('0x36')),qs=require(_0x588bba('0x27')),logger=require('../../config/logger')(_0x588bba('0x38')),db=require(_0x588bba('0x31'))['db'],{Op}=require(_0x588bba('0x5'));function respondWithResult(_0x22f799,_0x7cbc8c){return _0x7cbc8c=_0x7cbc8c||0xc8,function(_0x5a82e2){const _0x84ff89=a734_0x1913;if(_0x5a82e2)return _0x22f799['status'](_0x7cbc8c)[_0x84ff89('0x30')](_0x5a82e2);};}function respondWithFilteredResult(_0x34271f,_0x417fbc){return function(_0x4e076b){const _0x2dd83e=a734_0x1913;if(_0x4e076b){const _0x5a147b=_0x4e076b[_0x2dd83e('0xc')],_0x402d4f=_0x417fbc[_0x2dd83e('0x25')];let _0x260918=_0x417fbc[_0x2dd83e('0x25')]+_0x417fbc[_0x2dd83e('0x21')],_0x1e5db3;return _0x260918>=_0x5a147b?(_0x260918=_0x5a147b,_0x1e5db3=0xc8):_0x1e5db3=0xce,_0x34271f[_0x2dd83e('0x16')](_0x1e5db3),_0x34271f[_0x2dd83e('0xa')]('Content-Range',_0x402d4f+'-'+_0x260918+'/'+_0x5a147b)[_0x2dd83e('0x30')](_0x4e076b);}return null;};}function saveUpdates(_0x3c9292){return function(_0x46bea3){const _0x54a5f1=a734_0x1913;if(_0x46bea3)return _0x46bea3[_0x54a5f1('0x4')](_0x3c9292)[_0x54a5f1('0x2')](function(_0x1db2d3){return _0x1db2d3;});return null;};}function removeEntity(_0x2ef534){return function(_0x366fc5){const _0xf62be7=a734_0x1913;if(_0x366fc5)return _0x366fc5[_0xf62be7('0x3c')]()[_0xf62be7('0x2')](function(){const _0x45c741=_0xf62be7,_0x200567=_0x366fc5[_0x45c741('0x2e')]({'plain':!![]}),_0x1bff71='Voicemails';return db['UserProfileResource'][_0x45c741('0x3c')]({'where':{'type':_0x1bff71,'resourceId':_0x200567['id']}})[_0x45c741('0x2')](function(){return _0x366fc5;});})[_0xf62be7('0x2')](function(){const _0x1f7bff=_0xf62be7;_0x2ef534[_0x1f7bff('0x16')](0xcc)[_0x1f7bff('0x18')]();});};}function handleEntityNotFound(_0x10a112){return function(_0x18df07){const _0x43f2f0=a734_0x1913;return!_0x18df07&&_0x10a112[_0x43f2f0('0x34')](0x194),_0x18df07;};}function handleError(_0x261e71,_0x587995){return _0x587995=_0x587995||0x1f4,function(_0xb5060){const _0x4a0af9=a734_0x1913;logger['error'](_0xb5060[_0x4a0af9('0x35')]),_0xb5060[_0x4a0af9('0x26')]&&delete _0xb5060[_0x4a0af9('0x26')],_0x261e71['status'](_0x587995)[_0x4a0af9('0x1b')](_0xb5060);};}exports['index']=function(_0x141239,_0xa4598f){const _0x1c8389=_0x588bba;let _0x2eead8={};const _0x549fc5={},_0xd073b9={'count':0x0,'rows':[]},_0x126248=_['map'](db[_0x1c8389('0x2d')][_0x1c8389('0x3f')],function(_0x5ae968){const _0x494e3c=_0x1c8389;return{'name':_0x5ae968['fieldName'],'type':_0x5ae968[_0x494e3c('0x33')][_0x494e3c('0x1c')]};});_0x549fc5[_0x1c8389('0x17')]=_[_0x1c8389('0x2a')](_0x126248,_0x1c8389('0x26')),_0x549fc5['query']=_['keys'](_0x141239['query']),_0x549fc5['filters']=_[_0x1c8389('0x2c')](_0x549fc5[_0x1c8389('0x17')],_0x549fc5['query']),_0x2eead8[_0x1c8389('0xe')]=_[_0x1c8389('0x2c')](_0x549fc5[_0x1c8389('0x17')],qs[_0x1c8389('0x24')](_0x141239[_0x1c8389('0x9')][_0x1c8389('0x24')])),_0x2eead8[_0x1c8389('0xe')]=_0x2eead8['attributes']['length']?_0x2eead8[_0x1c8389('0xe')]:_0x549fc5['model'];typeof _0x141239[_0x1c8389('0x9')][_0x1c8389('0x19')]===_0x1c8389('0x29')&&(_0x2eead8[_0x1c8389('0x21')]=qs[_0x1c8389('0x21')](_0x141239['query'][_0x1c8389('0x21')]),_0x2eead8[_0x1c8389('0x25')]=qs['offset'](_0x141239[_0x1c8389('0x9')][_0x1c8389('0x25')]));_0x2eead8[_0x1c8389('0x2f')]=qs[_0x1c8389('0x2b')](_0x141239['query'][_0x1c8389('0x2b')]),_0x2eead8['where']=qs[_0x1c8389('0x3')](_[_0x1c8389('0x0')](_0x141239['query'],_0x549fc5['filters']),_0x126248);_0x141239[_0x1c8389('0x9')][_0x1c8389('0xb')]&&(_0x2eead8[_0x1c8389('0x13')]=_[_0x1c8389('0x20')](_0x2eead8[_0x1c8389('0x13')],{[Op['or']]:_['map'](_0x126248,function(_0x3507a0){const _0x1a126b=_0x1c8389;if(_0x3507a0[_0x1a126b('0x33')]!==_0x1a126b('0x10')){const _0x487ae8={};return _0x487ae8[_0x3507a0[_0x1a126b('0x26')]]={[Op[_0x1a126b('0x1d')]]:'%'+_0x141239[_0x1a126b('0x9')]['filter']+'%'},_0x487ae8;}})}));_0x2eead8=_[_0x1c8389('0x20')]({},_0x2eead8,_0x141239[_0x1c8389('0x7')]);const _0x3ef64a={'where':_0x2eead8[_0x1c8389('0x13')]};return db['VoiceMail'][_0x1c8389('0xc')](_0x3ef64a)['then'](function(_0x25e4d3){const _0x276006=_0x1c8389;return _0xd073b9[_0x276006('0xc')]=_0x25e4d3,_0x141239[_0x276006('0x9')]['includeAll']&&(_0x2eead8[_0x276006('0x14')]=[{'all':!![]}]),db['VoiceMail'][_0x276006('0x15')](_0x2eead8);})['then'](function(_0x41050f){const _0x1eda9c=_0x1c8389;return _0xd073b9[_0x1eda9c('0x6')]=_0x41050f,_0xd073b9;})[_0x1c8389('0x2')](respondWithFilteredResult(_0xa4598f,_0x2eead8))[_0x1c8389('0x3e')](handleError(_0xa4598f,null));},exports['show']=function(_0x561973,_0x166651){const _0x244919=_0x588bba;let _0x34756d={'raw':!![],'where':{'id':_0x561973[_0x244919('0x39')]['id']}};const _0x240425={};return _0x240425[_0x244919('0x17')]=_['keys'](db[_0x244919('0x2d')][_0x244919('0x3f')]),_0x240425[_0x244919('0x9')]=_[_0x244919('0xd')](_0x561973['query']),_0x240425[_0x244919('0x3')]=_[_0x244919('0x2c')](_0x240425[_0x244919('0x17')],_0x240425[_0x244919('0x9')]),_0x34756d['attributes']=_[_0x244919('0x2c')](_0x240425['model'],qs[_0x244919('0x24')](_0x561973[_0x244919('0x9')][_0x244919('0x24')])),_0x34756d[_0x244919('0xe')]=_0x34756d[_0x244919('0xe')]['length']?_0x34756d[_0x244919('0xe')]:_0x240425[_0x244919('0x17')],_0x561973[_0x244919('0x9')][_0x244919('0x1a')]&&(_0x34756d[_0x244919('0x14')]=[{'all':!![]}]),_0x34756d=_[_0x244919('0x20')]({},_0x34756d,_0x561973[_0x244919('0x7')]),db[_0x244919('0x2d')]['findOne'](_0x34756d)[_0x244919('0x2')](handleEntityNotFound(_0x166651,null))['then'](respondWithResult(_0x166651,null))[_0x244919('0x3e')](handleError(_0x166651,null));},exports[_0x588bba('0x11')]=function(_0x1102cc,_0x22737e){const _0x16034a=_0x588bba;return db[_0x16034a('0x2d')][_0x16034a('0x11')](_0x1102cc['body'],{})[_0x16034a('0x2')](function(_0x245e8b){const _0x3e364b=_0x16034a,_0x1b874e=_0x1102cc[_0x3e364b('0x1f')]['get']({'plain':!![]});if(!_0x1b874e)throw new Error(_0x3e364b('0x28'));if(_0x1b874e[_0x3e364b('0x3a')]===_0x3e364b('0x1f')){const _0x29eae8=_0x245e8b[_0x3e364b('0x2e')]({'plain':!![]}),_0x3fd147='Voicemails';return db['UserProfileSection']['findOne']({'where':{'name':_0x3fd147,'userProfileId':_0x1b874e[_0x3e364b('0x23')]},'raw':!![]})[_0x3e364b('0x2')](function(_0xcff0fc){const _0x21fefa=_0x3e364b;return _0xcff0fc&&_0xcff0fc[_0x21fefa('0x8')]===0x0?db[_0x21fefa('0x1e')][_0x21fefa('0x11')]({'name':_0x29eae8['name'],'resourceId':_0x29eae8['id'],'type':_0xcff0fc[_0x21fefa('0x26')],'sectionId':_0xcff0fc['id']},{})[_0x21fefa('0x2')](function(){return _0x245e8b;}):_0x245e8b;})[_0x3e364b('0x3e')](function(_0x5df5d6){const _0x1d5725=_0x3e364b;logger['error'](_0x1d5725('0x3d'),_0x5df5d6);throw _0x5df5d6;});}return _0x245e8b;})['then'](respondWithResult(_0x22737e,0xc9))[_0x16034a('0x3e')](handleError(_0x22737e,null));},exports[_0x588bba('0x4')]=function(_0x46f2d8,_0x2b2e93){const _0xa48e78=_0x588bba;return _0x46f2d8[_0xa48e78('0x22')]['id']&&delete _0x46f2d8[_0xa48e78('0x22')]['id'],db[_0xa48e78('0x2d')][_0xa48e78('0x3b')]({'where':{'id':_0x46f2d8[_0xa48e78('0x39')]['id']}})[_0xa48e78('0x2')](handleEntityNotFound(_0x2b2e93,null))['then'](saveUpdates(_0x46f2d8[_0xa48e78('0x22')],null))[_0xa48e78('0x2')](respondWithResult(_0x2b2e93,null))[_0xa48e78('0x3e')](handleError(_0x2b2e93,null));},exports['destroy']=function(_0x2ae323,_0x10ca29){const _0x436a18=_0x588bba;return db[_0x436a18('0x2d')]['findOne']({'where':{'id':_0x2ae323[_0x436a18('0x39')]['id']}})[_0x436a18('0x2')](handleEntityNotFound(_0x10ca29,null))[_0x436a18('0x2')](removeEntity(_0x10ca29,null))[_0x436a18('0x3e')](handleError(_0x10ca29,null));},exports[_0x588bba('0x12')]=function(_0x4a2d5b,_0x5df070){const _0x28db6c=_0x588bba;return db[_0x28db6c('0x2d')]['findOne']({'where':{'id':_0x4a2d5b[_0x28db6c('0x39')]['id']}})[_0x28db6c('0x2')](handleEntityNotFound(_0x5df070,null))[_0x28db6c('0x2')](function(_0x44cb35){const _0x2acbd2=_0x28db6c;let _0x1da7d3={};const _0x6f43d7={};return _0x6f43d7['model']=_[_0x2acbd2('0xd')](db[_0x2acbd2('0x37')][_0x2acbd2('0x3f')]),_0x6f43d7[_0x2acbd2('0x9')]=_[_0x2acbd2('0xd')](_0x4a2d5b[_0x2acbd2('0x9')]),_0x6f43d7[_0x2acbd2('0x3')]=_[_0x2acbd2('0x2c')](_0x6f43d7[_0x2acbd2('0x17')],_0x6f43d7[_0x2acbd2('0x9')]),_0x1da7d3[_0x2acbd2('0xe')]=_[_0x2acbd2('0x2c')](_0x6f43d7[_0x2acbd2('0x17')],qs[_0x2acbd2('0x24')](_0x4a2d5b[_0x2acbd2('0x9')]['fields'])),_0x1da7d3[_0x2acbd2('0xe')]=_0x1da7d3[_0x2acbd2('0xe')][_0x2acbd2('0xf')]?_0x1da7d3[_0x2acbd2('0xe')]:_0x6f43d7['model'],typeof _0x4a2d5b[_0x2acbd2('0x9')][_0x2acbd2('0x19')]===_0x2acbd2('0x29')&&(_0x1da7d3[_0x2acbd2('0x21')]=qs['limit'](_0x4a2d5b[_0x2acbd2('0x9')][_0x2acbd2('0x21')]),_0x1da7d3[_0x2acbd2('0x25')]=qs[_0x2acbd2('0x25')](_0x4a2d5b['query'][_0x2acbd2('0x25')])),_0x1da7d3['order']=qs[_0x2acbd2('0x2b')](_0x4a2d5b[_0x2acbd2('0x9')][_0x2acbd2('0x2b')]),_0x1da7d3[_0x2acbd2('0x13')]=qs[_0x2acbd2('0x3')](_['pick'](_0x4a2d5b[_0x2acbd2('0x9')],_0x6f43d7[_0x2acbd2('0x3')])),_0x4a2d5b[_0x2acbd2('0x9')][_0x2acbd2('0xb')]&&(_0x1da7d3['where']=_[_0x2acbd2('0x20')](_0x1da7d3[_0x2acbd2('0x13')],{[Op['or']]:_['map'](_0x1da7d3[_0x2acbd2('0xe')],function(_0x27227b){const _0x131849=_0x2acbd2,_0x57a0a9={};return _0x57a0a9[_0x27227b]={[Op[_0x131849('0x1d')]]:'%'+_0x4a2d5b[_0x131849('0x9')][_0x131849('0xb')]+'%'},_0x57a0a9;})})),_0x1da7d3[_0x2acbd2('0x13')]=_[_0x2acbd2('0x20')](_0x1da7d3['where'],{'mailboxuser':_0x44cb35[_0x2acbd2('0x32')]}),_0x1da7d3=_[_0x2acbd2('0x20')]({},_0x1da7d3,_0x4a2d5b[_0x2acbd2('0x7')]),db[_0x2acbd2('0x37')][_0x2acbd2('0x1')](_0x1da7d3)[_0x2acbd2('0x2')](respondWithFilteredResult(_0x5df070,_0x1da7d3));})[_0x28db6c('0x3e')](handleError(_0x5df070,null));};
\ No newline at end of file