Built motion from commit 9d0783e6.|2.6.13
[motion2.git] / server / api / voiceMailMessage / voiceMailMessage.controller.js
index 09ebad0..f28a890 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1eb6=['recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','set','reject','save','update','then','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','limit','sort','where','merge','filter','options','includeAll','include','findAll','catch','show','find','create','body','params','destroy','download'];(function(_0x3b085,_0x250543){var _0x476a57=function(_0x480941){while(--_0x480941){_0x3b085['push'](_0x3b085['shift']());}};_0x476a57(++_0x250543);}(_0x1eb6,0x1ee));var _0x61eb=function(_0x3b485f,_0x2d44ff){_0x3b485f=_0x3b485f-0x0;var _0x277d2c=_0x1eb6[_0x3b485f];return _0x277d2c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x61eb('0x0'));var rimraf=require(_0x61eb('0x1'));var zipdir=require(_0x61eb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x61eb('0x3'));var BPromise=require(_0x61eb('0x4'));var Mustache=require(_0x61eb('0x5'));var util=require(_0x61eb('0x6'));var path=require(_0x61eb('0x7'));var sox=require(_0x61eb('0x8'));var csv=require(_0x61eb('0x9'));var ejs=require(_0x61eb('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x61eb('0xb'));var jsforce=require(_0x61eb('0xc'));var deskjs=require(_0x61eb('0xd'));var toCsv=require(_0x61eb('0x9'));var querystring=require(_0x61eb('0xe'));var Papa=require(_0x61eb('0xf'));var Redis=require(_0x61eb('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x61eb('0x11'));var as=require(_0x61eb('0x12'));var hardwareService=require(_0x61eb('0x13'));var logger=require(_0x61eb('0x14'))('api');var utils=require(_0x61eb('0x15'));var config=require(_0x61eb('0x16'));var licenseUtil=require(_0x61eb('0x17'));var db=require(_0x61eb('0x18'))['db'];function respondWithStatusCode(_0x59e6de,_0x4300bd){_0x4300bd=_0x4300bd||0xcc;return function(_0xa1cae){if(_0xa1cae){return _0x59e6de[_0x61eb('0x19')](_0x4300bd);}return _0x59e6de[_0x61eb('0x1a')](_0x4300bd)[_0x61eb('0x1b')]();};}function respondWithResult(_0x2faef7,_0x35c033){_0x35c033=_0x35c033||0xc8;return function(_0x51a5d7){if(_0x51a5d7){return _0x2faef7[_0x61eb('0x1a')](_0x35c033)[_0x61eb('0x1c')](_0x51a5d7);}};}function respondWithFilteredResult(_0x299ffb,_0x479d7d){return function(_0x48f37a){if(_0x48f37a){var _0x53cb17=_0x48f37a[_0x61eb('0x1d')],_0x3a46e6=_0x479d7d['offset'],_0x4912b0=_0x479d7d[_0x61eb('0x1e')]+_0x479d7d['limit'],_0x21ae32;if(_0x4912b0>=_0x53cb17){_0x4912b0=_0x53cb17;_0x21ae32=0xc8;}else{_0x21ae32=0xce;}_0x299ffb[_0x61eb('0x1a')](_0x21ae32);return _0x299ffb[_0x61eb('0x1f')]('Content-Range',_0x3a46e6+'-'+_0x4912b0+'/'+_0x53cb17)[_0x61eb('0x1c')](_0x48f37a);}return null;};}function patchUpdates(_0xbed28c){return function(_0x50ce26){try{jsonpatch['apply'](_0x50ce26,_0xbed28c,!![]);}catch(_0x3fe729){return BPromise[_0x61eb('0x20')](_0x3fe729);}return _0x50ce26[_0x61eb('0x21')]();};}function saveUpdates(_0x78c825,_0x56f789){return function(_0xd51513){if(_0xd51513){return _0xd51513[_0x61eb('0x22')](_0x78c825)[_0x61eb('0x23')](function(_0x2a1b3f){return _0x2a1b3f;});}return null;};}function removeEntity(_0x423c29,_0x45cc2c){return function(_0x47a642){if(_0x47a642){return _0x47a642['destroy']()[_0x61eb('0x23')](function(){_0x423c29[_0x61eb('0x1a')](0xcc)[_0x61eb('0x1b')]();});}};}function handleEntityNotFound(_0x1b8d44,_0x2424cb){return function(_0x63031c){if(!_0x63031c){_0x1b8d44[_0x61eb('0x19')](0x194);}return _0x63031c;};}function handleError(_0x3351a9,_0x143175){_0x143175=_0x143175||0x1f4;return function(_0x3d353e){logger[_0x61eb('0x24')](_0x3d353e[_0x61eb('0x25')]);if(_0x3d353e[_0x61eb('0x26')]){delete _0x3d353e['name'];}_0x3351a9[_0x61eb('0x1a')](_0x143175)[_0x61eb('0x27')](_0x3d353e);};}exports[_0x61eb('0x28')]=function(_0x4b4e5c,_0x25254c){var _0xabde9b={},_0x44922b={},_0x352f7c={'count':0x0,'rows':[]};var _0x4d9f87=_[_0x61eb('0x29')](db[_0x61eb('0x2a')][_0x61eb('0x2b')],function(_0xfa227){return{'name':_0xfa227[_0x61eb('0x2c')],'type':_0xfa227[_0x61eb('0x2d')][_0x61eb('0x2e')]};});_0x44922b[_0x61eb('0x2f')]=_[_0x61eb('0x30')](_[_0x61eb('0x29')](_0x4d9f87,_0x61eb('0x26')),[_0x61eb('0x26')]);_0x44922b[_0x61eb('0x31')]=_[_0x61eb('0x32')](_0x4b4e5c[_0x61eb('0x31')]);_0x44922b[_0x61eb('0x33')]=_[_0x61eb('0x34')](_0x44922b[_0x61eb('0x2f')],_0x44922b[_0x61eb('0x31')]);_0xabde9b[_0x61eb('0x35')]=_[_0x61eb('0x34')](_0x44922b[_0x61eb('0x2f')],qs[_0x61eb('0x36')](_0x4b4e5c[_0x61eb('0x31')][_0x61eb('0x36')]));_0xabde9b['attributes']=_0xabde9b[_0x61eb('0x35')][_0x61eb('0x37')]?_0xabde9b[_0x61eb('0x35')]:_0x44922b['model'];if(!_0x4b4e5c[_0x61eb('0x31')]['hasOwnProperty']('nolimit')){_0xabde9b['limit']=qs[_0x61eb('0x38')](_0x4b4e5c['query'][_0x61eb('0x38')]);_0xabde9b['offset']=qs[_0x61eb('0x1e')](_0x4b4e5c[_0x61eb('0x31')][_0x61eb('0x1e')]);}_0xabde9b['order']=qs[_0x61eb('0x39')](_0x4b4e5c[_0x61eb('0x31')][_0x61eb('0x39')]);_0xabde9b[_0x61eb('0x3a')]=qs[_0x61eb('0x33')](_['pick'](_0x4b4e5c[_0x61eb('0x31')],_0x44922b[_0x61eb('0x33')]),_0x4d9f87);if(_0x4b4e5c['query']['filter']){_0xabde9b[_0x61eb('0x3a')]=_[_0x61eb('0x3b')](_0xabde9b[_0x61eb('0x3a')],{'$or':_[_0x61eb('0x29')](_0x4d9f87,function(_0x2dac2d){if(_0x2dac2d[_0x61eb('0x2d')]!=='VIRTUAL'){var _0x5547f6={};_0x5547f6[_0x2dac2d['name']]={'$like':'%'+_0x4b4e5c[_0x61eb('0x31')][_0x61eb('0x3c')]+'%'};return _0x5547f6;}})});}_0xabde9b=_['merge']({},_0xabde9b,_0x4b4e5c[_0x61eb('0x3d')]);var _0x19383b={'where':_0xabde9b['where']};return db[_0x61eb('0x2a')][_0x61eb('0x1d')](_0x19383b)['then'](function(_0x1281b4){_0x352f7c[_0x61eb('0x1d')]=_0x1281b4;if(_0x4b4e5c['query'][_0x61eb('0x3e')]){_0xabde9b[_0x61eb('0x3f')]=[{'all':!![]}];}return db[_0x61eb('0x2a')][_0x61eb('0x40')](_0xabde9b);})[_0x61eb('0x23')](function(_0x22535e){_0x352f7c['rows']=_0x22535e;return _0x352f7c;})[_0x61eb('0x23')](respondWithFilteredResult(_0x25254c,_0xabde9b))[_0x61eb('0x41')](handleError(_0x25254c,null));};exports[_0x61eb('0x42')]=function(_0x36fdb0,_0x11364f){var _0x28bb4d={'raw':!![],'where':{'id':_0x36fdb0['params']['id']}},_0x4fb5c0={};_0x4fb5c0['model']=_[_0x61eb('0x32')](db[_0x61eb('0x2a')][_0x61eb('0x2b')]);_0x4fb5c0[_0x61eb('0x31')]=_['keys'](_0x36fdb0[_0x61eb('0x31')]);_0x4fb5c0[_0x61eb('0x33')]=_[_0x61eb('0x34')](_0x4fb5c0[_0x61eb('0x2f')],_0x4fb5c0['query']);_0x28bb4d[_0x61eb('0x35')]=_['intersection'](_0x4fb5c0[_0x61eb('0x2f')],qs[_0x61eb('0x36')](_0x36fdb0['query'][_0x61eb('0x36')]));_0x28bb4d[_0x61eb('0x35')]=_0x28bb4d[_0x61eb('0x35')][_0x61eb('0x37')]?_0x28bb4d[_0x61eb('0x35')]:_0x4fb5c0['model'];if(_0x36fdb0[_0x61eb('0x31')][_0x61eb('0x3e')]){_0x28bb4d['include']=[{'all':!![]}];}_0x28bb4d=_[_0x61eb('0x3b')]({},_0x28bb4d,_0x36fdb0[_0x61eb('0x3d')]);return db[_0x61eb('0x2a')][_0x61eb('0x43')](_0x28bb4d)[_0x61eb('0x23')](handleEntityNotFound(_0x11364f,null))[_0x61eb('0x23')](respondWithResult(_0x11364f,null))[_0x61eb('0x41')](handleError(_0x11364f,null));};exports[_0x61eb('0x44')]=function(_0x74387,_0x1be170){return db['VoiceMailMessage'][_0x61eb('0x44')](_0x74387[_0x61eb('0x45')],{})[_0x61eb('0x23')](respondWithResult(_0x1be170,0xc9))['catch'](handleError(_0x1be170,null));};exports[_0x61eb('0x22')]=function(_0x42ad1d,_0x2ce961){if(_0x42ad1d[_0x61eb('0x45')]['id']){delete _0x42ad1d['body']['id'];}return db[_0x61eb('0x2a')][_0x61eb('0x43')]({'where':{'id':_0x42ad1d[_0x61eb('0x46')]['id']}})['then'](handleEntityNotFound(_0x2ce961,null))['then'](saveUpdates(_0x42ad1d[_0x61eb('0x45')],null))['then'](respondWithResult(_0x2ce961,null))[_0x61eb('0x41')](handleError(_0x2ce961,null));};exports[_0x61eb('0x47')]=function(_0x16a2d2,_0x535d82){return db['VoiceMailMessage'][_0x61eb('0x43')]({'where':{'id':_0x16a2d2[_0x61eb('0x46')]['id']}})[_0x61eb('0x23')](handleEntityNotFound(_0x535d82,null))['then'](removeEntity(_0x535d82,null))[_0x61eb('0x41')](handleError(_0x535d82,null));};exports[_0x61eb('0x48')]=function(_0x48395d,_0x42a064,_0x7cc676){return db[_0x61eb('0x2a')][_0x61eb('0x43')]({'where':{'id':_0x48395d[_0x61eb('0x46')]['id']},'attributes':['id',_0x61eb('0x49'),_0x61eb('0x4a')]})[_0x61eb('0x23')](handleEntityNotFound(_0x42a064,null))[_0x61eb('0x23')](function(_0x35036e){if(_0x35036e){if(!_0x35036e[_0x61eb('0x49')]){throw new db[(_0x61eb('0x4b'))][(_0x61eb('0x4c'))](_0x61eb('0x4d'));}var _0x376b94={'Content-Type':_0x61eb('0x4e'),'Content-Disposition':'attachment'};if(_0x35036e[_0x61eb('0x4a')]){_0x376b94[_0x61eb('0x4f')]=_0x61eb('0x50')+_0x35036e[_0x61eb('0x4a')]+'.wav\x22';}_0x42a064[_0x61eb('0x1f')](_0x376b94);return _0x42a064[_0x61eb('0x27')](new Buffer(_0x35036e[_0x61eb('0x49')]));}})[_0x61eb('0x41')](handleError(_0x42a064,null));};
\ No newline at end of file
+var _0xa4ba=['count','status','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','type','model','differenceBy','query','filters','intersection','fields','attributes','order','sort','where','pick','merge','VIRTUAL','filter','options','VoiceMailMessage','includeAll','findAll','rows','show','params','keys','length','include','catch','create','body','download','find','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined'];(function(_0x5912be,_0x1bd806){var _0x41be72=function(_0x1566fc){while(--_0x1566fc){_0x5912be['push'](_0x5912be['shift']());}};_0x41be72(++_0x1bd806);}(_0xa4ba,0x8f));var _0xaa4b=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xa4ba[_0x346737];return _0x1ade2e;};'use strict';var emlformat=require(_0xaa4b('0x0'));var rimraf=require(_0xaa4b('0x1'));var zipdir=require(_0xaa4b('0x2'));var jsonpatch=require(_0xaa4b('0x3'));var rp=require(_0xaa4b('0x4'));var moment=require(_0xaa4b('0x5'));var BPromise=require(_0xaa4b('0x6'));var Mustache=require(_0xaa4b('0x7'));var util=require(_0xaa4b('0x8'));var path=require(_0xaa4b('0x9'));var sox=require(_0xaa4b('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaa4b('0xb'));var _=require('lodash');var squel=require(_0xaa4b('0xc'));var crypto=require('crypto');var jsforce=require(_0xaa4b('0xd'));var deskjs=require(_0xaa4b('0xe'));var toCsv=require(_0xaa4b('0xf'));var querystring=require(_0xaa4b('0x10'));var Papa=require(_0xaa4b('0x11'));var Redis=require(_0xaa4b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xaa4b('0x13'));var as=require(_0xaa4b('0x14'));var hardwareService=require(_0xaa4b('0x15'));var logger=require('../../config/logger')(_0xaa4b('0x16'));var utils=require(_0xaa4b('0x17'));var config=require(_0xaa4b('0x18'));var licenseUtil=require(_0xaa4b('0x19'));var db=require(_0xaa4b('0x1a'))['db'];function respondWithStatusCode(_0x2b4052,_0x180906){_0x180906=_0x180906||0xcc;return function(_0x2f8248){if(_0x2f8248){return _0x2b4052[_0xaa4b('0x1b')](_0x180906);}return _0x2b4052['status'](_0x180906)[_0xaa4b('0x1c')]();};}function respondWithResult(_0x40dd89,_0x4cf123){_0x4cf123=_0x4cf123||0xc8;return function(_0x20c80f){if(_0x20c80f){return _0x40dd89['status'](_0x4cf123)[_0xaa4b('0x1d')](_0x20c80f);}};}function respondWithFilteredResult(_0xfc24d4,_0x3a8a13){return function(_0x314035){if(_0x314035){var _0x35ae5d=typeof _0x3a8a13[_0xaa4b('0x1e')]==='undefined'&&typeof _0x3a8a13[_0xaa4b('0x1f')]===_0xaa4b('0x20');var _0x1cecfe=_0x314035[_0xaa4b('0x21')];var _0x416f12=_0x35ae5d?0x0:_0x3a8a13['offset'];var _0x346dcc=_0x35ae5d?_0x314035['count']:_0x3a8a13[_0xaa4b('0x1e')]+_0x3a8a13['limit'];var _0x28bc63;if(_0x346dcc>=_0x1cecfe){_0x346dcc=_0x1cecfe;_0x28bc63=0xc8;}else{_0x28bc63=0xce;}_0xfc24d4[_0xaa4b('0x22')](_0x28bc63);return _0xfc24d4[_0xaa4b('0x23')](_0xaa4b('0x24'),_0x416f12+'-'+_0x346dcc+'/'+_0x1cecfe)[_0xaa4b('0x1d')](_0x314035);}return null;};}function patchUpdates(_0x3d6ad6){return function(_0x242aaa){try{jsonpatch[_0xaa4b('0x25')](_0x242aaa,_0x3d6ad6,!![]);}catch(_0x4beadd){return BPromise['reject'](_0x4beadd);}return _0x242aaa[_0xaa4b('0x26')]();};}function saveUpdates(_0x3daf26,_0x39666){return function(_0x4b08f6){if(_0x4b08f6){return _0x4b08f6[_0xaa4b('0x27')](_0x3daf26)[_0xaa4b('0x28')](function(_0x10a768){return _0x10a768;});}return null;};}function removeEntity(_0x186863,_0x20905f){return function(_0x1ec669){if(_0x1ec669){return _0x1ec669[_0xaa4b('0x29')]()[_0xaa4b('0x28')](function(){_0x186863['status'](0xcc)[_0xaa4b('0x1c')]();});}};}function handleEntityNotFound(_0x882460,_0x3ffc21){return function(_0x3f8eb8){if(!_0x3f8eb8){_0x882460[_0xaa4b('0x1b')](0x194);}return _0x3f8eb8;};}function handleError(_0x189573,_0x51f2f9){_0x51f2f9=_0x51f2f9||0x1f4;return function(_0x530397){logger['error'](_0x530397[_0xaa4b('0x2a')]);if(_0x530397[_0xaa4b('0x2b')]){delete _0x530397[_0xaa4b('0x2b')];}_0x189573['status'](_0x51f2f9)[_0xaa4b('0x2c')](_0x530397);};}exports[_0xaa4b('0x2d')]=function(_0x10fe2d,_0x1dca3e){var _0x3a7558={},_0x35c602={},_0x2145e6={'count':0x0,'rows':[]};var _0x2d887b=_[_0xaa4b('0x2e')](db['VoiceMailMessage'][_0xaa4b('0x2f')],function(_0x3a3060){return{'name':_0x3a3060['fieldName'],'type':_0x3a3060[_0xaa4b('0x30')]['key']};});_0x35c602[_0xaa4b('0x31')]=_[_0xaa4b('0x32')](_['map'](_0x2d887b,_0xaa4b('0x2b')),[_0xaa4b('0x2b')]);_0x35c602['query']=_['keys'](_0x10fe2d[_0xaa4b('0x33')]);_0x35c602[_0xaa4b('0x34')]=_['intersection'](_0x35c602[_0xaa4b('0x31')],_0x35c602[_0xaa4b('0x33')]);_0x3a7558['attributes']=_[_0xaa4b('0x35')](_0x35c602[_0xaa4b('0x31')],qs['fields'](_0x10fe2d[_0xaa4b('0x33')][_0xaa4b('0x36')]));_0x3a7558[_0xaa4b('0x37')]=_0x3a7558[_0xaa4b('0x37')]['length']?_0x3a7558['attributes']:_0x35c602[_0xaa4b('0x31')];if(!_0x10fe2d['query']['hasOwnProperty']('nolimit')){_0x3a7558[_0xaa4b('0x1f')]=qs[_0xaa4b('0x1f')](_0x10fe2d['query']['limit']);_0x3a7558[_0xaa4b('0x1e')]=qs[_0xaa4b('0x1e')](_0x10fe2d[_0xaa4b('0x33')][_0xaa4b('0x1e')]);}_0x3a7558[_0xaa4b('0x38')]=qs['sort'](_0x10fe2d[_0xaa4b('0x33')][_0xaa4b('0x39')]);_0x3a7558[_0xaa4b('0x3a')]=qs[_0xaa4b('0x34')](_[_0xaa4b('0x3b')](_0x10fe2d[_0xaa4b('0x33')],_0x35c602[_0xaa4b('0x34')]),_0x2d887b);if(_0x10fe2d[_0xaa4b('0x33')]['filter']){_0x3a7558[_0xaa4b('0x3a')]=_[_0xaa4b('0x3c')](_0x3a7558[_0xaa4b('0x3a')],{'$or':_[_0xaa4b('0x2e')](_0x2d887b,function(_0x310982){if(_0x310982[_0xaa4b('0x30')]!==_0xaa4b('0x3d')){var _0x423ddd={};_0x423ddd[_0x310982['name']]={'$like':'%'+_0x10fe2d[_0xaa4b('0x33')][_0xaa4b('0x3e')]+'%'};return _0x423ddd;}})});}_0x3a7558=_[_0xaa4b('0x3c')]({},_0x3a7558,_0x10fe2d[_0xaa4b('0x3f')]);var _0x890e1={'where':_0x3a7558[_0xaa4b('0x3a')]};return db[_0xaa4b('0x40')]['count'](_0x890e1)[_0xaa4b('0x28')](function(_0x16766a){_0x2145e6[_0xaa4b('0x21')]=_0x16766a;if(_0x10fe2d[_0xaa4b('0x33')][_0xaa4b('0x41')]){_0x3a7558['include']=[{'all':!![]}];}return db[_0xaa4b('0x40')][_0xaa4b('0x42')](_0x3a7558);})['then'](function(_0x2a8933){_0x2145e6[_0xaa4b('0x43')]=_0x2a8933;return _0x2145e6;})[_0xaa4b('0x28')](respondWithFilteredResult(_0x1dca3e,_0x3a7558))['catch'](handleError(_0x1dca3e,null));};exports[_0xaa4b('0x44')]=function(_0x1edfe1,_0x6bf815){var _0x1cd1c={'raw':!![],'where':{'id':_0x1edfe1[_0xaa4b('0x45')]['id']}},_0x417ce6={};_0x417ce6[_0xaa4b('0x31')]=_[_0xaa4b('0x46')](db[_0xaa4b('0x40')][_0xaa4b('0x2f')]);_0x417ce6[_0xaa4b('0x33')]=_[_0xaa4b('0x46')](_0x1edfe1[_0xaa4b('0x33')]);_0x417ce6[_0xaa4b('0x34')]=_[_0xaa4b('0x35')](_0x417ce6['model'],_0x417ce6['query']);_0x1cd1c[_0xaa4b('0x37')]=_[_0xaa4b('0x35')](_0x417ce6[_0xaa4b('0x31')],qs[_0xaa4b('0x36')](_0x1edfe1[_0xaa4b('0x33')][_0xaa4b('0x36')]));_0x1cd1c[_0xaa4b('0x37')]=_0x1cd1c[_0xaa4b('0x37')][_0xaa4b('0x47')]?_0x1cd1c[_0xaa4b('0x37')]:_0x417ce6[_0xaa4b('0x31')];if(_0x1edfe1[_0xaa4b('0x33')][_0xaa4b('0x41')]){_0x1cd1c[_0xaa4b('0x48')]=[{'all':!![]}];}_0x1cd1c=_[_0xaa4b('0x3c')]({},_0x1cd1c,_0x1edfe1[_0xaa4b('0x3f')]);return db['VoiceMailMessage']['find'](_0x1cd1c)[_0xaa4b('0x28')](handleEntityNotFound(_0x6bf815,null))[_0xaa4b('0x28')](respondWithResult(_0x6bf815,null))[_0xaa4b('0x49')](handleError(_0x6bf815,null));};exports[_0xaa4b('0x4a')]=function(_0x2004fa,_0x5ac6fd){return db[_0xaa4b('0x40')][_0xaa4b('0x4a')](_0x2004fa[_0xaa4b('0x4b')],{})['then'](respondWithResult(_0x5ac6fd,0xc9))['catch'](handleError(_0x5ac6fd,null));};exports['update']=function(_0x1b5c86,_0x2cb78a){if(_0x1b5c86[_0xaa4b('0x4b')]['id']){delete _0x1b5c86[_0xaa4b('0x4b')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x1b5c86['params']['id']}})[_0xaa4b('0x28')](handleEntityNotFound(_0x2cb78a,null))[_0xaa4b('0x28')](saveUpdates(_0x1b5c86['body'],null))[_0xaa4b('0x28')](respondWithResult(_0x2cb78a,null))[_0xaa4b('0x49')](handleError(_0x2cb78a,null));};exports[_0xaa4b('0x29')]=function(_0x341b55,_0x391f2e){return db[_0xaa4b('0x40')]['find']({'where':{'id':_0x341b55[_0xaa4b('0x45')]['id']}})[_0xaa4b('0x28')](handleEntityNotFound(_0x391f2e,null))[_0xaa4b('0x28')](removeEntity(_0x391f2e,null))['catch'](handleError(_0x391f2e,null));};exports[_0xaa4b('0x4c')]=function(_0x5dbba4,_0x1cef29,_0x21f10f){return db['VoiceMailMessage'][_0xaa4b('0x4d')]({'where':{'id':_0x5dbba4['params']['id']},'attributes':['id',_0xaa4b('0x4e'),_0xaa4b('0x4f')]})[_0xaa4b('0x28')](handleEntityNotFound(_0x1cef29,null))[_0xaa4b('0x28')](function(_0x5d3d9f){if(_0x5d3d9f){if(!_0x5d3d9f['recording']){throw new db[(_0xaa4b('0x50'))][(_0xaa4b('0x51'))](_0xaa4b('0x52'));}var _0x1a215b={'Content-Type':_0xaa4b('0x53'),'Content-Disposition':_0xaa4b('0x54')};if(_0x5d3d9f[_0xaa4b('0x4f')]){_0x1a215b[_0xaa4b('0x55')]=_0xaa4b('0x56')+_0x5d3d9f[_0xaa4b('0x4f')]+_0xaa4b('0x57');}_0x1cef29[_0xaa4b('0x23')](_0x1a215b);return _0x1cef29['send'](new Buffer(_0x5d3d9f[_0xaa4b('0x4e')]));}})[_0xaa4b('0x49')](handleError(_0x1cef29,null));};
\ No newline at end of file