Built motion from commit 00bf23f6.|2.6.16
[motion2.git] / server / api / voiceChanSpy / voiceChanSpy.controller.js
index 87b08be..1079a1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9224=['request-promise','moment','bluebird','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','index','map','VoiceChanSpy','fieldName','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','includeAll','include','findAll','rows','show','params','keys','length','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','ChanSpies','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x9224,0xa3));var _0x4922=function(_0x465ca8,_0x58e1b1){_0x465ca8=_0x465ca8-0x0;var _0x31036b=_0x9224[_0x465ca8];return _0x31036b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4922('0x0'));var zipdir=require(_0x4922('0x1'));var jsonpatch=require(_0x4922('0x2'));var rp=require(_0x4922('0x3'));var moment=require(_0x4922('0x4'));var BPromise=require(_0x4922('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x4922('0x6'));var csv=require('to-csv');var ejs=require(_0x4922('0x7'));var fs=require('fs');var fs_extra=require(_0x4922('0x8'));var _=require(_0x4922('0x9'));var squel=require(_0x4922('0xa'));var crypto=require(_0x4922('0xb'));var jsforce=require(_0x4922('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4922('0xd'));var querystring=require(_0x4922('0xe'));var Papa=require('papaparse');var Redis=require(_0x4922('0xf'));var authService=require(_0x4922('0x10'));var qs=require(_0x4922('0x11'));var as=require(_0x4922('0x12'));var hardwareService=require(_0x4922('0x13'));var logger=require(_0x4922('0x14'))(_0x4922('0x15'));var utils=require(_0x4922('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4922('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x410502,_0x45de0c){_0x45de0c=_0x45de0c||0xcc;return function(_0x35ca3d){if(_0x35ca3d){return _0x410502[_0x4922('0x18')](_0x45de0c);}return _0x410502[_0x4922('0x19')](_0x45de0c)['end']();};}function respondWithResult(_0x103fa8,_0x704e23){_0x704e23=_0x704e23||0xc8;return function(_0x542410){if(_0x542410){return _0x103fa8[_0x4922('0x19')](_0x704e23)[_0x4922('0x1a')](_0x542410);}};}function respondWithFilteredResult(_0x15bf3a,_0x3010bb){return function(_0x434f62){if(_0x434f62){var _0x4385d2=typeof _0x3010bb[_0x4922('0x1b')]==='undefined'&&typeof _0x3010bb[_0x4922('0x1c')]==='undefined';var _0x15fe9e=_0x434f62[_0x4922('0x1d')];var _0x1d7fc2=_0x4385d2?0x0:_0x3010bb[_0x4922('0x1b')];var _0x2ef410=_0x4385d2?_0x434f62[_0x4922('0x1d')]:_0x3010bb['offset']+_0x3010bb[_0x4922('0x1c')];var _0x3abfbf;if(_0x2ef410>=_0x15fe9e){_0x2ef410=_0x15fe9e;_0x3abfbf=0xc8;}else{_0x3abfbf=0xce;}_0x15bf3a[_0x4922('0x19')](_0x3abfbf);return _0x15bf3a[_0x4922('0x1e')](_0x4922('0x1f'),_0x1d7fc2+'-'+_0x2ef410+'/'+_0x15fe9e)['json'](_0x434f62);}return null;};}function patchUpdates(_0x2b6a2d){return function(_0x20ef64){try{jsonpatch[_0x4922('0x20')](_0x20ef64,_0x2b6a2d,!![]);}catch(_0x183ec9){return BPromise[_0x4922('0x21')](_0x183ec9);}return _0x20ef64[_0x4922('0x22')]();};}function saveUpdates(_0x1c1243,_0x3b182b){return function(_0x5c766e){if(_0x5c766e){return _0x5c766e[_0x4922('0x23')](_0x1c1243)[_0x4922('0x24')](function(_0x4bd606){return _0x4bd606;});}return null;};}function removeEntity(_0x21859a,_0x23ce8d){return function(_0x4f93cb){if(_0x4f93cb){return _0x4f93cb[_0x4922('0x25')]()['then'](function(){var _0x3daefd=_0x4f93cb[_0x4922('0x26')]({'plain':!![]});var _0x26bb17='ChanSpies';return db[_0x4922('0x27')][_0x4922('0x25')]({'where':{'type':_0x26bb17,'resourceId':_0x3daefd['id']}})[_0x4922('0x24')](function(){return _0x4f93cb;});})['then'](function(){_0x21859a[_0x4922('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f39d5,_0x28d3ba){return function(_0x41ef37){if(!_0x41ef37){_0x3f39d5[_0x4922('0x18')](0x194);}return _0x41ef37;};}function handleError(_0x30b538,_0x4a7934){_0x4a7934=_0x4a7934||0x1f4;return function(_0x46cd81){logger['error'](_0x46cd81[_0x4922('0x28')]);if(_0x46cd81[_0x4922('0x29')]){delete _0x46cd81['name'];}_0x30b538['status'](_0x4a7934)['send'](_0x46cd81);};}exports[_0x4922('0x2a')]=function(_0x575024,_0x5e7709){var _0x187c73={},_0x2db1c6={},_0x481ae3={'count':0x0,'rows':[]};var _0x2b132d=_[_0x4922('0x2b')](db[_0x4922('0x2c')]['rawAttributes'],function(_0x49c88e){return{'name':_0x49c88e[_0x4922('0x2d')],'type':_0x49c88e[_0x4922('0x2e')][_0x4922('0x2f')]};});_0x2db1c6['model']=_[_0x4922('0x2b')](_0x2b132d,_0x4922('0x29'));_0x2db1c6[_0x4922('0x30')]=_['keys'](_0x575024['query']);_0x2db1c6[_0x4922('0x31')]=_[_0x4922('0x32')](_0x2db1c6['model'],_0x2db1c6[_0x4922('0x30')]);_0x187c73['attributes']=_[_0x4922('0x32')](_0x2db1c6[_0x4922('0x33')],qs[_0x4922('0x34')](_0x575024[_0x4922('0x30')][_0x4922('0x34')]));_0x187c73[_0x4922('0x35')]=_0x187c73[_0x4922('0x35')]['length']?_0x187c73[_0x4922('0x35')]:_0x2db1c6[_0x4922('0x33')];if(!_0x575024[_0x4922('0x30')][_0x4922('0x36')](_0x4922('0x37'))){_0x187c73[_0x4922('0x1c')]=qs[_0x4922('0x1c')](_0x575024[_0x4922('0x30')][_0x4922('0x1c')]);_0x187c73[_0x4922('0x1b')]=qs['offset'](_0x575024['query'][_0x4922('0x1b')]);}_0x187c73[_0x4922('0x38')]=qs[_0x4922('0x39')](_0x575024[_0x4922('0x30')][_0x4922('0x39')]);_0x187c73['where']=qs['filters'](_[_0x4922('0x3a')](_0x575024[_0x4922('0x30')],_0x2db1c6[_0x4922('0x31')]),_0x2b132d);if(_0x575024[_0x4922('0x30')][_0x4922('0x3b')]){_0x187c73['where']=_[_0x4922('0x3c')](_0x187c73[_0x4922('0x3d')],{'$or':_[_0x4922('0x2b')](_0x2b132d,function(_0x33f84f){if(_0x33f84f[_0x4922('0x2e')]!=='VIRTUAL'){var _0x5a4ec6={};_0x5a4ec6[_0x33f84f[_0x4922('0x29')]]={'$like':'%'+_0x575024[_0x4922('0x30')]['filter']+'%'};return _0x5a4ec6;}})});}_0x187c73=_[_0x4922('0x3c')]({},_0x187c73,_0x575024['options']);var _0x1f81cc={'where':_0x187c73[_0x4922('0x3d')]};return db[_0x4922('0x2c')][_0x4922('0x1d')](_0x1f81cc)[_0x4922('0x24')](function(_0x499b26){_0x481ae3['count']=_0x499b26;if(_0x575024[_0x4922('0x30')][_0x4922('0x3e')]){_0x187c73[_0x4922('0x3f')]=[{'all':!![]}];}return db[_0x4922('0x2c')][_0x4922('0x40')](_0x187c73);})[_0x4922('0x24')](function(_0xa2fec8){_0x481ae3[_0x4922('0x41')]=_0xa2fec8;return _0x481ae3;})[_0x4922('0x24')](respondWithFilteredResult(_0x5e7709,_0x187c73))['catch'](handleError(_0x5e7709,null));};exports[_0x4922('0x42')]=function(_0xc7bd23,_0x114bb8){var _0x1a4c06={'raw':![],'where':{'id':_0xc7bd23[_0x4922('0x43')]['id']}},_0x58bc02={};_0x58bc02[_0x4922('0x33')]=_[_0x4922('0x44')](db[_0x4922('0x2c')]['rawAttributes']);_0x58bc02['query']=_[_0x4922('0x44')](_0xc7bd23[_0x4922('0x30')]);_0x58bc02[_0x4922('0x31')]=_['intersection'](_0x58bc02['model'],_0x58bc02[_0x4922('0x30')]);_0x1a4c06[_0x4922('0x35')]=_[_0x4922('0x32')](_0x58bc02[_0x4922('0x33')],qs[_0x4922('0x34')](_0xc7bd23[_0x4922('0x30')][_0x4922('0x34')]));_0x1a4c06[_0x4922('0x35')]=_0x1a4c06['attributes'][_0x4922('0x45')]?_0x1a4c06[_0x4922('0x35')]:_0x58bc02[_0x4922('0x33')];if(_0xc7bd23[_0x4922('0x30')][_0x4922('0x3e')]){_0x1a4c06[_0x4922('0x3f')]=[{'all':!![]}];}_0x1a4c06=_[_0x4922('0x3c')]({},_0x1a4c06,_0xc7bd23[_0x4922('0x46')]);return db[_0x4922('0x2c')][_0x4922('0x47')](_0x1a4c06)[_0x4922('0x24')](handleEntityNotFound(_0x114bb8,null))[_0x4922('0x24')](respondWithResult(_0x114bb8,null))[_0x4922('0x48')](handleError(_0x114bb8,null));};exports[_0x4922('0x49')]=function(_0x4c7c02,_0x58fadf){return db[_0x4922('0x2c')]['create'](_0x4c7c02[_0x4922('0x4a')],{})[_0x4922('0x24')](function(_0x2fd67b){var _0x4f1054=_0x4c7c02['user'][_0x4922('0x26')]({'plain':!![]});if(!_0x4f1054)throw new Error(_0x4922('0x4b'));if(_0x4f1054['role']===_0x4922('0x4c')){var _0x121b03=_0x2fd67b['get']({'plain':!![]});var _0x3a7330=_0x4922('0x4d');return db[_0x4922('0x4e')][_0x4922('0x47')]({'where':{'name':_0x3a7330,'userProfileId':_0x4f1054[_0x4922('0x4f')]},'raw':!![]})[_0x4922('0x24')](function(_0x1951eb){if(_0x1951eb&&_0x1951eb[_0x4922('0x50')]===0x0){return db[_0x4922('0x27')][_0x4922('0x49')]({'name':_0x121b03[_0x4922('0x29')],'resourceId':_0x121b03['id'],'type':_0x1951eb['name'],'sectionId':_0x1951eb['id']},{})[_0x4922('0x24')](function(){return _0x2fd67b;});}else{return _0x2fd67b;}})[_0x4922('0x48')](function(_0x15f169){logger[_0x4922('0x51')](_0x4922('0x52'),_0x15f169);throw _0x15f169;});}return _0x2fd67b;})[_0x4922('0x24')](respondWithResult(_0x58fadf,0xc9))[_0x4922('0x48')](handleError(_0x58fadf,null));};exports[_0x4922('0x23')]=function(_0x16daad,_0xb45a07){if(_0x16daad['body']['id']){delete _0x16daad['body']['id'];}return db[_0x4922('0x2c')][_0x4922('0x47')]({'where':{'id':_0x16daad['params']['id']}})[_0x4922('0x24')](handleEntityNotFound(_0xb45a07,null))[_0x4922('0x24')](saveUpdates(_0x16daad[_0x4922('0x4a')],null))[_0x4922('0x24')](respondWithResult(_0xb45a07,null))[_0x4922('0x48')](handleError(_0xb45a07,null));};exports[_0x4922('0x25')]=function(_0xbcc817,_0x2c0f35){return db[_0x4922('0x2c')][_0x4922('0x47')]({'where':{'id':_0xbcc817[_0x4922('0x43')]['id']}})[_0x4922('0x24')](handleEntityNotFound(_0x2c0f35,null))['then'](removeEntity(_0x2c0f35,null))[_0x4922('0x48')](handleError(_0x2c0f35,null));};
\ No newline at end of file
+var _0xb0b9=['params','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','get','ChanSpies','UserProfileResource','end','error','name','send','map','VoiceChanSpy','rawAttributes','fieldName','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','keys','includeAll','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','body','find'];(function(_0x1b2852,_0x277384){var _0x57b387=function(_0x2c7da4){while(--_0x2c7da4){_0x1b2852['push'](_0x1b2852['shift']());}};_0x57b387(++_0x277384);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x298060,_0x205bbf){_0x298060=_0x298060-0x0;var _0x2e50db=_0xb0b9[_0x298060];return _0x2e50db;};'use strict';var emlformat=require(_0x9b0b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9b0b('0x1'));var rp=require(_0x9b0b('0x2'));var moment=require(_0x9b0b('0x3'));var BPromise=require(_0x9b0b('0x4'));var Mustache=require(_0x9b0b('0x5'));var util=require(_0x9b0b('0x6'));var path=require(_0x9b0b('0x7'));var sox=require(_0x9b0b('0x8'));var csv=require(_0x9b0b('0x9'));var ejs=require(_0x9b0b('0xa'));var fs=require('fs');var fs_extra=require(_0x9b0b('0xb'));var _=require(_0x9b0b('0xc'));var squel=require(_0x9b0b('0xd'));var crypto=require(_0x9b0b('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9b0b('0x9'));var querystring=require(_0x9b0b('0xf'));var Papa=require(_0x9b0b('0x10'));var Redis=require(_0x9b0b('0x11'));var authService=require(_0x9b0b('0x12'));var qs=require(_0x9b0b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b0b('0x14'));var logger=require(_0x9b0b('0x15'))(_0x9b0b('0x16'));var utils=require(_0x9b0b('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9b0b('0x18'))['db'];function respondWithStatusCode(_0x4b3ed5,_0x283336){_0x283336=_0x283336||0xcc;return function(_0x4e6739){if(_0x4e6739){return _0x4b3ed5[_0x9b0b('0x19')](_0x283336);}return _0x4b3ed5[_0x9b0b('0x1a')](_0x283336)['end']();};}function respondWithResult(_0x5974af,_0x5f0555){_0x5f0555=_0x5f0555||0xc8;return function(_0xe9c112){if(_0xe9c112){return _0x5974af[_0x9b0b('0x1a')](_0x5f0555)['json'](_0xe9c112);}};}function respondWithFilteredResult(_0x248ff9,_0x377736){return function(_0x297b07){if(_0x297b07){var _0x1e92c1=typeof _0x377736[_0x9b0b('0x1b')]===_0x9b0b('0x1c')&&typeof _0x377736[_0x9b0b('0x1d')]===_0x9b0b('0x1c');var _0x1b7673=_0x297b07[_0x9b0b('0x1e')];var _0x264b6d=_0x1e92c1?0x0:_0x377736[_0x9b0b('0x1b')];var _0x3334e5=_0x1e92c1?_0x297b07[_0x9b0b('0x1e')]:_0x377736['offset']+_0x377736[_0x9b0b('0x1d')];var _0xee66f5;if(_0x3334e5>=_0x1b7673){_0x3334e5=_0x1b7673;_0xee66f5=0xc8;}else{_0xee66f5=0xce;}_0x248ff9[_0x9b0b('0x1a')](_0xee66f5);return _0x248ff9['set'](_0x9b0b('0x1f'),_0x264b6d+'-'+_0x3334e5+'/'+_0x1b7673)[_0x9b0b('0x20')](_0x297b07);}return null;};}function patchUpdates(_0x4067d3){return function(_0x565d35){try{jsonpatch[_0x9b0b('0x21')](_0x565d35,_0x4067d3,!![]);}catch(_0x2218d5){return BPromise[_0x9b0b('0x22')](_0x2218d5);}return _0x565d35[_0x9b0b('0x23')]();};}function saveUpdates(_0x4fe0a2,_0x30bfe8){return function(_0x408f70){if(_0x408f70){return _0x408f70['update'](_0x4fe0a2)[_0x9b0b('0x24')](function(_0x1e7789){return _0x1e7789;});}return null;};}function removeEntity(_0x3f433c,_0x16b413){return function(_0xbf0f87){if(_0xbf0f87){return _0xbf0f87[_0x9b0b('0x25')]()[_0x9b0b('0x24')](function(){var _0x322a0b=_0xbf0f87[_0x9b0b('0x26')]({'plain':!![]});var _0x5771fd=_0x9b0b('0x27');return db[_0x9b0b('0x28')][_0x9b0b('0x25')]({'where':{'type':_0x5771fd,'resourceId':_0x322a0b['id']}})[_0x9b0b('0x24')](function(){return _0xbf0f87;});})['then'](function(){_0x3f433c[_0x9b0b('0x1a')](0xcc)[_0x9b0b('0x29')]();});}};}function handleEntityNotFound(_0x5c9ec3,_0x2841fc){return function(_0x1e25fb){if(!_0x1e25fb){_0x5c9ec3[_0x9b0b('0x19')](0x194);}return _0x1e25fb;};}function handleError(_0x47a135,_0x2cfe21){_0x2cfe21=_0x2cfe21||0x1f4;return function(_0xa4f392){logger[_0x9b0b('0x2a')](_0xa4f392['stack']);if(_0xa4f392[_0x9b0b('0x2b')]){delete _0xa4f392[_0x9b0b('0x2b')];}_0x47a135[_0x9b0b('0x1a')](_0x2cfe21)[_0x9b0b('0x2c')](_0xa4f392);};}exports['index']=function(_0x347f76,_0xfa71df){var _0x48d324={},_0x272934={},_0x32cde1={'count':0x0,'rows':[]};var _0x328e82=_[_0x9b0b('0x2d')](db[_0x9b0b('0x2e')][_0x9b0b('0x2f')],function(_0xfd6ce){return{'name':_0xfd6ce[_0x9b0b('0x30')],'type':_0xfd6ce['type']['key']};});_0x272934[_0x9b0b('0x31')]=_['map'](_0x328e82,_0x9b0b('0x2b'));_0x272934['query']=_['keys'](_0x347f76['query']);_0x272934[_0x9b0b('0x32')]=_[_0x9b0b('0x33')](_0x272934[_0x9b0b('0x31')],_0x272934[_0x9b0b('0x34')]);_0x48d324[_0x9b0b('0x35')]=_[_0x9b0b('0x33')](_0x272934[_0x9b0b('0x31')],qs[_0x9b0b('0x36')](_0x347f76[_0x9b0b('0x34')][_0x9b0b('0x36')]));_0x48d324[_0x9b0b('0x35')]=_0x48d324[_0x9b0b('0x35')][_0x9b0b('0x37')]?_0x48d324['attributes']:_0x272934[_0x9b0b('0x31')];if(!_0x347f76[_0x9b0b('0x34')][_0x9b0b('0x38')](_0x9b0b('0x39'))){_0x48d324[_0x9b0b('0x1d')]=qs[_0x9b0b('0x1d')](_0x347f76[_0x9b0b('0x34')][_0x9b0b('0x1d')]);_0x48d324[_0x9b0b('0x1b')]=qs[_0x9b0b('0x1b')](_0x347f76[_0x9b0b('0x34')][_0x9b0b('0x1b')]);}_0x48d324[_0x9b0b('0x3a')]=qs['sort'](_0x347f76['query'][_0x9b0b('0x3b')]);_0x48d324[_0x9b0b('0x3c')]=qs[_0x9b0b('0x32')](_[_0x9b0b('0x3d')](_0x347f76[_0x9b0b('0x34')],_0x272934['filters']),_0x328e82);if(_0x347f76[_0x9b0b('0x34')][_0x9b0b('0x3e')]){_0x48d324[_0x9b0b('0x3c')]=_[_0x9b0b('0x3f')](_0x48d324['where'],{'$or':_['map'](_0x328e82,function(_0x1fffc4){if(_0x1fffc4['type']!==_0x9b0b('0x40')){var _0x316d86={};_0x316d86[_0x1fffc4[_0x9b0b('0x2b')]]={'$like':'%'+_0x347f76[_0x9b0b('0x34')][_0x9b0b('0x3e')]+'%'};return _0x316d86;}})});}_0x48d324=_[_0x9b0b('0x3f')]({},_0x48d324,_0x347f76[_0x9b0b('0x41')]);var _0x24724c={'where':_0x48d324[_0x9b0b('0x3c')]};return db[_0x9b0b('0x2e')][_0x9b0b('0x1e')](_0x24724c)[_0x9b0b('0x24')](function(_0x4049ad){_0x32cde1[_0x9b0b('0x1e')]=_0x4049ad;if(_0x347f76[_0x9b0b('0x34')]['includeAll']){_0x48d324['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0x9b0b('0x42')](_0x48d324);})[_0x9b0b('0x24')](function(_0x1522a1){_0x32cde1[_0x9b0b('0x43')]=_0x1522a1;return _0x32cde1;})[_0x9b0b('0x24')](respondWithFilteredResult(_0xfa71df,_0x48d324))['catch'](handleError(_0xfa71df,null));};exports['show']=function(_0x20ec55,_0x243063){var _0x8be3d0={'raw':![],'where':{'id':_0x20ec55['params']['id']}},_0x136a33={};_0x136a33[_0x9b0b('0x31')]=_[_0x9b0b('0x44')](db[_0x9b0b('0x2e')][_0x9b0b('0x2f')]);_0x136a33[_0x9b0b('0x34')]=_['keys'](_0x20ec55[_0x9b0b('0x34')]);_0x136a33[_0x9b0b('0x32')]=_[_0x9b0b('0x33')](_0x136a33[_0x9b0b('0x31')],_0x136a33[_0x9b0b('0x34')]);_0x8be3d0[_0x9b0b('0x35')]=_[_0x9b0b('0x33')](_0x136a33[_0x9b0b('0x31')],qs['fields'](_0x20ec55['query']['fields']));_0x8be3d0[_0x9b0b('0x35')]=_0x8be3d0[_0x9b0b('0x35')][_0x9b0b('0x37')]?_0x8be3d0[_0x9b0b('0x35')]:_0x136a33[_0x9b0b('0x31')];if(_0x20ec55[_0x9b0b('0x34')][_0x9b0b('0x45')]){_0x8be3d0[_0x9b0b('0x46')]=[{'all':!![]}];}_0x8be3d0=_[_0x9b0b('0x3f')]({},_0x8be3d0,_0x20ec55[_0x9b0b('0x41')]);return db[_0x9b0b('0x2e')]['find'](_0x8be3d0)[_0x9b0b('0x24')](handleEntityNotFound(_0x243063,null))[_0x9b0b('0x24')](respondWithResult(_0x243063,null))['catch'](handleError(_0x243063,null));};exports['create']=function(_0xd9410f,_0x990950){return db[_0x9b0b('0x2e')][_0x9b0b('0x47')](_0xd9410f['body'],{})[_0x9b0b('0x24')](function(_0x348444){var _0x3eeb0c=_0xd9410f[_0x9b0b('0x48')][_0x9b0b('0x26')]({'plain':!![]});if(!_0x3eeb0c)throw new Error(_0x9b0b('0x49'));if(_0x3eeb0c[_0x9b0b('0x4a')]===_0x9b0b('0x48')){var _0x146654=_0x348444['get']({'plain':!![]});var _0x1a6cf8='ChanSpies';return db[_0x9b0b('0x4b')]['find']({'where':{'name':_0x1a6cf8,'userProfileId':_0x3eeb0c['userProfileId']},'raw':!![]})[_0x9b0b('0x24')](function(_0x2238d1){if(_0x2238d1&&_0x2238d1[_0x9b0b('0x4c')]===0x0){return db[_0x9b0b('0x28')][_0x9b0b('0x47')]({'name':_0x146654[_0x9b0b('0x2b')],'resourceId':_0x146654['id'],'type':_0x2238d1[_0x9b0b('0x2b')],'sectionId':_0x2238d1['id']},{})['then'](function(){return _0x348444;});}else{return _0x348444;}})['catch'](function(_0x4bba88){logger[_0x9b0b('0x2a')](_0x9b0b('0x4d'),_0x4bba88);throw _0x4bba88;});}return _0x348444;})[_0x9b0b('0x24')](respondWithResult(_0x990950,0xc9))[_0x9b0b('0x4e')](handleError(_0x990950,null));};exports[_0x9b0b('0x4f')]=function(_0x41331d,_0x5a568e){if(_0x41331d[_0x9b0b('0x50')]['id']){delete _0x41331d[_0x9b0b('0x50')]['id'];}return db['VoiceChanSpy']['find']({'where':{'id':_0x41331d['params']['id']}})[_0x9b0b('0x24')](handleEntityNotFound(_0x5a568e,null))[_0x9b0b('0x24')](saveUpdates(_0x41331d['body'],null))['then'](respondWithResult(_0x5a568e,null))['catch'](handleError(_0x5a568e,null));};exports[_0x9b0b('0x25')]=function(_0x2d8637,_0x23225c){return db[_0x9b0b('0x2e')][_0x9b0b('0x51')]({'where':{'id':_0x2d8637[_0x9b0b('0x52')]['id']}})[_0x9b0b('0x24')](handleEntityNotFound(_0x23225c,null))[_0x9b0b('0x24')](removeEntity(_0x23225c,null))[_0x9b0b('0x4e')](handleError(_0x23225c,null));};
\ No newline at end of file