Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / api / voiceChanSpy / voiceChanSpy.controller.js
index d484b94..be48c59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17db=['show','keys','includeAll','include','options','find','catch','create','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','ChanSpies','error','stack','name','send','merge','body','contact','agent','interaction','account','map','VoiceChanSpy','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter'];(function(_0x214993,_0x5e8817){var _0x457aeb=function(_0x5b9c07){while(--_0x5b9c07){_0x214993['push'](_0x214993['shift']());}};_0x457aeb(++_0x5e8817);}(_0x17db,0xb2));var _0xb17d=function(_0xdb7e5b,_0x382b2c){_0xdb7e5b=_0xdb7e5b-0x0;var _0x2f11cc=_0x17db[_0xdb7e5b];return _0x2f11cc;};'use strict';var emlformat=require(_0xb17d('0x0'));var rimraf=require(_0xb17d('0x1'));var zipdir=require(_0xb17d('0x2'));var jsonpatch=require(_0xb17d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb17d('0x4'));var Mustache=require('mustache');var util=require(_0xb17d('0x5'));var path=require(_0xb17d('0x6'));var sox=require(_0xb17d('0x7'));var csv=require(_0xb17d('0x8'));var ejs=require(_0xb17d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb17d('0xa'));var crypto=require(_0xb17d('0xb'));var jsforce=require(_0xb17d('0xc'));var deskjs=require(_0xb17d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb17d('0xe'));var Redis=require(_0xb17d('0xf'));var authService=require(_0xb17d('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb17d('0x11'));var logger=require(_0xb17d('0x12'))(_0xb17d('0x13'));var utils=require('../../config/utils');var config=require(_0xb17d('0x14'));var licenseUtil=require(_0xb17d('0x15'));var db=require(_0xb17d('0x16'))['db'];function respondWithStatusCode(_0x10bc4e,_0x4a1bda){_0x4a1bda=_0x4a1bda||0xcc;return function(_0x219ace){if(_0x219ace){return _0x10bc4e[_0xb17d('0x17')](_0x4a1bda);}return _0x10bc4e[_0xb17d('0x18')](_0x4a1bda)[_0xb17d('0x19')]();};}function respondWithResult(_0x478e7e,_0x251f5c){_0x251f5c=_0x251f5c||0xc8;return function(_0xf396ba){if(_0xf396ba){return _0x478e7e[_0xb17d('0x18')](_0x251f5c)[_0xb17d('0x1a')](_0xf396ba);}};}function respondWithFilteredResult(_0x384a8b,_0x1674a7){return function(_0x192580){if(_0x192580){var _0x2b9f5b=typeof _0x1674a7[_0xb17d('0x1b')]===_0xb17d('0x1c')&&typeof _0x1674a7[_0xb17d('0x1d')]===_0xb17d('0x1c');var _0x550db2=_0x192580[_0xb17d('0x1e')];var _0x331e19=_0x2b9f5b?0x0:_0x1674a7['offset'];var _0x827ff8=_0x2b9f5b?_0x192580[_0xb17d('0x1e')]:_0x1674a7['offset']+_0x1674a7[_0xb17d('0x1d')];var _0x2e678c;if(_0x827ff8>=_0x550db2){_0x827ff8=_0x550db2;_0x2e678c=0xc8;}else{_0x2e678c=0xce;}_0x384a8b[_0xb17d('0x18')](_0x2e678c);return _0x384a8b[_0xb17d('0x1f')](_0xb17d('0x20'),_0x331e19+'-'+_0x827ff8+'/'+_0x550db2)[_0xb17d('0x1a')](_0x192580);}return null;};}function patchUpdates(_0x1dcbbb){return function(_0x552b89){try{jsonpatch['apply'](_0x552b89,_0x1dcbbb,!![]);}catch(_0x32b17a){return BPromise[_0xb17d('0x21')](_0x32b17a);}return _0x552b89[_0xb17d('0x22')]();};}function saveUpdates(_0xf4f890,_0x4ced93){return function(_0x353a97){if(_0x353a97){return _0x353a97[_0xb17d('0x23')](_0xf4f890)[_0xb17d('0x24')](function(_0x58cd28){return _0x58cd28;});}return null;};}function removeEntity(_0x575adb,_0x16f7c3){return function(_0x473a33){if(_0x473a33){return _0x473a33[_0xb17d('0x25')]()['then'](function(){var _0x14a1ae=_0x473a33[_0xb17d('0x26')]({'plain':!![]});var _0x35921f=_0xb17d('0x27');return db['UserProfileResource'][_0xb17d('0x25')]({'where':{'type':_0x35921f,'resourceId':_0x14a1ae['id']}})[_0xb17d('0x24')](function(){return _0x473a33;});})[_0xb17d('0x24')](function(){_0x575adb[_0xb17d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14a414,_0x3b2285){return function(_0x2a76b4){if(!_0x2a76b4){_0x14a414[_0xb17d('0x17')](0x194);}return _0x2a76b4;};}function handleError(_0xd97c8b,_0x4d5efc){_0x4d5efc=_0x4d5efc||0x1f4;return function(_0x3ee6bd){logger[_0xb17d('0x28')](_0x3ee6bd[_0xb17d('0x29')]);if(_0x3ee6bd[_0xb17d('0x2a')]){delete _0x3ee6bd[_0xb17d('0x2a')];}_0xd97c8b[_0xb17d('0x18')](_0x4d5efc)[_0xb17d('0x2b')](_0x3ee6bd);};}function getMustacheRender(_0x329978,_0x24f607){return Mustache['render'](_0x329978,_[_0xb17d('0x2c')](_0x24f607[_0xb17d('0x2d')],{'contact':_0x24f607[_0xb17d('0x2e')],'message':_0x24f607['message'],'agent':_0x24f607[_0xb17d('0x2f')],'interaction':_0x24f607[_0xb17d('0x30')],'account':_0x24f607[_0xb17d('0x31')]}))||'';}exports['index']=function(_0x524c1f,_0x5defe9){var _0x4f22a3={},_0x26ff29={},_0x1f2a76={'count':0x0,'rows':[]};var _0x514de0=_[_0xb17d('0x32')](db[_0xb17d('0x33')][_0xb17d('0x34')],function(_0x522099){return{'name':_0x522099[_0xb17d('0x35')],'type':_0x522099[_0xb17d('0x36')]['key']};});_0x26ff29[_0xb17d('0x37')]=_[_0xb17d('0x32')](_0x514de0,_0xb17d('0x2a'));_0x26ff29[_0xb17d('0x38')]=_['keys'](_0x524c1f[_0xb17d('0x38')]);_0x26ff29[_0xb17d('0x39')]=_['intersection'](_0x26ff29[_0xb17d('0x37')],_0x26ff29[_0xb17d('0x38')]);_0x4f22a3[_0xb17d('0x3a')]=_[_0xb17d('0x3b')](_0x26ff29[_0xb17d('0x37')],qs['fields'](_0x524c1f[_0xb17d('0x38')][_0xb17d('0x3c')]));_0x4f22a3[_0xb17d('0x3a')]=_0x4f22a3[_0xb17d('0x3a')][_0xb17d('0x3d')]?_0x4f22a3['attributes']:_0x26ff29['model'];if(!_0x524c1f['query'][_0xb17d('0x3e')](_0xb17d('0x3f'))){_0x4f22a3['limit']=qs[_0xb17d('0x1d')](_0x524c1f[_0xb17d('0x38')][_0xb17d('0x1d')]);_0x4f22a3[_0xb17d('0x1b')]=qs['offset'](_0x524c1f['query'][_0xb17d('0x1b')]);}_0x4f22a3[_0xb17d('0x40')]=qs[_0xb17d('0x41')](_0x524c1f['query'][_0xb17d('0x41')]);_0x4f22a3[_0xb17d('0x42')]=qs[_0xb17d('0x39')](_['pick'](_0x524c1f[_0xb17d('0x38')],_0x26ff29['filters']),_0x514de0);if(_0x524c1f['query'][_0xb17d('0x43')]){_0x4f22a3['where']=_[_0xb17d('0x2c')](_0x4f22a3[_0xb17d('0x42')],{'$or':_[_0xb17d('0x32')](_0x514de0,function(_0x2e8b2a){if(_0x2e8b2a[_0xb17d('0x36')]!=='VIRTUAL'){var _0x4bf801={};_0x4bf801[_0x2e8b2a[_0xb17d('0x2a')]]={'$like':'%'+_0x524c1f[_0xb17d('0x38')][_0xb17d('0x43')]+'%'};return _0x4bf801;}})});}_0x4f22a3=_[_0xb17d('0x2c')]({},_0x4f22a3,_0x524c1f['options']);var _0x3da60a={'where':_0x4f22a3[_0xb17d('0x42')]};return db['VoiceChanSpy'][_0xb17d('0x1e')](_0x3da60a)[_0xb17d('0x24')](function(_0x9b84a9){_0x1f2a76['count']=_0x9b84a9;if(_0x524c1f['query']['includeAll']){_0x4f22a3['include']=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x4f22a3);})[_0xb17d('0x24')](function(_0x5de122){_0x1f2a76['rows']=_0x5de122;return _0x1f2a76;})[_0xb17d('0x24')](respondWithFilteredResult(_0x5defe9,_0x4f22a3))['catch'](handleError(_0x5defe9,null));};exports[_0xb17d('0x44')]=function(_0x88c898,_0x2d3419){var _0x52b482={'raw':![],'where':{'id':_0x88c898['params']['id']}},_0x11773c={};_0x11773c['model']=_[_0xb17d('0x45')](db[_0xb17d('0x33')]['rawAttributes']);_0x11773c[_0xb17d('0x38')]=_[_0xb17d('0x45')](_0x88c898[_0xb17d('0x38')]);_0x11773c[_0xb17d('0x39')]=_[_0xb17d('0x3b')](_0x11773c[_0xb17d('0x37')],_0x11773c[_0xb17d('0x38')]);_0x52b482[_0xb17d('0x3a')]=_[_0xb17d('0x3b')](_0x11773c['model'],qs[_0xb17d('0x3c')](_0x88c898[_0xb17d('0x38')]['fields']));_0x52b482[_0xb17d('0x3a')]=_0x52b482[_0xb17d('0x3a')][_0xb17d('0x3d')]?_0x52b482['attributes']:_0x11773c[_0xb17d('0x37')];if(_0x88c898[_0xb17d('0x38')][_0xb17d('0x46')]){_0x52b482[_0xb17d('0x47')]=[{'all':!![]}];}_0x52b482=_['merge']({},_0x52b482,_0x88c898[_0xb17d('0x48')]);return db[_0xb17d('0x33')][_0xb17d('0x49')](_0x52b482)[_0xb17d('0x24')](handleEntityNotFound(_0x2d3419,null))[_0xb17d('0x24')](respondWithResult(_0x2d3419,null))[_0xb17d('0x4a')](handleError(_0x2d3419,null));};exports[_0xb17d('0x4b')]=function(_0x169446,_0x37aad2){return db[_0xb17d('0x33')][_0xb17d('0x4b')](_0x169446[_0xb17d('0x2d')],{})['then'](function(_0x4ad8fc){var _0x5d5963=_0x169446[_0xb17d('0x4c')][_0xb17d('0x26')]({'plain':!![]});if(!_0x5d5963)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d5963['role']==='user'){var _0x1d0c19=_0x4ad8fc['get']({'plain':!![]});var _0x1d244a='ChanSpies';return db[_0xb17d('0x4d')][_0xb17d('0x49')]({'where':{'name':_0x1d244a,'userProfileId':_0x5d5963[_0xb17d('0x4e')]},'raw':!![]})['then'](function(_0x3992ef){if(_0x3992ef&&_0x3992ef[_0xb17d('0x4f')]===0x0){return db[_0xb17d('0x50')][_0xb17d('0x4b')]({'name':_0x1d0c19['name'],'resourceId':_0x1d0c19['id'],'type':_0x3992ef[_0xb17d('0x2a')],'sectionId':_0x3992ef['id']},{})['then'](function(){return _0x4ad8fc;});}else{return _0x4ad8fc;}})[_0xb17d('0x4a')](function(_0x45248){logger[_0xb17d('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45248);throw _0x45248;});}return _0x4ad8fc;})[_0xb17d('0x24')](respondWithResult(_0x37aad2,0xc9))[_0xb17d('0x4a')](handleError(_0x37aad2,null));};exports[_0xb17d('0x23')]=function(_0x5c0feb,_0x52e75e){if(_0x5c0feb[_0xb17d('0x2d')]['id']){delete _0x5c0feb['body']['id'];}return db[_0xb17d('0x33')][_0xb17d('0x49')]({'where':{'id':_0x5c0feb[_0xb17d('0x51')]['id']}})[_0xb17d('0x24')](handleEntityNotFound(_0x52e75e,null))[_0xb17d('0x24')](saveUpdates(_0x5c0feb['body'],null))[_0xb17d('0x24')](respondWithResult(_0x52e75e,null))['catch'](handleError(_0x52e75e,null));};exports[_0xb17d('0x25')]=function(_0x317801,_0x1c13f8){return db['VoiceChanSpy'][_0xb17d('0x49')]({'where':{'id':_0x317801[_0xb17d('0x51')]['id']}})[_0xb17d('0x24')](handleEntityNotFound(_0x1c13f8,null))['then'](removeEntity(_0x1c13f8,null))[_0xb17d('0x4a')](handleError(_0x1c13f8,null));};
\ No newline at end of file
+var _0x76f6=['type','VIRTUAL','VoiceChanSpy','findAll','rows','catch','show','params','include','options','find','create','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','merge','body','contact','agent','interaction','account','rawAttributes','fieldName','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x4bcbe1,_0x4575fc){var _0x4d9bb3=function(_0x5a1593){while(--_0x5a1593){_0x4bcbe1['push'](_0x4bcbe1['shift']());}};_0x4d9bb3(++_0x4575fc);}(_0x76f6,0x67));var _0x676f=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x76f6[_0x47aa64];return _0x549c7a;};'use strict';var emlformat=require(_0x676f('0x0'));var rimraf=require(_0x676f('0x1'));var zipdir=require(_0x676f('0x2'));var jsonpatch=require(_0x676f('0x3'));var rp=require(_0x676f('0x4'));var moment=require(_0x676f('0x5'));var BPromise=require(_0x676f('0x6'));var Mustache=require(_0x676f('0x7'));var util=require('util');var path=require(_0x676f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x676f('0x9'));var fs=require('fs');var fs_extra=require(_0x676f('0xa'));var _=require(_0x676f('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x676f('0xc'));var deskjs=require(_0x676f('0xd'));var toCsv=require(_0x676f('0xe'));var querystring=require('querystring');var Papa=require(_0x676f('0xf'));var Redis=require(_0x676f('0x10'));var authService=require(_0x676f('0x11'));var qs=require(_0x676f('0x12'));var as=require(_0x676f('0x13'));var hardwareService=require(_0x676f('0x14'));var logger=require('../../config/logger')(_0x676f('0x15'));var utils=require(_0x676f('0x16'));var config=require(_0x676f('0x17'));var licenseUtil=require(_0x676f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb81bf6,_0x43b52c){_0x43b52c=_0x43b52c||0xcc;return function(_0x119a1a){if(_0x119a1a){return _0xb81bf6[_0x676f('0x19')](_0x43b52c);}return _0xb81bf6[_0x676f('0x1a')](_0x43b52c)[_0x676f('0x1b')]();};}function respondWithResult(_0xef4c3b,_0x48f2b8){_0x48f2b8=_0x48f2b8||0xc8;return function(_0x23245b){if(_0x23245b){return _0xef4c3b[_0x676f('0x1a')](_0x48f2b8)[_0x676f('0x1c')](_0x23245b);}};}function respondWithFilteredResult(_0xa712be,_0x34b23a){return function(_0x3e9f7e){if(_0x3e9f7e){var _0x128a8b=typeof _0x34b23a[_0x676f('0x1d')]===_0x676f('0x1e')&&typeof _0x34b23a[_0x676f('0x1f')]===_0x676f('0x1e');var _0x106e0d=_0x3e9f7e['count'];var _0xacc131=_0x128a8b?0x0:_0x34b23a[_0x676f('0x1d')];var _0x2c0bc9=_0x128a8b?_0x3e9f7e[_0x676f('0x20')]:_0x34b23a['offset']+_0x34b23a[_0x676f('0x1f')];var _0x10b9e1;if(_0x2c0bc9>=_0x106e0d){_0x2c0bc9=_0x106e0d;_0x10b9e1=0xc8;}else{_0x10b9e1=0xce;}_0xa712be[_0x676f('0x1a')](_0x10b9e1);return _0xa712be['set']('Content-Range',_0xacc131+'-'+_0x2c0bc9+'/'+_0x106e0d)[_0x676f('0x1c')](_0x3e9f7e);}return null;};}function patchUpdates(_0x39228f){return function(_0x3ab8db){try{jsonpatch[_0x676f('0x21')](_0x3ab8db,_0x39228f,!![]);}catch(_0xb11c6a){return BPromise[_0x676f('0x22')](_0xb11c6a);}return _0x3ab8db[_0x676f('0x23')]();};}function saveUpdates(_0x3a2525,_0xeac32b){return function(_0x2fdfc3){if(_0x2fdfc3){return _0x2fdfc3[_0x676f('0x24')](_0x3a2525)[_0x676f('0x25')](function(_0x5b3a6e){return _0x5b3a6e;});}return null;};}function removeEntity(_0x3b9543,_0x1e4a8d){return function(_0x310a37){if(_0x310a37){return _0x310a37[_0x676f('0x26')]()[_0x676f('0x25')](function(){var _0x224558=_0x310a37[_0x676f('0x27')]({'plain':!![]});var _0x579fb9=_0x676f('0x28');return db[_0x676f('0x29')][_0x676f('0x26')]({'where':{'type':_0x579fb9,'resourceId':_0x224558['id']}})[_0x676f('0x25')](function(){return _0x310a37;});})[_0x676f('0x25')](function(){_0x3b9543[_0x676f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x589567,_0x1387ae){return function(_0x3c97a7){if(!_0x3c97a7){_0x589567['sendStatus'](0x194);}return _0x3c97a7;};}function handleError(_0x52c544,_0x5e264d){_0x5e264d=_0x5e264d||0x1f4;return function(_0x3bd1f7){logger[_0x676f('0x2a')](_0x3bd1f7[_0x676f('0x2b')]);if(_0x3bd1f7[_0x676f('0x2c')]){delete _0x3bd1f7['name'];}_0x52c544[_0x676f('0x1a')](_0x5e264d)[_0x676f('0x2d')](_0x3bd1f7);};}function getMustacheRender(_0x1bb958,_0x1fec11){return Mustache['render'](_0x1bb958,_[_0x676f('0x2e')](_0x1fec11[_0x676f('0x2f')],{'contact':_0x1fec11[_0x676f('0x30')],'message':_0x1fec11['message'],'agent':_0x1fec11[_0x676f('0x31')],'interaction':_0x1fec11[_0x676f('0x32')],'account':_0x1fec11[_0x676f('0x33')]}))||'';}exports['index']=function(_0x400889,_0x19a4b7){var _0x21fe61={},_0x5bc12e={},_0x3f988c={'count':0x0,'rows':[]};var _0xbb32c1=_['map'](db['VoiceChanSpy'][_0x676f('0x34')],function(_0x244f1){return{'name':_0x244f1[_0x676f('0x35')],'type':_0x244f1['type'][_0x676f('0x36')]};});_0x5bc12e[_0x676f('0x37')]=_['map'](_0xbb32c1,'name');_0x5bc12e['query']=_[_0x676f('0x38')](_0x400889['query']);_0x5bc12e[_0x676f('0x39')]=_[_0x676f('0x3a')](_0x5bc12e[_0x676f('0x37')],_0x5bc12e[_0x676f('0x3b')]);_0x21fe61['attributes']=_[_0x676f('0x3a')](_0x5bc12e[_0x676f('0x37')],qs['fields'](_0x400889[_0x676f('0x3b')][_0x676f('0x3c')]));_0x21fe61['attributes']=_0x21fe61[_0x676f('0x3d')][_0x676f('0x3e')]?_0x21fe61['attributes']:_0x5bc12e['model'];if(!_0x400889['query'][_0x676f('0x3f')](_0x676f('0x40'))){_0x21fe61[_0x676f('0x1f')]=qs['limit'](_0x400889['query']['limit']);_0x21fe61[_0x676f('0x1d')]=qs[_0x676f('0x1d')](_0x400889[_0x676f('0x3b')][_0x676f('0x1d')]);}_0x21fe61[_0x676f('0x41')]=qs[_0x676f('0x42')](_0x400889[_0x676f('0x3b')][_0x676f('0x42')]);_0x21fe61[_0x676f('0x43')]=qs[_0x676f('0x39')](_[_0x676f('0x44')](_0x400889[_0x676f('0x3b')],_0x5bc12e[_0x676f('0x39')]),_0xbb32c1);if(_0x400889[_0x676f('0x3b')]['filter']){_0x21fe61['where']=_[_0x676f('0x2e')](_0x21fe61[_0x676f('0x43')],{'$or':_['map'](_0xbb32c1,function(_0xf37197){if(_0xf37197[_0x676f('0x45')]!==_0x676f('0x46')){var _0x5859cf={};_0x5859cf[_0xf37197[_0x676f('0x2c')]]={'$like':'%'+_0x400889[_0x676f('0x3b')]['filter']+'%'};return _0x5859cf;}})});}_0x21fe61=_['merge']({},_0x21fe61,_0x400889['options']);var _0x135c8f={'where':_0x21fe61[_0x676f('0x43')]};return db[_0x676f('0x47')][_0x676f('0x20')](_0x135c8f)[_0x676f('0x25')](function(_0x5dda5c){_0x3f988c[_0x676f('0x20')]=_0x5dda5c;if(_0x400889['query']['includeAll']){_0x21fe61['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0x676f('0x48')](_0x21fe61);})[_0x676f('0x25')](function(_0x3bddd8){_0x3f988c[_0x676f('0x49')]=_0x3bddd8;return _0x3f988c;})['then'](respondWithFilteredResult(_0x19a4b7,_0x21fe61))[_0x676f('0x4a')](handleError(_0x19a4b7,null));};exports[_0x676f('0x4b')]=function(_0x5ded87,_0x5bbfb4){var _0x24119d={'raw':![],'where':{'id':_0x5ded87[_0x676f('0x4c')]['id']}},_0x429eda={};_0x429eda[_0x676f('0x37')]=_[_0x676f('0x38')](db[_0x676f('0x47')][_0x676f('0x34')]);_0x429eda[_0x676f('0x3b')]=_[_0x676f('0x38')](_0x5ded87[_0x676f('0x3b')]);_0x429eda['filters']=_[_0x676f('0x3a')](_0x429eda['model'],_0x429eda['query']);_0x24119d[_0x676f('0x3d')]=_['intersection'](_0x429eda['model'],qs[_0x676f('0x3c')](_0x5ded87[_0x676f('0x3b')][_0x676f('0x3c')]));_0x24119d[_0x676f('0x3d')]=_0x24119d['attributes'][_0x676f('0x3e')]?_0x24119d['attributes']:_0x429eda[_0x676f('0x37')];if(_0x5ded87[_0x676f('0x3b')]['includeAll']){_0x24119d[_0x676f('0x4d')]=[{'all':!![]}];}_0x24119d=_[_0x676f('0x2e')]({},_0x24119d,_0x5ded87[_0x676f('0x4e')]);return db[_0x676f('0x47')][_0x676f('0x4f')](_0x24119d)['then'](handleEntityNotFound(_0x5bbfb4,null))[_0x676f('0x25')](respondWithResult(_0x5bbfb4,null))[_0x676f('0x4a')](handleError(_0x5bbfb4,null));};exports[_0x676f('0x50')]=function(_0x5098cb,_0xb9f19f){return db[_0x676f('0x47')][_0x676f('0x50')](_0x5098cb['body'],{})[_0x676f('0x25')](function(_0x3e1d11){var _0x12f356=_0x5098cb[_0x676f('0x51')][_0x676f('0x27')]({'plain':!![]});if(!_0x12f356)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12f356['role']===_0x676f('0x51')){var _0x35c5db=_0x3e1d11[_0x676f('0x27')]({'plain':!![]});var _0x3c207c=_0x676f('0x28');return db[_0x676f('0x52')][_0x676f('0x4f')]({'where':{'name':_0x3c207c,'userProfileId':_0x12f356[_0x676f('0x53')]},'raw':!![]})['then'](function(_0x31cadd){if(_0x31cadd&&_0x31cadd[_0x676f('0x54')]===0x0){return db[_0x676f('0x29')][_0x676f('0x50')]({'name':_0x35c5db[_0x676f('0x2c')],'resourceId':_0x35c5db['id'],'type':_0x31cadd[_0x676f('0x2c')],'sectionId':_0x31cadd['id']},{})[_0x676f('0x25')](function(){return _0x3e1d11;});}else{return _0x3e1d11;}})[_0x676f('0x4a')](function(_0x588c17){logger[_0x676f('0x2a')](_0x676f('0x55'),_0x588c17);throw _0x588c17;});}return _0x3e1d11;})[_0x676f('0x25')](respondWithResult(_0xb9f19f,0xc9))[_0x676f('0x4a')](handleError(_0xb9f19f,null));};exports[_0x676f('0x24')]=function(_0x33a4a7,_0x12f479){if(_0x33a4a7[_0x676f('0x2f')]['id']){delete _0x33a4a7['body']['id'];}return db[_0x676f('0x47')][_0x676f('0x4f')]({'where':{'id':_0x33a4a7[_0x676f('0x4c')]['id']}})[_0x676f('0x25')](handleEntityNotFound(_0x12f479,null))[_0x676f('0x25')](saveUpdates(_0x33a4a7[_0x676f('0x2f')],null))['then'](respondWithResult(_0x12f479,null))[_0x676f('0x4a')](handleError(_0x12f479,null));};exports[_0x676f('0x26')]=function(_0x1bf139,_0x35f348){return db['VoiceChanSpy'][_0x676f('0x4f')]({'where':{'id':_0x1bf139[_0x676f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x35f348,null))[_0x676f('0x25')](removeEntity(_0x35f348,null))[_0x676f('0x4a')](handleError(_0x35f348,null));};
\ No newline at end of file