Built motion from commit (unavailable).|2.5.11
[motion2.git] / server / api / voiceMail / voiceMail.controller.js
index fbaafc3..db8e800 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ad1=['../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','apply','reject','save','destroy','then','Voicemails','error','stack','name','map','VoiceMail','rawAttributes','type','key','query','keys','attributes','model','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','intersection','find','create','body','user','get','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api'];(function(_0x565454,_0x20dc1e){var _0xc0af5f=function(_0x186d0c){while(--_0x186d0c){_0x565454['push'](_0x565454['shift']());}};_0xc0af5f(++_0x20dc1e);}(_0x1ad1,0x94));var _0x11ad=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x1ad1[_0x45d3f0];return _0x314b79;};'use strict';var pdf=require(_0x11ad('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x11ad('0x1'));var zipdir=require(_0x11ad('0x2'));var jsonpatch=require(_0x11ad('0x3'));var rp=require(_0x11ad('0x4'));var moment=require(_0x11ad('0x5'));var BPromise=require(_0x11ad('0x6'));var Mustache=require(_0x11ad('0x7'));var util=require(_0x11ad('0x8'));var path=require('path');var sox=require(_0x11ad('0x9'));var csv=require(_0x11ad('0xa'));var ejs=require(_0x11ad('0xb'));var fs=require('fs');var _=require(_0x11ad('0xc'));var squel=require(_0x11ad('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x11ad('0xe'));var toCsv=require('to-csv');var querystring=require(_0x11ad('0xf'));var Papa=require(_0x11ad('0x10'));var Redis=require(_0x11ad('0x11'));var authService=require(_0x11ad('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x11ad('0x13'));var logger=require(_0x11ad('0x14'))(_0x11ad('0x15'));var utils=require(_0x11ad('0x16'));var config=require(_0x11ad('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36875c,_0x589c9a){_0x589c9a=_0x589c9a||0xcc;return function(_0x5e60b5){if(_0x5e60b5){return _0x36875c[_0x11ad('0x18')](_0x589c9a);}return _0x36875c[_0x11ad('0x19')](_0x589c9a)[_0x11ad('0x1a')]();};}function respondWithResult(_0x50189c,_0x212057){_0x212057=_0x212057||0xc8;return function(_0x587ad8){if(_0x587ad8){return _0x50189c[_0x11ad('0x19')](_0x212057)[_0x11ad('0x1b')](_0x587ad8);}};}function respondWithFilteredResult(_0x1681dd,_0x83ff0c){return function(_0x4a2363){if(_0x4a2363){var _0x319846=_0x4a2363['count'],_0x1cacf4=_0x83ff0c[_0x11ad('0x1c')],_0x4557a5=_0x83ff0c[_0x11ad('0x1c')]+_0x83ff0c[_0x11ad('0x1d')],_0x1c3bad;if(_0x4557a5>=_0x319846){_0x4557a5=_0x319846;_0x1c3bad=0xc8;}else{_0x1c3bad=0xce;}_0x1681dd[_0x11ad('0x19')](_0x1c3bad);return _0x1681dd[_0x11ad('0x1e')]('Content-Range',_0x1cacf4+'-'+_0x4557a5+'/'+_0x319846)[_0x11ad('0x1b')](_0x4a2363);}return null;};}function patchUpdates(_0x63a533){return function(_0x34a4d9){try{jsonpatch[_0x11ad('0x1f')](_0x34a4d9,_0x63a533,!![]);}catch(_0x582aa7){return BPromise[_0x11ad('0x20')](_0x582aa7);}return _0x34a4d9[_0x11ad('0x21')]();};}function saveUpdates(_0x17c04a,_0x232e07){return function(_0x5efa19){if(_0x5efa19){return _0x5efa19['update'](_0x17c04a)['then'](function(_0x49022f){return _0x49022f;});}return null;};}function removeEntity(_0x37ea1f,_0x356eb2){return function(_0xed16e7){if(_0xed16e7){return _0xed16e7[_0x11ad('0x22')]()[_0x11ad('0x23')](function(){var _0x1e2dc6=_0xed16e7['get']({'plain':!![]});var _0xfd43a3=_0x11ad('0x24');return db['UserProfileResource'][_0x11ad('0x22')]({'where':{'type':_0xfd43a3,'resourceId':_0x1e2dc6['id']}})[_0x11ad('0x23')](function(){return _0xed16e7;});})[_0x11ad('0x23')](function(){_0x37ea1f[_0x11ad('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50ceba,_0x1fd7c7){return function(_0x5b286b){if(!_0x5b286b){_0x50ceba[_0x11ad('0x18')](0x194);}return _0x5b286b;};}function handleError(_0x26d79e,_0x3e1e56){_0x3e1e56=_0x3e1e56||0x1f4;return function(_0x4e6428){logger[_0x11ad('0x25')](_0x4e6428[_0x11ad('0x26')]);if(_0x4e6428[_0x11ad('0x27')]){delete _0x4e6428[_0x11ad('0x27')];}_0x26d79e[_0x11ad('0x19')](_0x3e1e56)['send'](_0x4e6428);};}exports['index']=function(_0x120041,_0x135e23){var _0x52e93c={},_0x45c48e={},_0xbc463e={'count':0x0,'rows':[]};var _0x41614c=_[_0x11ad('0x28')](db[_0x11ad('0x29')][_0x11ad('0x2a')],function(_0x32498f){return{'name':_0x32498f['fieldName'],'type':_0x32498f[_0x11ad('0x2b')][_0x11ad('0x2c')]};});_0x45c48e['model']=_[_0x11ad('0x28')](_0x41614c,_0x11ad('0x27'));_0x45c48e[_0x11ad('0x2d')]=_[_0x11ad('0x2e')](_0x120041[_0x11ad('0x2d')]);_0x45c48e['filters']=_['intersection'](_0x45c48e['model'],_0x45c48e[_0x11ad('0x2d')]);_0x52e93c[_0x11ad('0x2f')]=_['intersection'](_0x45c48e[_0x11ad('0x30')],qs['fields'](_0x120041[_0x11ad('0x2d')][_0x11ad('0x31')]));_0x52e93c[_0x11ad('0x2f')]=_0x52e93c[_0x11ad('0x2f')][_0x11ad('0x32')]?_0x52e93c[_0x11ad('0x2f')]:_0x45c48e[_0x11ad('0x30')];if(!_0x120041[_0x11ad('0x2d')][_0x11ad('0x33')](_0x11ad('0x34'))){_0x52e93c[_0x11ad('0x1d')]=qs[_0x11ad('0x1d')](_0x120041[_0x11ad('0x2d')][_0x11ad('0x1d')]);_0x52e93c[_0x11ad('0x1c')]=qs[_0x11ad('0x1c')](_0x120041[_0x11ad('0x2d')][_0x11ad('0x1c')]);}_0x52e93c['order']=qs[_0x11ad('0x35')](_0x120041['query'][_0x11ad('0x35')]);_0x52e93c['where']=qs[_0x11ad('0x36')](_[_0x11ad('0x37')](_0x120041[_0x11ad('0x2d')],_0x45c48e[_0x11ad('0x36')]),_0x41614c);if(_0x120041[_0x11ad('0x2d')][_0x11ad('0x38')]){_0x52e93c[_0x11ad('0x39')]=_[_0x11ad('0x3a')](_0x52e93c[_0x11ad('0x39')],{'$or':_[_0x11ad('0x28')](_0x41614c,function(_0x1481cf){if(_0x1481cf[_0x11ad('0x2b')]!==_0x11ad('0x3b')){var _0x317d00={};_0x317d00[_0x1481cf[_0x11ad('0x27')]]={'$like':'%'+_0x120041[_0x11ad('0x2d')][_0x11ad('0x38')]+'%'};return _0x317d00;}})});}_0x52e93c=_['merge']({},_0x52e93c,_0x120041[_0x11ad('0x3c')]);var _0x5eb4b0={'where':_0x52e93c[_0x11ad('0x39')]};return db[_0x11ad('0x29')][_0x11ad('0x3d')](_0x5eb4b0)[_0x11ad('0x23')](function(_0x47a51b){_0xbc463e[_0x11ad('0x3d')]=_0x47a51b;if(_0x120041[_0x11ad('0x2d')][_0x11ad('0x3e')]){_0x52e93c[_0x11ad('0x3f')]=[{'all':!![]}];}return db[_0x11ad('0x29')][_0x11ad('0x40')](_0x52e93c);})[_0x11ad('0x23')](function(_0x988eed){_0xbc463e[_0x11ad('0x41')]=_0x988eed;return _0xbc463e;})[_0x11ad('0x23')](respondWithFilteredResult(_0x135e23,_0x52e93c))['catch'](handleError(_0x135e23,null));};exports[_0x11ad('0x42')]=function(_0x3adaaa,_0x34bd86){var _0x37687e={'raw':!![],'where':{'id':_0x3adaaa[_0x11ad('0x43')]['id']}},_0x404bfd={};_0x404bfd[_0x11ad('0x30')]=_[_0x11ad('0x2e')](db[_0x11ad('0x29')][_0x11ad('0x2a')]);_0x404bfd[_0x11ad('0x2d')]=_[_0x11ad('0x2e')](_0x3adaaa['query']);_0x404bfd[_0x11ad('0x36')]=_['intersection'](_0x404bfd[_0x11ad('0x30')],_0x404bfd['query']);_0x37687e[_0x11ad('0x2f')]=_[_0x11ad('0x44')](_0x404bfd[_0x11ad('0x30')],qs[_0x11ad('0x31')](_0x3adaaa[_0x11ad('0x2d')][_0x11ad('0x31')]));_0x37687e['attributes']=_0x37687e[_0x11ad('0x2f')][_0x11ad('0x32')]?_0x37687e['attributes']:_0x404bfd[_0x11ad('0x30')];if(_0x3adaaa[_0x11ad('0x2d')][_0x11ad('0x3e')]){_0x37687e[_0x11ad('0x3f')]=[{'all':!![]}];}_0x37687e=_['merge']({},_0x37687e,_0x3adaaa['options']);return db['VoiceMail'][_0x11ad('0x45')](_0x37687e)['then'](handleEntityNotFound(_0x34bd86,null))['then'](respondWithResult(_0x34bd86,null))['catch'](handleError(_0x34bd86,null));};exports['create']=function(_0x3531c1,_0x42e4d4){return db[_0x11ad('0x29')][_0x11ad('0x46')](_0x3531c1[_0x11ad('0x47')],{})[_0x11ad('0x23')](function(_0x287d89){var _0x382d85=_0x3531c1['user']['get']({'plain':!![]});if(!_0x382d85)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x382d85['role']===_0x11ad('0x48')){var _0x3bd394=_0x287d89[_0x11ad('0x49')]({'plain':!![]});var _0x238ede='Voicemails';return db['UserProfileSection'][_0x11ad('0x45')]({'where':{'name':_0x238ede,'userProfileId':_0x382d85[_0x11ad('0x4a')]},'raw':!![]})['then'](function(_0x2cd9f1){if(_0x2cd9f1&&_0x2cd9f1[_0x11ad('0x4b')]===0x0){return db[_0x11ad('0x4c')][_0x11ad('0x46')]({'name':_0x3bd394[_0x11ad('0x27')],'resourceId':_0x3bd394['id'],'type':_0x2cd9f1[_0x11ad('0x27')],'sectionId':_0x2cd9f1['id']},{})[_0x11ad('0x23')](function(){return _0x287d89;});}else{return _0x287d89;}})[_0x11ad('0x4d')](function(_0x80cba7){logger[_0x11ad('0x25')](_0x11ad('0x4e'),_0x80cba7);throw _0x80cba7;});}return _0x287d89;})['then'](respondWithResult(_0x42e4d4,0xc9))[_0x11ad('0x4d')](handleError(_0x42e4d4,null));};exports[_0x11ad('0x4f')]=function(_0x2add92,_0x40e267){if(_0x2add92[_0x11ad('0x47')]['id']){delete _0x2add92['body']['id'];}return db[_0x11ad('0x29')][_0x11ad('0x45')]({'where':{'id':_0x2add92[_0x11ad('0x43')]['id']}})[_0x11ad('0x23')](handleEntityNotFound(_0x40e267,null))[_0x11ad('0x23')](saveUpdates(_0x2add92[_0x11ad('0x47')],null))['then'](respondWithResult(_0x40e267,null))[_0x11ad('0x4d')](handleError(_0x40e267,null));};exports[_0x11ad('0x22')]=function(_0x59c714,_0x41481d){return db[_0x11ad('0x29')][_0x11ad('0x45')]({'where':{'id':_0x59c714[_0x11ad('0x43')]['id']}})[_0x11ad('0x23')](handleEntityNotFound(_0x41481d,null))[_0x11ad('0x23')](removeEntity(_0x41481d,null))['catch'](handleError(_0x41481d,null));};exports[_0x11ad('0x50')]=function(_0x1ad846,_0x56a3a5,_0x3c668f){return db['VoiceMail'][_0x11ad('0x51')]({'where':{'id':_0x1ad846[_0x11ad('0x43')]['id']}})[_0x11ad('0x23')](handleEntityNotFound(_0x56a3a5,null))[_0x11ad('0x23')](function(_0x48ebc5){var _0x349eb6;var _0x1ea1ad={},_0x6dbeb5={};_0x6dbeb5[_0x11ad('0x30')]=_[_0x11ad('0x2e')](db[_0x11ad('0x52')][_0x11ad('0x2a')]);_0x6dbeb5['query']=_[_0x11ad('0x2e')](_0x1ad846['query']);_0x6dbeb5['filters']=_[_0x11ad('0x44')](_0x6dbeb5[_0x11ad('0x30')],_0x6dbeb5[_0x11ad('0x2d')]);_0x1ea1ad[_0x11ad('0x2f')]=_[_0x11ad('0x44')](_0x6dbeb5[_0x11ad('0x30')],qs[_0x11ad('0x31')](_0x1ad846[_0x11ad('0x2d')][_0x11ad('0x31')]));_0x1ea1ad[_0x11ad('0x2f')]=_0x1ea1ad['attributes'][_0x11ad('0x32')]?_0x1ea1ad['attributes']:_0x6dbeb5[_0x11ad('0x30')];if(!_0x1ad846['query'][_0x11ad('0x33')](_0x11ad('0x34'))){_0x1ea1ad[_0x11ad('0x1d')]=qs[_0x11ad('0x1d')](_0x1ad846[_0x11ad('0x2d')][_0x11ad('0x1d')]);_0x1ea1ad[_0x11ad('0x1c')]=qs['offset'](_0x1ad846[_0x11ad('0x2d')][_0x11ad('0x1c')]);}_0x1ea1ad['order']=qs[_0x11ad('0x35')](_0x1ad846[_0x11ad('0x2d')][_0x11ad('0x35')]);_0x1ea1ad[_0x11ad('0x39')]=qs[_0x11ad('0x36')](_[_0x11ad('0x37')](_0x1ad846[_0x11ad('0x2d')],_0x6dbeb5['filters']));if(_0x1ad846[_0x11ad('0x2d')][_0x11ad('0x38')]){_0x1ea1ad[_0x11ad('0x39')]=_[_0x11ad('0x3a')](_0x1ea1ad[_0x11ad('0x39')],{'$or':_[_0x11ad('0x28')](_0x1ea1ad['attributes'],function(_0x316d89){var _0x1b5493={};_0x1b5493[_0x316d89]={'$like':'%'+_0x1ad846[_0x11ad('0x2d')]['filter']+'%'};return _0x1b5493;})});}_0x1ea1ad[_0x11ad('0x39')]=_[_0x11ad('0x3a')](_0x1ea1ad[_0x11ad('0x39')],{'mailboxuser':_0x48ebc5[_0x11ad('0x53')]});_0x1ea1ad=_[_0x11ad('0x3a')]({},_0x1ea1ad,_0x1ad846[_0x11ad('0x3c')]);return db[_0x11ad('0x52')][_0x11ad('0x54')](_0x1ea1ad)[_0x11ad('0x23')](respondWithFilteredResult(_0x56a3a5,_0x1ea1ad));})[_0x11ad('0x4d')](handleError(_0x56a3a5,null));};
\ No newline at end of file
+var _0x8ed7=['apply','reject','save','update','then','get','Voicemails','UserProfileResource','destroy','stack','name','status','send','index','map','VoiceMail','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','include','rows','catch','params','rawAttributes','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','hasOwnProperty','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','count','offset','limit','set','Content-Range'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x8ed7,0x8b));var _0x78ed=function(_0x3271b5,_0x422fbc){_0x3271b5=_0x3271b5-0x0;var _0x2fb6ce=_0x8ed7[_0x3271b5];return _0x2fb6ce;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x78ed('0x0'));var rimraf=require(_0x78ed('0x1'));var zipdir=require(_0x78ed('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x78ed('0x3'));var BPromise=require(_0x78ed('0x4'));var Mustache=require(_0x78ed('0x5'));var util=require(_0x78ed('0x6'));var path=require(_0x78ed('0x7'));var sox=require(_0x78ed('0x8'));var csv=require(_0x78ed('0x9'));var ejs=require(_0x78ed('0xa'));var fs=require('fs');var _=require(_0x78ed('0xb'));var squel=require('squel');var crypto=require(_0x78ed('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x78ed('0xd'));var toCsv=require('to-csv');var querystring=require(_0x78ed('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x78ed('0xf'));var qs=require(_0x78ed('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x78ed('0x11'));var logger=require(_0x78ed('0x12'))('api');var utils=require(_0x78ed('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x78ed('0x14'));var db=require(_0x78ed('0x15'))['db'];function respondWithStatusCode(_0x3ec02d,_0x2cb17b){_0x2cb17b=_0x2cb17b||0xcc;return function(_0x1a5254){if(_0x1a5254){return _0x3ec02d[_0x78ed('0x16')](_0x2cb17b);}return _0x3ec02d['status'](_0x2cb17b)[_0x78ed('0x17')]();};}function respondWithResult(_0x4b97ba,_0x538306){_0x538306=_0x538306||0xc8;return function(_0x510322){if(_0x510322){return _0x4b97ba['status'](_0x538306)['json'](_0x510322);}};}function respondWithFilteredResult(_0x2e88ad,_0x272171){return function(_0x2e9007){if(_0x2e9007){var _0x195b7e=_0x2e9007[_0x78ed('0x18')],_0x250d59=_0x272171[_0x78ed('0x19')],_0x454a65=_0x272171[_0x78ed('0x19')]+_0x272171[_0x78ed('0x1a')],_0x336ae1;if(_0x454a65>=_0x195b7e){_0x454a65=_0x195b7e;_0x336ae1=0xc8;}else{_0x336ae1=0xce;}_0x2e88ad['status'](_0x336ae1);return _0x2e88ad[_0x78ed('0x1b')](_0x78ed('0x1c'),_0x250d59+'-'+_0x454a65+'/'+_0x195b7e)['json'](_0x2e9007);}return null;};}function patchUpdates(_0x47eb69){return function(_0x2868d1){try{jsonpatch[_0x78ed('0x1d')](_0x2868d1,_0x47eb69,!![]);}catch(_0x2e9e1d){return BPromise[_0x78ed('0x1e')](_0x2e9e1d);}return _0x2868d1[_0x78ed('0x1f')]();};}function saveUpdates(_0x3bd736,_0x3479ec){return function(_0xf0eeee){if(_0xf0eeee){return _0xf0eeee[_0x78ed('0x20')](_0x3bd736)[_0x78ed('0x21')](function(_0x1badbe){return _0x1badbe;});}return null;};}function removeEntity(_0x4f1edb,_0x5ee188){return function(_0x425310){if(_0x425310){return _0x425310['destroy']()[_0x78ed('0x21')](function(){var _0x55f0e8=_0x425310[_0x78ed('0x22')]({'plain':!![]});var _0x590d90=_0x78ed('0x23');return db[_0x78ed('0x24')][_0x78ed('0x25')]({'where':{'type':_0x590d90,'resourceId':_0x55f0e8['id']}})['then'](function(){return _0x425310;});})[_0x78ed('0x21')](function(){_0x4f1edb['status'](0xcc)[_0x78ed('0x17')]();});}};}function handleEntityNotFound(_0x2a4573,_0x34fb0e){return function(_0x59349a){if(!_0x59349a){_0x2a4573['sendStatus'](0x194);}return _0x59349a;};}function handleError(_0x464050,_0x575b6e){_0x575b6e=_0x575b6e||0x1f4;return function(_0x1887df){logger['error'](_0x1887df[_0x78ed('0x26')]);if(_0x1887df[_0x78ed('0x27')]){delete _0x1887df[_0x78ed('0x27')];}_0x464050[_0x78ed('0x28')](_0x575b6e)[_0x78ed('0x29')](_0x1887df);};}exports[_0x78ed('0x2a')]=function(_0x3cd100,_0x312801){var _0x10ea7d={},_0x4f6cdd={},_0x246d17={'count':0x0,'rows':[]};var _0x9b1ba6=_[_0x78ed('0x2b')](db[_0x78ed('0x2c')]['rawAttributes'],function(_0x4a8a5e){return{'name':_0x4a8a5e['fieldName'],'type':_0x4a8a5e['type'][_0x78ed('0x2d')]};});_0x4f6cdd[_0x78ed('0x2e')]=_[_0x78ed('0x2b')](_0x9b1ba6,_0x78ed('0x27'));_0x4f6cdd[_0x78ed('0x2f')]=_[_0x78ed('0x30')](_0x3cd100[_0x78ed('0x2f')]);_0x4f6cdd['filters']=_[_0x78ed('0x31')](_0x4f6cdd['model'],_0x4f6cdd[_0x78ed('0x2f')]);_0x10ea7d[_0x78ed('0x32')]=_['intersection'](_0x4f6cdd[_0x78ed('0x2e')],qs[_0x78ed('0x33')](_0x3cd100[_0x78ed('0x2f')][_0x78ed('0x33')]));_0x10ea7d[_0x78ed('0x32')]=_0x10ea7d[_0x78ed('0x32')][_0x78ed('0x34')]?_0x10ea7d[_0x78ed('0x32')]:_0x4f6cdd['model'];if(!_0x3cd100[_0x78ed('0x2f')]['hasOwnProperty'](_0x78ed('0x35'))){_0x10ea7d[_0x78ed('0x1a')]=qs[_0x78ed('0x1a')](_0x3cd100[_0x78ed('0x2f')][_0x78ed('0x1a')]);_0x10ea7d[_0x78ed('0x19')]=qs[_0x78ed('0x19')](_0x3cd100['query'][_0x78ed('0x19')]);}_0x10ea7d[_0x78ed('0x36')]=qs[_0x78ed('0x37')](_0x3cd100[_0x78ed('0x2f')][_0x78ed('0x37')]);_0x10ea7d[_0x78ed('0x38')]=qs[_0x78ed('0x39')](_[_0x78ed('0x3a')](_0x3cd100[_0x78ed('0x2f')],_0x4f6cdd[_0x78ed('0x39')]),_0x9b1ba6);if(_0x3cd100[_0x78ed('0x2f')]['filter']){_0x10ea7d['where']=_[_0x78ed('0x3b')](_0x10ea7d['where'],{'$or':_[_0x78ed('0x2b')](_0x9b1ba6,function(_0x4006fd){if(_0x4006fd['type']!==_0x78ed('0x3c')){var _0x1149c0={};_0x1149c0[_0x4006fd[_0x78ed('0x27')]]={'$like':'%'+_0x3cd100[_0x78ed('0x2f')][_0x78ed('0x3d')]+'%'};return _0x1149c0;}})});}_0x10ea7d=_[_0x78ed('0x3b')]({},_0x10ea7d,_0x3cd100['options']);var _0x5c64e4={'where':_0x10ea7d[_0x78ed('0x38')]};return db[_0x78ed('0x2c')][_0x78ed('0x18')](_0x5c64e4)['then'](function(_0x4f0db5){_0x246d17[_0x78ed('0x18')]=_0x4f0db5;if(_0x3cd100[_0x78ed('0x2f')]['includeAll']){_0x10ea7d[_0x78ed('0x3e')]=[{'all':!![]}];}return db[_0x78ed('0x2c')]['findAll'](_0x10ea7d);})['then'](function(_0xbd96b1){_0x246d17[_0x78ed('0x3f')]=_0xbd96b1;return _0x246d17;})[_0x78ed('0x21')](respondWithFilteredResult(_0x312801,_0x10ea7d))[_0x78ed('0x40')](handleError(_0x312801,null));};exports['show']=function(_0x5c42fe,_0x4ebdd6){var _0x1e1dbd={'raw':!![],'where':{'id':_0x5c42fe[_0x78ed('0x41')]['id']}},_0x547a75={};_0x547a75['model']=_[_0x78ed('0x30')](db[_0x78ed('0x2c')][_0x78ed('0x42')]);_0x547a75[_0x78ed('0x2f')]=_[_0x78ed('0x30')](_0x5c42fe['query']);_0x547a75[_0x78ed('0x39')]=_[_0x78ed('0x31')](_0x547a75[_0x78ed('0x2e')],_0x547a75[_0x78ed('0x2f')]);_0x1e1dbd[_0x78ed('0x32')]=_['intersection'](_0x547a75['model'],qs[_0x78ed('0x33')](_0x5c42fe[_0x78ed('0x2f')][_0x78ed('0x33')]));_0x1e1dbd[_0x78ed('0x32')]=_0x1e1dbd['attributes'][_0x78ed('0x34')]?_0x1e1dbd[_0x78ed('0x32')]:_0x547a75[_0x78ed('0x2e')];if(_0x5c42fe[_0x78ed('0x2f')][_0x78ed('0x43')]){_0x1e1dbd[_0x78ed('0x3e')]=[{'all':!![]}];}_0x1e1dbd=_['merge']({},_0x1e1dbd,_0x5c42fe[_0x78ed('0x44')]);return db['VoiceMail'][_0x78ed('0x45')](_0x1e1dbd)['then'](handleEntityNotFound(_0x4ebdd6,null))[_0x78ed('0x21')](respondWithResult(_0x4ebdd6,null))[_0x78ed('0x40')](handleError(_0x4ebdd6,null));};exports[_0x78ed('0x46')]=function(_0x275924,_0x329e1d){return db['VoiceMail']['create'](_0x275924[_0x78ed('0x47')],{})[_0x78ed('0x21')](function(_0x39da99){var _0x4c68f1=_0x275924[_0x78ed('0x48')][_0x78ed('0x22')]({'plain':!![]});if(!_0x4c68f1)throw new Error(_0x78ed('0x49'));if(_0x4c68f1['role']==='user'){var _0x338f48=_0x39da99['get']({'plain':!![]});var _0x1a79df=_0x78ed('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x1a79df,'userProfileId':_0x4c68f1[_0x78ed('0x4a')]},'raw':!![]})[_0x78ed('0x21')](function(_0x4ac75c){if(_0x4ac75c&&_0x4ac75c[_0x78ed('0x4b')]===0x0){return db[_0x78ed('0x24')][_0x78ed('0x46')]({'name':_0x338f48[_0x78ed('0x27')],'resourceId':_0x338f48['id'],'type':_0x4ac75c[_0x78ed('0x27')],'sectionId':_0x4ac75c['id']},{})[_0x78ed('0x21')](function(){return _0x39da99;});}else{return _0x39da99;}})[_0x78ed('0x40')](function(_0x25920b){logger[_0x78ed('0x4c')](_0x78ed('0x4d'),_0x25920b);throw _0x25920b;});}return _0x39da99;})[_0x78ed('0x21')](respondWithResult(_0x329e1d,0xc9))['catch'](handleError(_0x329e1d,null));};exports[_0x78ed('0x20')]=function(_0x2ff779,_0x540a2d){if(_0x2ff779[_0x78ed('0x47')]['id']){delete _0x2ff779[_0x78ed('0x47')]['id'];}return db[_0x78ed('0x2c')][_0x78ed('0x45')]({'where':{'id':_0x2ff779[_0x78ed('0x41')]['id']}})['then'](handleEntityNotFound(_0x540a2d,null))[_0x78ed('0x21')](saveUpdates(_0x2ff779['body'],null))[_0x78ed('0x21')](respondWithResult(_0x540a2d,null))[_0x78ed('0x40')](handleError(_0x540a2d,null));};exports[_0x78ed('0x25')]=function(_0x3eae51,_0x3d5862){return db[_0x78ed('0x2c')]['find']({'where':{'id':_0x3eae51['params']['id']}})[_0x78ed('0x21')](handleEntityNotFound(_0x3d5862,null))['then'](removeEntity(_0x3d5862,null))[_0x78ed('0x40')](handleError(_0x3d5862,null));};exports[_0x78ed('0x4e')]=function(_0x2afe98,_0x369a3b,_0x5658b5){return db[_0x78ed('0x2c')][_0x78ed('0x4f')]({'where':{'id':_0x2afe98[_0x78ed('0x41')]['id']}})[_0x78ed('0x21')](handleEntityNotFound(_0x369a3b,null))[_0x78ed('0x21')](function(_0x53709d){var _0x5df4f6;var _0x2feb17={},_0x39d7b8={};_0x39d7b8['model']=_[_0x78ed('0x30')](db[_0x78ed('0x50')][_0x78ed('0x42')]);_0x39d7b8['query']=_[_0x78ed('0x30')](_0x2afe98['query']);_0x39d7b8[_0x78ed('0x39')]=_['intersection'](_0x39d7b8['model'],_0x39d7b8[_0x78ed('0x2f')]);_0x2feb17[_0x78ed('0x32')]=_[_0x78ed('0x31')](_0x39d7b8[_0x78ed('0x2e')],qs[_0x78ed('0x33')](_0x2afe98[_0x78ed('0x2f')][_0x78ed('0x33')]));_0x2feb17[_0x78ed('0x32')]=_0x2feb17[_0x78ed('0x32')][_0x78ed('0x34')]?_0x2feb17[_0x78ed('0x32')]:_0x39d7b8[_0x78ed('0x2e')];if(!_0x2afe98['query'][_0x78ed('0x51')](_0x78ed('0x35'))){_0x2feb17[_0x78ed('0x1a')]=qs['limit'](_0x2afe98['query'][_0x78ed('0x1a')]);_0x2feb17[_0x78ed('0x19')]=qs[_0x78ed('0x19')](_0x2afe98[_0x78ed('0x2f')][_0x78ed('0x19')]);}_0x2feb17['order']=qs[_0x78ed('0x37')](_0x2afe98[_0x78ed('0x2f')][_0x78ed('0x37')]);_0x2feb17['where']=qs[_0x78ed('0x39')](_[_0x78ed('0x3a')](_0x2afe98[_0x78ed('0x2f')],_0x39d7b8[_0x78ed('0x39')]));if(_0x2afe98[_0x78ed('0x2f')][_0x78ed('0x3d')]){_0x2feb17[_0x78ed('0x38')]=_[_0x78ed('0x3b')](_0x2feb17[_0x78ed('0x38')],{'$or':_['map'](_0x2feb17[_0x78ed('0x32')],function(_0x413c35){var _0x3fa09e={};_0x3fa09e[_0x413c35]={'$like':'%'+_0x2afe98[_0x78ed('0x2f')][_0x78ed('0x3d')]+'%'};return _0x3fa09e;})});}_0x2feb17[_0x78ed('0x38')]=_[_0x78ed('0x3b')](_0x2feb17['where'],{'mailboxuser':_0x53709d[_0x78ed('0x52')]});_0x2feb17=_[_0x78ed('0x3b')]({},_0x2feb17,_0x2afe98[_0x78ed('0x44')]);return db['VoiceMailMessage'][_0x78ed('0x53')](_0x2feb17)[_0x78ed('0x21')](respondWithFilteredResult(_0x369a3b,_0x2feb17));})[_0x78ed('0x40')](handleError(_0x369a3b,null));};
\ No newline at end of file