Built motion from commit ddca4d0d.|2.5.47
[motion2.git] / server / api / voiceMail / voiceMail.controller.js
index ea3f340..0223b69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacc6=['fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','count','offset','limit','Content-Range','update','then','destroy','Voicemails','UserProfileResource','sendStatus','error','name','send','index','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','VoiceMail','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','order','pick','mailbox','VoiceMailMessage','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x20f08b,_0x646ea0){var _0x675062=function(_0x266c20){while(--_0x266c20){_0x20f08b['push'](_0x20f08b['shift']());}};_0x675062(++_0x646ea0);}(_0xacc6,0x150));var _0x6acc=function(_0x57486e,_0x32283b){_0x57486e=_0x57486e-0x0;var _0x5f110b=_0xacc6[_0x57486e];return _0x5f110b;};'use strict';var pdf=require(_0x6acc('0x0'));var emlformat=require(_0x6acc('0x1'));var rimraf=require(_0x6acc('0x2'));var zipdir=require(_0x6acc('0x3'));var jsonpatch=require(_0x6acc('0x4'));var rp=require('request-promise');var moment=require(_0x6acc('0x5'));var BPromise=require(_0x6acc('0x6'));var Mustache=require(_0x6acc('0x7'));var util=require('util');var path=require(_0x6acc('0x8'));var sox=require('sox');var csv=require(_0x6acc('0x9'));var ejs=require(_0x6acc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6acc('0xb'));var crypto=require('crypto');var jsforce=require(_0x6acc('0xc'));var deskjs=require(_0x6acc('0xd'));var toCsv=require(_0x6acc('0x9'));var querystring=require(_0x6acc('0xe'));var Papa=require('papaparse');var Redis=require(_0x6acc('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6acc('0x10'));var as=require(_0x6acc('0x11'));var hardwareService=require(_0x6acc('0x12'));var logger=require(_0x6acc('0x13'))(_0x6acc('0x14'));var utils=require(_0x6acc('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6acc('0x16'));var db=require(_0x6acc('0x17'))['db'];function respondWithStatusCode(_0x1d951c,_0xcf8224){_0xcf8224=_0xcf8224||0xcc;return function(_0x1b95a6){if(_0x1b95a6){return _0x1d951c['sendStatus'](_0xcf8224);}return _0x1d951c['status'](_0xcf8224)[_0x6acc('0x18')]();};}function respondWithResult(_0x497356,_0x14a543){_0x14a543=_0x14a543||0xc8;return function(_0x230318){if(_0x230318){return _0x497356[_0x6acc('0x19')](_0x14a543)[_0x6acc('0x1a')](_0x230318);}};}function respondWithFilteredResult(_0x3c4e61,_0x4034fb){return function(_0xf24527){if(_0xf24527){var _0xc07208=_0xf24527[_0x6acc('0x1b')],_0x1fe0ac=_0x4034fb[_0x6acc('0x1c')],_0x14312b=_0x4034fb[_0x6acc('0x1c')]+_0x4034fb[_0x6acc('0x1d')],_0x31c4c2;if(_0x14312b>=_0xc07208){_0x14312b=_0xc07208;_0x31c4c2=0xc8;}else{_0x31c4c2=0xce;}_0x3c4e61[_0x6acc('0x19')](_0x31c4c2);return _0x3c4e61['set'](_0x6acc('0x1e'),_0x1fe0ac+'-'+_0x14312b+'/'+_0xc07208)[_0x6acc('0x1a')](_0xf24527);}return null;};}function patchUpdates(_0x37a627){return function(_0x151282){try{jsonpatch['apply'](_0x151282,_0x37a627,!![]);}catch(_0x342043){return BPromise['reject'](_0x342043);}return _0x151282['save']();};}function saveUpdates(_0x4af9e,_0x5d5382){return function(_0x4552c7){if(_0x4552c7){return _0x4552c7[_0x6acc('0x1f')](_0x4af9e)[_0x6acc('0x20')](function(_0xc6e63f){return _0xc6e63f;});}return null;};}function removeEntity(_0x245536,_0x5ecb25){return function(_0x3e4a71){if(_0x3e4a71){return _0x3e4a71[_0x6acc('0x21')]()['then'](function(){var _0x334416=_0x3e4a71['get']({'plain':!![]});var _0x22abf1=_0x6acc('0x22');return db[_0x6acc('0x23')][_0x6acc('0x21')]({'where':{'type':_0x22abf1,'resourceId':_0x334416['id']}})['then'](function(){return _0x3e4a71;});})[_0x6acc('0x20')](function(){_0x245536[_0x6acc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10f286,_0x1cec1e){return function(_0x441f90){if(!_0x441f90){_0x10f286[_0x6acc('0x24')](0x194);}return _0x441f90;};}function handleError(_0x212bde,_0x472220){_0x472220=_0x472220||0x1f4;return function(_0x31b849){logger[_0x6acc('0x25')](_0x31b849['stack']);if(_0x31b849[_0x6acc('0x26')]){delete _0x31b849[_0x6acc('0x26')];}_0x212bde[_0x6acc('0x19')](_0x472220)[_0x6acc('0x27')](_0x31b849);};}exports[_0x6acc('0x28')]=function(_0x8e75a9,_0x3c8c95){var _0x259373={},_0x19fdd3={},_0x3ed9a2={'count':0x0,'rows':[]};var _0x4b6498=_['map'](db['VoiceMail']['rawAttributes'],function(_0x1658fb){return{'name':_0x1658fb[_0x6acc('0x29')],'type':_0x1658fb[_0x6acc('0x2a')][_0x6acc('0x2b')]};});_0x19fdd3[_0x6acc('0x2c')]=_[_0x6acc('0x2d')](_0x4b6498,'name');_0x19fdd3['query']=_[_0x6acc('0x2e')](_0x8e75a9[_0x6acc('0x2f')]);_0x19fdd3[_0x6acc('0x30')]=_[_0x6acc('0x31')](_0x19fdd3['model'],_0x19fdd3[_0x6acc('0x2f')]);_0x259373[_0x6acc('0x32')]=_['intersection'](_0x19fdd3[_0x6acc('0x2c')],qs[_0x6acc('0x33')](_0x8e75a9[_0x6acc('0x2f')]['fields']));_0x259373['attributes']=_0x259373[_0x6acc('0x32')][_0x6acc('0x34')]?_0x259373['attributes']:_0x19fdd3['model'];if(!_0x8e75a9[_0x6acc('0x2f')][_0x6acc('0x35')](_0x6acc('0x36'))){_0x259373['limit']=qs[_0x6acc('0x1d')](_0x8e75a9[_0x6acc('0x2f')][_0x6acc('0x1d')]);_0x259373[_0x6acc('0x1c')]=qs[_0x6acc('0x1c')](_0x8e75a9['query'][_0x6acc('0x1c')]);}_0x259373['order']=qs[_0x6acc('0x37')](_0x8e75a9[_0x6acc('0x2f')]['sort']);_0x259373[_0x6acc('0x38')]=qs['filters'](_['pick'](_0x8e75a9[_0x6acc('0x2f')],_0x19fdd3[_0x6acc('0x30')]),_0x4b6498);if(_0x8e75a9[_0x6acc('0x2f')]['filter']){_0x259373[_0x6acc('0x38')]=_['merge'](_0x259373[_0x6acc('0x38')],{'$or':_['map'](_0x4b6498,function(_0x1c1eda){if(_0x1c1eda[_0x6acc('0x2a')]!=='VIRTUAL'){var _0x14279b={};_0x14279b[_0x1c1eda[_0x6acc('0x26')]]={'$like':'%'+_0x8e75a9[_0x6acc('0x2f')][_0x6acc('0x39')]+'%'};return _0x14279b;}})});}_0x259373=_[_0x6acc('0x3a')]({},_0x259373,_0x8e75a9[_0x6acc('0x3b')]);var _0x6032ec={'where':_0x259373['where']};return db['VoiceMail'][_0x6acc('0x1b')](_0x6032ec)[_0x6acc('0x20')](function(_0x11b0b1){_0x3ed9a2['count']=_0x11b0b1;if(_0x8e75a9[_0x6acc('0x2f')][_0x6acc('0x3c')]){_0x259373[_0x6acc('0x3d')]=[{'all':!![]}];}return db[_0x6acc('0x3e')][_0x6acc('0x3f')](_0x259373);})[_0x6acc('0x20')](function(_0x2cceb0){_0x3ed9a2[_0x6acc('0x40')]=_0x2cceb0;return _0x3ed9a2;})[_0x6acc('0x20')](respondWithFilteredResult(_0x3c8c95,_0x259373))[_0x6acc('0x41')](handleError(_0x3c8c95,null));};exports[_0x6acc('0x42')]=function(_0x17f828,_0x5c938d){var _0x4df1e2={'raw':!![],'where':{'id':_0x17f828[_0x6acc('0x43')]['id']}},_0x5f4b88={};_0x5f4b88['model']=_['keys'](db[_0x6acc('0x3e')][_0x6acc('0x44')]);_0x5f4b88[_0x6acc('0x2f')]=_[_0x6acc('0x2e')](_0x17f828[_0x6acc('0x2f')]);_0x5f4b88[_0x6acc('0x30')]=_[_0x6acc('0x31')](_0x5f4b88[_0x6acc('0x2c')],_0x5f4b88[_0x6acc('0x2f')]);_0x4df1e2[_0x6acc('0x32')]=_[_0x6acc('0x31')](_0x5f4b88[_0x6acc('0x2c')],qs[_0x6acc('0x33')](_0x17f828['query'][_0x6acc('0x33')]));_0x4df1e2[_0x6acc('0x32')]=_0x4df1e2['attributes'][_0x6acc('0x34')]?_0x4df1e2['attributes']:_0x5f4b88[_0x6acc('0x2c')];if(_0x17f828[_0x6acc('0x2f')]['includeAll']){_0x4df1e2[_0x6acc('0x3d')]=[{'all':!![]}];}_0x4df1e2=_[_0x6acc('0x3a')]({},_0x4df1e2,_0x17f828[_0x6acc('0x3b')]);return db[_0x6acc('0x3e')][_0x6acc('0x45')](_0x4df1e2)['then'](handleEntityNotFound(_0x5c938d,null))[_0x6acc('0x20')](respondWithResult(_0x5c938d,null))[_0x6acc('0x41')](handleError(_0x5c938d,null));};exports[_0x6acc('0x46')]=function(_0x40c879,_0x3e05ae){return db[_0x6acc('0x3e')][_0x6acc('0x46')](_0x40c879[_0x6acc('0x47')],{})[_0x6acc('0x20')](function(_0x28e601){var _0x1989a6=_0x40c879[_0x6acc('0x48')][_0x6acc('0x49')]({'plain':!![]});if(!_0x1989a6)throw new Error(_0x6acc('0x4a'));if(_0x1989a6[_0x6acc('0x4b')]===_0x6acc('0x48')){var _0x168b5f=_0x28e601['get']({'plain':!![]});var _0x5ab4af='Voicemails';return db[_0x6acc('0x4c')][_0x6acc('0x45')]({'where':{'name':_0x5ab4af,'userProfileId':_0x1989a6['userProfileId']},'raw':!![]})[_0x6acc('0x20')](function(_0x16508d){if(_0x16508d&&_0x16508d[_0x6acc('0x4d')]===0x0){return db[_0x6acc('0x23')]['create']({'name':_0x168b5f[_0x6acc('0x26')],'resourceId':_0x168b5f['id'],'type':_0x16508d[_0x6acc('0x26')],'sectionId':_0x16508d['id']},{})[_0x6acc('0x20')](function(){return _0x28e601;});}else{return _0x28e601;}})[_0x6acc('0x41')](function(_0x459b99){logger['error'](_0x6acc('0x4e'),_0x459b99);throw _0x459b99;});}return _0x28e601;})[_0x6acc('0x20')](respondWithResult(_0x3e05ae,0xc9))[_0x6acc('0x41')](handleError(_0x3e05ae,null));};exports['update']=function(_0x13dfc2,_0x258e81){if(_0x13dfc2[_0x6acc('0x47')]['id']){delete _0x13dfc2[_0x6acc('0x47')]['id'];}return db['VoiceMail'][_0x6acc('0x45')]({'where':{'id':_0x13dfc2[_0x6acc('0x43')]['id']}})['then'](handleEntityNotFound(_0x258e81,null))[_0x6acc('0x20')](saveUpdates(_0x13dfc2['body'],null))['then'](respondWithResult(_0x258e81,null))[_0x6acc('0x41')](handleError(_0x258e81,null));};exports[_0x6acc('0x21')]=function(_0x40034c,_0x508f79){return db['VoiceMail'][_0x6acc('0x45')]({'where':{'id':_0x40034c[_0x6acc('0x43')]['id']}})['then'](handleEntityNotFound(_0x508f79,null))[_0x6acc('0x20')](removeEntity(_0x508f79,null))[_0x6acc('0x41')](handleError(_0x508f79,null));};exports[_0x6acc('0x4f')]=function(_0x396d46,_0x175b16,_0x1e9213){return db[_0x6acc('0x3e')]['findOne']({'where':{'id':_0x396d46['params']['id']}})['then'](handleEntityNotFound(_0x175b16,null))[_0x6acc('0x20')](function(_0x43d3d){var _0x493bb9;var _0x115adf={},_0x1ae92a={};_0x1ae92a['model']=_[_0x6acc('0x2e')](db['VoiceMailMessage'][_0x6acc('0x44')]);_0x1ae92a[_0x6acc('0x2f')]=_[_0x6acc('0x2e')](_0x396d46[_0x6acc('0x2f')]);_0x1ae92a['filters']=_['intersection'](_0x1ae92a['model'],_0x1ae92a['query']);_0x115adf['attributes']=_[_0x6acc('0x31')](_0x1ae92a[_0x6acc('0x2c')],qs[_0x6acc('0x33')](_0x396d46[_0x6acc('0x2f')]['fields']));_0x115adf['attributes']=_0x115adf[_0x6acc('0x32')]['length']?_0x115adf[_0x6acc('0x32')]:_0x1ae92a['model'];if(!_0x396d46[_0x6acc('0x2f')][_0x6acc('0x35')](_0x6acc('0x36'))){_0x115adf[_0x6acc('0x1d')]=qs[_0x6acc('0x1d')](_0x396d46[_0x6acc('0x2f')][_0x6acc('0x1d')]);_0x115adf[_0x6acc('0x1c')]=qs[_0x6acc('0x1c')](_0x396d46[_0x6acc('0x2f')][_0x6acc('0x1c')]);}_0x115adf[_0x6acc('0x50')]=qs[_0x6acc('0x37')](_0x396d46[_0x6acc('0x2f')][_0x6acc('0x37')]);_0x115adf[_0x6acc('0x38')]=qs[_0x6acc('0x30')](_[_0x6acc('0x51')](_0x396d46[_0x6acc('0x2f')],_0x1ae92a['filters']));if(_0x396d46[_0x6acc('0x2f')]['filter']){_0x115adf[_0x6acc('0x38')]=_['merge'](_0x115adf[_0x6acc('0x38')],{'$or':_['map'](_0x115adf[_0x6acc('0x32')],function(_0x51357b){var _0x54da14={};_0x54da14[_0x51357b]={'$like':'%'+_0x396d46[_0x6acc('0x2f')][_0x6acc('0x39')]+'%'};return _0x54da14;})});}_0x115adf['where']=_[_0x6acc('0x3a')](_0x115adf[_0x6acc('0x38')],{'mailboxuser':_0x43d3d[_0x6acc('0x52')]});_0x115adf=_['merge']({},_0x115adf,_0x396d46[_0x6acc('0x3b')]);return db[_0x6acc('0x53')][_0x6acc('0x54')](_0x115adf)[_0x6acc('0x20')](respondWithFilteredResult(_0x175b16,_0x115adf));})['catch'](handleError(_0x175b16,null));};
\ No newline at end of file
+var _0xf45e=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','then','UserProfileResource','error','stack','name','send','map','VoiceMail','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','zip-dir'];(function(_0x5d0443,_0x2f22c8){var _0x323c5b=function(_0x1711fc){while(--_0x1711fc){_0x5d0443['push'](_0x5d0443['shift']());}};_0x323c5b(++_0x2f22c8);}(_0xf45e,0x115));var _0xef45=function(_0x11f395,_0x4017d3){_0x11f395=_0x11f395-0x0;var _0x29334b=_0xf45e[_0x11f395];return _0x29334b;};'use strict';var emlformat=require(_0xef45('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xef45('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xef45('0x2'));var moment=require(_0xef45('0x3'));var BPromise=require(_0xef45('0x4'));var Mustache=require(_0xef45('0x5'));var util=require(_0xef45('0x6'));var path=require(_0xef45('0x7'));var sox=require(_0xef45('0x8'));var csv=require(_0xef45('0x9'));var ejs=require(_0xef45('0xa'));var fs=require('fs');var fs_extra=require(_0xef45('0xb'));var _=require(_0xef45('0xc'));var squel=require(_0xef45('0xd'));var crypto=require(_0xef45('0xe'));var jsforce=require(_0xef45('0xf'));var deskjs=require(_0xef45('0x10'));var toCsv=require(_0xef45('0x9'));var querystring=require(_0xef45('0x11'));var Papa=require(_0xef45('0x12'));var Redis=require(_0xef45('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xef45('0x14'));var as=require(_0xef45('0x15'));var hardwareService=require(_0xef45('0x16'));var logger=require(_0xef45('0x17'))(_0xef45('0x18'));var utils=require(_0xef45('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xef45('0x1a'));var db=require(_0xef45('0x1b'))['db'];function respondWithStatusCode(_0x30babb,_0x433be9){_0x433be9=_0x433be9||0xcc;return function(_0x476739){if(_0x476739){return _0x30babb['sendStatus'](_0x433be9);}return _0x30babb['status'](_0x433be9)[_0xef45('0x1c')]();};}function respondWithResult(_0x47fd96,_0x2ae89a){_0x2ae89a=_0x2ae89a||0xc8;return function(_0xb0fc43){if(_0xb0fc43){return _0x47fd96[_0xef45('0x1d')](_0x2ae89a)['json'](_0xb0fc43);}};}function respondWithFilteredResult(_0x5b3136,_0x29c0c4){return function(_0x5530e6){if(_0x5530e6){var _0x11cd3a=typeof _0x29c0c4[_0xef45('0x1e')]===_0xef45('0x1f')&&typeof _0x29c0c4[_0xef45('0x20')]==='undefined';var _0x560b2f=_0x5530e6[_0xef45('0x21')];var _0x219778=_0x11cd3a?0x0:_0x29c0c4[_0xef45('0x1e')];var _0x258785=_0x11cd3a?_0x5530e6['count']:_0x29c0c4['offset']+_0x29c0c4[_0xef45('0x20')];var _0x20ef26;if(_0x258785>=_0x560b2f){_0x258785=_0x560b2f;_0x20ef26=0xc8;}else{_0x20ef26=0xce;}_0x5b3136[_0xef45('0x1d')](_0x20ef26);return _0x5b3136[_0xef45('0x22')](_0xef45('0x23'),_0x219778+'-'+_0x258785+'/'+_0x560b2f)[_0xef45('0x24')](_0x5530e6);}return null;};}function patchUpdates(_0x375cbd){return function(_0x4a6217){try{jsonpatch[_0xef45('0x25')](_0x4a6217,_0x375cbd,!![]);}catch(_0x3e2a47){return BPromise[_0xef45('0x26')](_0x3e2a47);}return _0x4a6217[_0xef45('0x27')]();};}function saveUpdates(_0x27322f,_0x5205bf){return function(_0x40abc8){if(_0x40abc8){return _0x40abc8['update'](_0x27322f)['then'](function(_0x7707a1){return _0x7707a1;});}return null;};}function removeEntity(_0x2b41d8,_0xbb859b){return function(_0x7817d0){if(_0x7817d0){return _0x7817d0[_0xef45('0x28')]()[_0xef45('0x29')](function(){var _0x315777=_0x7817d0['get']({'plain':!![]});var _0x208b35='Voicemails';return db[_0xef45('0x2a')][_0xef45('0x28')]({'where':{'type':_0x208b35,'resourceId':_0x315777['id']}})['then'](function(){return _0x7817d0;});})[_0xef45('0x29')](function(){_0x2b41d8[_0xef45('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1096af,_0x4f8c9b){return function(_0x550e18){if(!_0x550e18){_0x1096af['sendStatus'](0x194);}return _0x550e18;};}function handleError(_0x53690e,_0x1f636f){_0x1f636f=_0x1f636f||0x1f4;return function(_0x2f72ef){logger[_0xef45('0x2b')](_0x2f72ef[_0xef45('0x2c')]);if(_0x2f72ef['name']){delete _0x2f72ef[_0xef45('0x2d')];}_0x53690e['status'](_0x1f636f)[_0xef45('0x2e')](_0x2f72ef);};}exports['index']=function(_0x3e6922,_0x5bfd2d){var _0x575734={},_0x14ce5a={},_0x3e45de={'count':0x0,'rows':[]};var _0x390a7a=_[_0xef45('0x2f')](db[_0xef45('0x30')]['rawAttributes'],function(_0x5551ce){return{'name':_0x5551ce['fieldName'],'type':_0x5551ce[_0xef45('0x31')][_0xef45('0x32')]};});_0x14ce5a[_0xef45('0x33')]=_[_0xef45('0x2f')](_0x390a7a,_0xef45('0x2d'));_0x14ce5a[_0xef45('0x34')]=_[_0xef45('0x35')](_0x3e6922['query']);_0x14ce5a['filters']=_[_0xef45('0x36')](_0x14ce5a['model'],_0x14ce5a[_0xef45('0x34')]);_0x575734['attributes']=_[_0xef45('0x36')](_0x14ce5a[_0xef45('0x33')],qs[_0xef45('0x37')](_0x3e6922[_0xef45('0x34')][_0xef45('0x37')]));_0x575734['attributes']=_0x575734[_0xef45('0x38')][_0xef45('0x39')]?_0x575734[_0xef45('0x38')]:_0x14ce5a['model'];if(!_0x3e6922['query'][_0xef45('0x3a')](_0xef45('0x3b'))){_0x575734['limit']=qs[_0xef45('0x20')](_0x3e6922['query']['limit']);_0x575734[_0xef45('0x1e')]=qs[_0xef45('0x1e')](_0x3e6922[_0xef45('0x34')]['offset']);}_0x575734[_0xef45('0x3c')]=qs[_0xef45('0x3d')](_0x3e6922[_0xef45('0x34')][_0xef45('0x3d')]);_0x575734['where']=qs['filters'](_[_0xef45('0x3e')](_0x3e6922[_0xef45('0x34')],_0x14ce5a[_0xef45('0x3f')]),_0x390a7a);if(_0x3e6922[_0xef45('0x34')][_0xef45('0x40')]){_0x575734[_0xef45('0x41')]=_[_0xef45('0x42')](_0x575734[_0xef45('0x41')],{'$or':_['map'](_0x390a7a,function(_0x4f5877){if(_0x4f5877[_0xef45('0x31')]!==_0xef45('0x43')){var _0x154e72={};_0x154e72[_0x4f5877[_0xef45('0x2d')]]={'$like':'%'+_0x3e6922[_0xef45('0x34')][_0xef45('0x40')]+'%'};return _0x154e72;}})});}_0x575734=_[_0xef45('0x42')]({},_0x575734,_0x3e6922[_0xef45('0x44')]);var _0x3a5082={'where':_0x575734[_0xef45('0x41')]};return db[_0xef45('0x30')][_0xef45('0x21')](_0x3a5082)[_0xef45('0x29')](function(_0xd7d217){_0x3e45de[_0xef45('0x21')]=_0xd7d217;if(_0x3e6922[_0xef45('0x34')]['includeAll']){_0x575734[_0xef45('0x45')]=[{'all':!![]}];}return db[_0xef45('0x30')][_0xef45('0x46')](_0x575734);})[_0xef45('0x29')](function(_0x54ccb8){_0x3e45de[_0xef45('0x47')]=_0x54ccb8;return _0x3e45de;})['then'](respondWithFilteredResult(_0x5bfd2d,_0x575734))[_0xef45('0x48')](handleError(_0x5bfd2d,null));};exports['show']=function(_0x5faf67,_0x2d086f){var _0x2236d9={'raw':!![],'where':{'id':_0x5faf67[_0xef45('0x49')]['id']}},_0x36e81a={};_0x36e81a[_0xef45('0x33')]=_[_0xef45('0x35')](db['VoiceMail'][_0xef45('0x4a')]);_0x36e81a[_0xef45('0x34')]=_[_0xef45('0x35')](_0x5faf67[_0xef45('0x34')]);_0x36e81a[_0xef45('0x3f')]=_[_0xef45('0x36')](_0x36e81a[_0xef45('0x33')],_0x36e81a[_0xef45('0x34')]);_0x2236d9[_0xef45('0x38')]=_[_0xef45('0x36')](_0x36e81a[_0xef45('0x33')],qs[_0xef45('0x37')](_0x5faf67[_0xef45('0x34')][_0xef45('0x37')]));_0x2236d9[_0xef45('0x38')]=_0x2236d9['attributes'][_0xef45('0x39')]?_0x2236d9[_0xef45('0x38')]:_0x36e81a[_0xef45('0x33')];if(_0x5faf67['query']['includeAll']){_0x2236d9['include']=[{'all':!![]}];}_0x2236d9=_[_0xef45('0x42')]({},_0x2236d9,_0x5faf67[_0xef45('0x44')]);return db[_0xef45('0x30')][_0xef45('0x4b')](_0x2236d9)[_0xef45('0x29')](handleEntityNotFound(_0x2d086f,null))[_0xef45('0x29')](respondWithResult(_0x2d086f,null))['catch'](handleError(_0x2d086f,null));};exports[_0xef45('0x4c')]=function(_0x463796,_0x2b2419){return db['VoiceMail']['create'](_0x463796[_0xef45('0x4d')],{})[_0xef45('0x29')](function(_0x4feeb1){var _0x1a56ae=_0x463796[_0xef45('0x4e')][_0xef45('0x4f')]({'plain':!![]});if(!_0x1a56ae)throw new Error(_0xef45('0x50'));if(_0x1a56ae[_0xef45('0x51')]===_0xef45('0x4e')){var _0x23581f=_0x4feeb1[_0xef45('0x4f')]({'plain':!![]});var _0x1961b4=_0xef45('0x52');return db[_0xef45('0x53')][_0xef45('0x4b')]({'where':{'name':_0x1961b4,'userProfileId':_0x1a56ae[_0xef45('0x54')]},'raw':!![]})[_0xef45('0x29')](function(_0x48a391){if(_0x48a391&&_0x48a391[_0xef45('0x55')]===0x0){return db[_0xef45('0x2a')][_0xef45('0x4c')]({'name':_0x23581f['name'],'resourceId':_0x23581f['id'],'type':_0x48a391[_0xef45('0x2d')],'sectionId':_0x48a391['id']},{})[_0xef45('0x29')](function(){return _0x4feeb1;});}else{return _0x4feeb1;}})[_0xef45('0x48')](function(_0x1531ea){logger['error'](_0xef45('0x56'),_0x1531ea);throw _0x1531ea;});}return _0x4feeb1;})[_0xef45('0x29')](respondWithResult(_0x2b2419,0xc9))[_0xef45('0x48')](handleError(_0x2b2419,null));};exports[_0xef45('0x57')]=function(_0x67d57b,_0x41f575){if(_0x67d57b[_0xef45('0x4d')]['id']){delete _0x67d57b[_0xef45('0x4d')]['id'];}return db[_0xef45('0x30')][_0xef45('0x4b')]({'where':{'id':_0x67d57b[_0xef45('0x49')]['id']}})[_0xef45('0x29')](handleEntityNotFound(_0x41f575,null))['then'](saveUpdates(_0x67d57b[_0xef45('0x4d')],null))[_0xef45('0x29')](respondWithResult(_0x41f575,null))[_0xef45('0x48')](handleError(_0x41f575,null));};exports[_0xef45('0x28')]=function(_0x2fe9cf,_0x32232f){return db['VoiceMail']['find']({'where':{'id':_0x2fe9cf[_0xef45('0x49')]['id']}})['then'](handleEntityNotFound(_0x32232f,null))[_0xef45('0x29')](removeEntity(_0x32232f,null))[_0xef45('0x48')](handleError(_0x32232f,null));};exports[_0xef45('0x58')]=function(_0x5676fb,_0x16b04e,_0x398dc0){return db['VoiceMail'][_0xef45('0x59')]({'where':{'id':_0x5676fb['params']['id']}})['then'](handleEntityNotFound(_0x16b04e,null))[_0xef45('0x29')](function(_0x4f78ac){var _0x189f22;var _0x3fbc26={},_0x22fd64={};_0x22fd64['model']=_[_0xef45('0x35')](db[_0xef45('0x5a')]['rawAttributes']);_0x22fd64[_0xef45('0x34')]=_[_0xef45('0x35')](_0x5676fb[_0xef45('0x34')]);_0x22fd64[_0xef45('0x3f')]=_[_0xef45('0x36')](_0x22fd64[_0xef45('0x33')],_0x22fd64[_0xef45('0x34')]);_0x3fbc26[_0xef45('0x38')]=_['intersection'](_0x22fd64[_0xef45('0x33')],qs['fields'](_0x5676fb['query'][_0xef45('0x37')]));_0x3fbc26['attributes']=_0x3fbc26[_0xef45('0x38')][_0xef45('0x39')]?_0x3fbc26['attributes']:_0x22fd64[_0xef45('0x33')];if(!_0x5676fb[_0xef45('0x34')][_0xef45('0x3a')](_0xef45('0x3b'))){_0x3fbc26[_0xef45('0x20')]=qs[_0xef45('0x20')](_0x5676fb['query'][_0xef45('0x20')]);_0x3fbc26[_0xef45('0x1e')]=qs[_0xef45('0x1e')](_0x5676fb[_0xef45('0x34')][_0xef45('0x1e')]);}_0x3fbc26['order']=qs[_0xef45('0x3d')](_0x5676fb['query'][_0xef45('0x3d')]);_0x3fbc26[_0xef45('0x41')]=qs['filters'](_[_0xef45('0x3e')](_0x5676fb[_0xef45('0x34')],_0x22fd64[_0xef45('0x3f')]));if(_0x5676fb['query']['filter']){_0x3fbc26[_0xef45('0x41')]=_[_0xef45('0x42')](_0x3fbc26[_0xef45('0x41')],{'$or':_['map'](_0x3fbc26[_0xef45('0x38')],function(_0x3956b0){var _0x49131e={};_0x49131e[_0x3956b0]={'$like':'%'+_0x5676fb[_0xef45('0x34')]['filter']+'%'};return _0x49131e;})});}_0x3fbc26[_0xef45('0x41')]=_[_0xef45('0x42')](_0x3fbc26[_0xef45('0x41')],{'mailboxuser':_0x4f78ac[_0xef45('0x5b')]});_0x3fbc26=_[_0xef45('0x42')]({},_0x3fbc26,_0x5676fb[_0xef45('0x44')]);return db[_0xef45('0x5a')][_0xef45('0x5c')](_0x3fbc26)['then'](respondWithFilteredResult(_0x16b04e,_0x3fbc26));})[_0xef45('0x48')](handleError(_0x16b04e,null));};
\ No newline at end of file