Built motion from commit eddce310.|2.6.12
[motion2.git] / server / api / pause / pause.controller.js
index 70bba6c..d90370e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5e7=['lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','Pauses','error','stack','name','send','index','Pause','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','length','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','moment','bluebird','to-csv','ejs','fs-extra'];(function(_0x2386f2,_0x44a57b){var _0x587a2a=function(_0x4516d0){while(--_0x4516d0){_0x2386f2['push'](_0x2386f2['shift']());}};_0x587a2a(++_0x44a57b);}(_0xb5e7,0x9a));var _0x7b5e=function(_0x565f6a,_0x4d26e0){_0x565f6a=_0x565f6a-0x0;var _0x1a0fdb=_0xb5e7[_0x565f6a];return _0x1a0fdb;};'use strict';var emlformat=require(_0x7b5e('0x0'));var rimraf=require(_0x7b5e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b5e('0x2'));var rp=require('request-promise');var moment=require(_0x7b5e('0x3'));var BPromise=require(_0x7b5e('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7b5e('0x5'));var ejs=require(_0x7b5e('0x6'));var fs=require('fs');var fs_extra=require(_0x7b5e('0x7'));var _=require(_0x7b5e('0x8'));var squel=require(_0x7b5e('0x9'));var crypto=require(_0x7b5e('0xa'));var jsforce=require(_0x7b5e('0xb'));var deskjs=require(_0x7b5e('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7b5e('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7b5e('0xe'));var as=require(_0x7b5e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b5e('0x10'))(_0x7b5e('0x11'));var utils=require('../../config/utils');var config=require(_0x7b5e('0x12'));var licenseUtil=require(_0x7b5e('0x13'));var db=require(_0x7b5e('0x14'))['db'];function respondWithStatusCode(_0x3ba32c,_0x5dadf0){_0x5dadf0=_0x5dadf0||0xcc;return function(_0x3cc82d){if(_0x3cc82d){return _0x3ba32c[_0x7b5e('0x15')](_0x5dadf0);}return _0x3ba32c['status'](_0x5dadf0)[_0x7b5e('0x16')]();};}function respondWithResult(_0x20dd1a,_0x17f4b1){_0x17f4b1=_0x17f4b1||0xc8;return function(_0x3db27a){if(_0x3db27a){return _0x20dd1a[_0x7b5e('0x17')](_0x17f4b1)[_0x7b5e('0x18')](_0x3db27a);}};}function respondWithFilteredResult(_0x1b5178,_0x1d2229){return function(_0x3716c7){if(_0x3716c7){var _0x28c6ef=typeof _0x1d2229[_0x7b5e('0x19')]===_0x7b5e('0x1a')&&typeof _0x1d2229[_0x7b5e('0x1b')]===_0x7b5e('0x1a');var _0xc03a64=_0x3716c7[_0x7b5e('0x1c')];var _0x118b2b=_0x28c6ef?0x0:_0x1d2229[_0x7b5e('0x19')];var _0x4eea84=_0x28c6ef?_0x3716c7['count']:_0x1d2229[_0x7b5e('0x19')]+_0x1d2229[_0x7b5e('0x1b')];var _0x288b29;if(_0x4eea84>=_0xc03a64){_0x4eea84=_0xc03a64;_0x288b29=0xc8;}else{_0x288b29=0xce;}_0x1b5178['status'](_0x288b29);return _0x1b5178[_0x7b5e('0x1d')]('Content-Range',_0x118b2b+'-'+_0x4eea84+'/'+_0xc03a64)['json'](_0x3716c7);}return null;};}function patchUpdates(_0x36e589){return function(_0x53d1ea){try{jsonpatch[_0x7b5e('0x1e')](_0x53d1ea,_0x36e589,!![]);}catch(_0x4773b1){return BPromise[_0x7b5e('0x1f')](_0x4773b1);}return _0x53d1ea[_0x7b5e('0x20')]();};}function saveUpdates(_0x540030,_0x431cc1){return function(_0x7c5b99){if(_0x7c5b99){return _0x7c5b99[_0x7b5e('0x21')](_0x540030)[_0x7b5e('0x22')](function(_0x457d93){return _0x457d93;});}return null;};}function removeEntity(_0x347337,_0x56bbc3){return function(_0x4e473e){if(_0x4e473e){return _0x4e473e[_0x7b5e('0x23')]()[_0x7b5e('0x22')](function(){var _0x56a874=_0x4e473e[_0x7b5e('0x24')]({'plain':!![]});var _0x267ea9=_0x7b5e('0x25');return db['UserProfileResource'][_0x7b5e('0x23')]({'where':{'type':_0x267ea9,'resourceId':_0x56a874['id']}})[_0x7b5e('0x22')](function(){return _0x4e473e;});})[_0x7b5e('0x22')](function(){_0x347337[_0x7b5e('0x17')](0xcc)[_0x7b5e('0x16')]();});}};}function handleEntityNotFound(_0xaaf16f,_0x5d7c49){return function(_0x5132dd){if(!_0x5132dd){_0xaaf16f[_0x7b5e('0x15')](0x194);}return _0x5132dd;};}function handleError(_0x2756ba,_0x4a7476){_0x4a7476=_0x4a7476||0x1f4;return function(_0x22c5a5){logger[_0x7b5e('0x26')](_0x22c5a5[_0x7b5e('0x27')]);if(_0x22c5a5[_0x7b5e('0x28')]){delete _0x22c5a5[_0x7b5e('0x28')];}_0x2756ba['status'](_0x4a7476)[_0x7b5e('0x29')](_0x22c5a5);};}exports[_0x7b5e('0x2a')]=function(_0x3163d6,_0x2ef0f5){var _0x1c732b={},_0x2fea13={},_0x28e25b={'count':0x0,'rows':[]};var _0x3661da=_['map'](db[_0x7b5e('0x2b')][_0x7b5e('0x2c')],function(_0x1cf5df){return{'name':_0x1cf5df[_0x7b5e('0x2d')],'type':_0x1cf5df[_0x7b5e('0x2e')][_0x7b5e('0x2f')]};});_0x2fea13[_0x7b5e('0x30')]=_[_0x7b5e('0x31')](_0x3661da,'name');_0x2fea13[_0x7b5e('0x32')]=_[_0x7b5e('0x33')](_0x3163d6[_0x7b5e('0x32')]);_0x2fea13[_0x7b5e('0x34')]=_[_0x7b5e('0x35')](_0x2fea13[_0x7b5e('0x30')],_0x2fea13[_0x7b5e('0x32')]);_0x1c732b[_0x7b5e('0x36')]=_[_0x7b5e('0x35')](_0x2fea13[_0x7b5e('0x30')],qs[_0x7b5e('0x37')](_0x3163d6['query'][_0x7b5e('0x37')]));_0x1c732b[_0x7b5e('0x36')]=_0x1c732b['attributes']['length']?_0x1c732b[_0x7b5e('0x36')]:_0x2fea13['model'];if(!_0x3163d6['query'][_0x7b5e('0x38')](_0x7b5e('0x39'))){_0x1c732b[_0x7b5e('0x1b')]=qs['limit'](_0x3163d6[_0x7b5e('0x32')][_0x7b5e('0x1b')]);_0x1c732b[_0x7b5e('0x19')]=qs['offset'](_0x3163d6[_0x7b5e('0x32')][_0x7b5e('0x19')]);}_0x1c732b['order']=qs['sort'](_0x3163d6[_0x7b5e('0x32')]['sort']);_0x1c732b[_0x7b5e('0x3a')]=qs[_0x7b5e('0x34')](_[_0x7b5e('0x3b')](_0x3163d6[_0x7b5e('0x32')],_0x2fea13[_0x7b5e('0x34')]),_0x3661da);if(_0x3163d6['query'][_0x7b5e('0x3c')]){_0x1c732b[_0x7b5e('0x3a')]=_[_0x7b5e('0x3d')](_0x1c732b[_0x7b5e('0x3a')],{'$or':_[_0x7b5e('0x31')](_0x3661da,function(_0x234aeb){if(_0x234aeb[_0x7b5e('0x2e')]!==_0x7b5e('0x3e')){var _0x2d6be6={};_0x2d6be6[_0x234aeb[_0x7b5e('0x28')]]={'$like':'%'+_0x3163d6[_0x7b5e('0x32')][_0x7b5e('0x3c')]+'%'};return _0x2d6be6;}})});}_0x1c732b=_[_0x7b5e('0x3d')]({},_0x1c732b,_0x3163d6['options']);var _0xfb7e5a={'where':_0x1c732b[_0x7b5e('0x3a')]};return db[_0x7b5e('0x2b')][_0x7b5e('0x1c')](_0xfb7e5a)[_0x7b5e('0x22')](function(_0x57b458){_0x28e25b[_0x7b5e('0x1c')]=_0x57b458;if(_0x3163d6[_0x7b5e('0x32')][_0x7b5e('0x3f')]){_0x1c732b[_0x7b5e('0x40')]=[{'all':!![]}];}return db[_0x7b5e('0x2b')]['findAll'](_0x1c732b);})[_0x7b5e('0x22')](function(_0x389ec0){_0x28e25b[_0x7b5e('0x41')]=_0x389ec0;return _0x28e25b;})['then'](respondWithFilteredResult(_0x2ef0f5,_0x1c732b))['catch'](handleError(_0x2ef0f5,null));};exports[_0x7b5e('0x42')]=function(_0x20fd32,_0x2589bb){var _0x501dd9={'raw':!![],'where':{'id':_0x20fd32[_0x7b5e('0x43')]['id']}},_0x531c32={};_0x531c32['model']=_[_0x7b5e('0x33')](db['Pause'][_0x7b5e('0x2c')]);_0x531c32[_0x7b5e('0x32')]=_[_0x7b5e('0x33')](_0x20fd32['query']);_0x531c32[_0x7b5e('0x34')]=_[_0x7b5e('0x35')](_0x531c32[_0x7b5e('0x30')],_0x531c32[_0x7b5e('0x32')]);_0x501dd9[_0x7b5e('0x36')]=_[_0x7b5e('0x35')](_0x531c32['model'],qs['fields'](_0x20fd32[_0x7b5e('0x32')]['fields']));_0x501dd9[_0x7b5e('0x36')]=_0x501dd9[_0x7b5e('0x36')][_0x7b5e('0x44')]?_0x501dd9[_0x7b5e('0x36')]:_0x531c32[_0x7b5e('0x30')];if(_0x20fd32['query']['includeAll']){_0x501dd9[_0x7b5e('0x40')]=[{'all':!![]}];}_0x501dd9=_[_0x7b5e('0x3d')]({},_0x501dd9,_0x20fd32[_0x7b5e('0x45')]);return db['Pause'][_0x7b5e('0x46')](_0x501dd9)[_0x7b5e('0x22')](handleEntityNotFound(_0x2589bb,null))['then'](respondWithResult(_0x2589bb,null))[_0x7b5e('0x47')](handleError(_0x2589bb,null));};exports[_0x7b5e('0x48')]=function(_0x5c1359,_0x4886d8){return db[_0x7b5e('0x2b')][_0x7b5e('0x48')](_0x5c1359[_0x7b5e('0x49')],{})[_0x7b5e('0x22')](function(_0x34795e){var _0x57ffa4=_0x5c1359[_0x7b5e('0x4a')][_0x7b5e('0x24')]({'plain':!![]});if(!_0x57ffa4)throw new Error(_0x7b5e('0x4b'));if(_0x57ffa4[_0x7b5e('0x4c')]===_0x7b5e('0x4a')){var _0xd8e38a=_0x34795e[_0x7b5e('0x24')]({'plain':!![]});var _0x23a79c=_0x7b5e('0x25');return db[_0x7b5e('0x4d')][_0x7b5e('0x46')]({'where':{'name':_0x23a79c,'userProfileId':_0x57ffa4[_0x7b5e('0x4e')]},'raw':!![]})[_0x7b5e('0x22')](function(_0x55e7c8){if(_0x55e7c8&&_0x55e7c8['autoAssociation']===0x0){return db[_0x7b5e('0x4f')][_0x7b5e('0x48')]({'name':_0xd8e38a[_0x7b5e('0x28')],'resourceId':_0xd8e38a['id'],'type':_0x55e7c8[_0x7b5e('0x28')],'sectionId':_0x55e7c8['id']},{})[_0x7b5e('0x22')](function(){return _0x34795e;});}else{return _0x34795e;}})[_0x7b5e('0x47')](function(_0x466ec4){logger[_0x7b5e('0x26')](_0x7b5e('0x50'),_0x466ec4);throw _0x466ec4;});}return _0x34795e;})[_0x7b5e('0x22')](respondWithResult(_0x4886d8,0xc9))[_0x7b5e('0x47')](handleError(_0x4886d8,null));};exports[_0x7b5e('0x21')]=function(_0x2800f9,_0x4070b9){if(_0x2800f9[_0x7b5e('0x49')]['id']){delete _0x2800f9[_0x7b5e('0x49')]['id'];}return db[_0x7b5e('0x2b')][_0x7b5e('0x46')]({'where':{'id':_0x2800f9[_0x7b5e('0x43')]['id']}})['then'](handleEntityNotFound(_0x4070b9,null))[_0x7b5e('0x22')](saveUpdates(_0x2800f9[_0x7b5e('0x49')],null))[_0x7b5e('0x22')](respondWithResult(_0x4070b9,null))['catch'](handleError(_0x4070b9,null));};exports[_0x7b5e('0x23')]=function(_0x58aaca,_0x3e9d5b){return db[_0x7b5e('0x2b')]['find']({'where':{'id':_0x58aaca[_0x7b5e('0x43')]['id']}})['then'](handleEntityNotFound(_0x3e9d5b,null))['then'](removeEntity(_0x3e9d5b,null))[_0x7b5e('0x47')](handleError(_0x3e9d5b,null));};
\ No newline at end of file
+var _0xe1e4=['lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','then','Pauses','UserProfileResource','destroy','error','stack','name','Pause','rawAttributes','fieldName','key','map','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','filter','merge','options','count','includeAll','findAll','rows','catch','keys','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','update','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xe1e4,0x1db));var _0x4e1e=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xe1e4[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require(_0x4e1e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e1e('0x1'));var jsonpatch=require(_0x4e1e('0x2'));var rp=require(_0x4e1e('0x3'));var moment=require(_0x4e1e('0x4'));var BPromise=require(_0x4e1e('0x5'));var Mustache=require(_0x4e1e('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4e1e('0x7'));var csv=require(_0x4e1e('0x8'));var ejs=require(_0x4e1e('0x9'));var fs=require('fs');var fs_extra=require(_0x4e1e('0xa'));var _=require(_0x4e1e('0xb'));var squel=require('squel');var crypto=require(_0x4e1e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4e1e('0xd'));var toCsv=require(_0x4e1e('0x8'));var querystring=require(_0x4e1e('0xe'));var Papa=require(_0x4e1e('0xf'));var Redis=require(_0x4e1e('0x10'));var authService=require(_0x4e1e('0x11'));var qs=require(_0x4e1e('0x12'));var as=require(_0x4e1e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4e1e('0x14'));var utils=require('../../config/utils');var config=require(_0x4e1e('0x15'));var licenseUtil=require(_0x4e1e('0x16'));var db=require(_0x4e1e('0x17'))['db'];function respondWithStatusCode(_0x5b3e95,_0x4f46e3){_0x4f46e3=_0x4f46e3||0xcc;return function(_0x58918a){if(_0x58918a){return _0x5b3e95[_0x4e1e('0x18')](_0x4f46e3);}return _0x5b3e95[_0x4e1e('0x19')](_0x4f46e3)[_0x4e1e('0x1a')]();};}function respondWithResult(_0x4aa959,_0x2dc813){_0x2dc813=_0x2dc813||0xc8;return function(_0x206a51){if(_0x206a51){return _0x4aa959[_0x4e1e('0x19')](_0x2dc813)[_0x4e1e('0x1b')](_0x206a51);}};}function respondWithFilteredResult(_0x10c861,_0x58f3f4){return function(_0x4f9e92){if(_0x4f9e92){var _0x5b5464=typeof _0x58f3f4[_0x4e1e('0x1c')]===_0x4e1e('0x1d')&&typeof _0x58f3f4[_0x4e1e('0x1e')]==='undefined';var _0x1aa873=_0x4f9e92['count'];var _0x4cb45c=_0x5b5464?0x0:_0x58f3f4['offset'];var _0x1a4631=_0x5b5464?_0x4f9e92['count']:_0x58f3f4[_0x4e1e('0x1c')]+_0x58f3f4[_0x4e1e('0x1e')];var _0x5778e2;if(_0x1a4631>=_0x1aa873){_0x1a4631=_0x1aa873;_0x5778e2=0xc8;}else{_0x5778e2=0xce;}_0x10c861[_0x4e1e('0x19')](_0x5778e2);return _0x10c861['set'](_0x4e1e('0x1f'),_0x4cb45c+'-'+_0x1a4631+'/'+_0x1aa873)['json'](_0x4f9e92);}return null;};}function patchUpdates(_0x1b163a){return function(_0xb14a39){try{jsonpatch[_0x4e1e('0x20')](_0xb14a39,_0x1b163a,!![]);}catch(_0x49df7b){return BPromise[_0x4e1e('0x21')](_0x49df7b);}return _0xb14a39[_0x4e1e('0x22')]();};}function saveUpdates(_0x6a22f4,_0x1da023){return function(_0x3e5185){if(_0x3e5185){return _0x3e5185['update'](_0x6a22f4)[_0x4e1e('0x23')](function(_0x3285b9){return _0x3285b9;});}return null;};}function removeEntity(_0x45cc3d,_0xae7272){return function(_0x1d6bf2){if(_0x1d6bf2){return _0x1d6bf2['destroy']()[_0x4e1e('0x23')](function(){var _0x229cb0=_0x1d6bf2['get']({'plain':!![]});var _0x3ae6bb=_0x4e1e('0x24');return db[_0x4e1e('0x25')][_0x4e1e('0x26')]({'where':{'type':_0x3ae6bb,'resourceId':_0x229cb0['id']}})['then'](function(){return _0x1d6bf2;});})[_0x4e1e('0x23')](function(){_0x45cc3d[_0x4e1e('0x19')](0xcc)[_0x4e1e('0x1a')]();});}};}function handleEntityNotFound(_0x45d184,_0x14cb01){return function(_0x33bda3){if(!_0x33bda3){_0x45d184[_0x4e1e('0x18')](0x194);}return _0x33bda3;};}function handleError(_0x42960c,_0x426cf8){_0x426cf8=_0x426cf8||0x1f4;return function(_0x5e2742){logger[_0x4e1e('0x27')](_0x5e2742[_0x4e1e('0x28')]);if(_0x5e2742[_0x4e1e('0x29')]){delete _0x5e2742[_0x4e1e('0x29')];}_0x42960c[_0x4e1e('0x19')](_0x426cf8)['send'](_0x5e2742);};}exports['index']=function(_0xbfd6b3,_0x51dd87){var _0x24ae02={},_0x5aaf55={},_0x4a5cfe={'count':0x0,'rows':[]};var _0x200129=_['map'](db[_0x4e1e('0x2a')][_0x4e1e('0x2b')],function(_0x5813d5){return{'name':_0x5813d5[_0x4e1e('0x2c')],'type':_0x5813d5['type'][_0x4e1e('0x2d')]};});_0x5aaf55['model']=_[_0x4e1e('0x2e')](_0x200129,_0x4e1e('0x29'));_0x5aaf55[_0x4e1e('0x2f')]=_['keys'](_0xbfd6b3[_0x4e1e('0x2f')]);_0x5aaf55[_0x4e1e('0x30')]=_[_0x4e1e('0x31')](_0x5aaf55[_0x4e1e('0x32')],_0x5aaf55['query']);_0x24ae02[_0x4e1e('0x33')]=_[_0x4e1e('0x31')](_0x5aaf55[_0x4e1e('0x32')],qs[_0x4e1e('0x34')](_0xbfd6b3['query']['fields']));_0x24ae02['attributes']=_0x24ae02[_0x4e1e('0x33')]['length']?_0x24ae02['attributes']:_0x5aaf55[_0x4e1e('0x32')];if(!_0xbfd6b3[_0x4e1e('0x2f')][_0x4e1e('0x35')](_0x4e1e('0x36'))){_0x24ae02[_0x4e1e('0x1e')]=qs[_0x4e1e('0x1e')](_0xbfd6b3[_0x4e1e('0x2f')]['limit']);_0x24ae02[_0x4e1e('0x1c')]=qs[_0x4e1e('0x1c')](_0xbfd6b3[_0x4e1e('0x2f')][_0x4e1e('0x1c')]);}_0x24ae02[_0x4e1e('0x37')]=qs[_0x4e1e('0x38')](_0xbfd6b3[_0x4e1e('0x2f')]['sort']);_0x24ae02['where']=qs[_0x4e1e('0x30')](_[_0x4e1e('0x39')](_0xbfd6b3['query'],_0x5aaf55[_0x4e1e('0x30')]),_0x200129);if(_0xbfd6b3[_0x4e1e('0x2f')]['filter']){_0x24ae02[_0x4e1e('0x3a')]=_['merge'](_0x24ae02[_0x4e1e('0x3a')],{'$or':_[_0x4e1e('0x2e')](_0x200129,function(_0x15c514){if(_0x15c514[_0x4e1e('0x3b')]!==_0x4e1e('0x3c')){var _0x10467f={};_0x10467f[_0x15c514[_0x4e1e('0x29')]]={'$like':'%'+_0xbfd6b3['query'][_0x4e1e('0x3d')]+'%'};return _0x10467f;}})});}_0x24ae02=_[_0x4e1e('0x3e')]({},_0x24ae02,_0xbfd6b3[_0x4e1e('0x3f')]);var _0x2f2497={'where':_0x24ae02[_0x4e1e('0x3a')]};return db['Pause'][_0x4e1e('0x40')](_0x2f2497)[_0x4e1e('0x23')](function(_0xc83d7a){_0x4a5cfe[_0x4e1e('0x40')]=_0xc83d7a;if(_0xbfd6b3[_0x4e1e('0x2f')][_0x4e1e('0x41')]){_0x24ae02['include']=[{'all':!![]}];}return db[_0x4e1e('0x2a')][_0x4e1e('0x42')](_0x24ae02);})[_0x4e1e('0x23')](function(_0xb5bddc){_0x4a5cfe[_0x4e1e('0x43')]=_0xb5bddc;return _0x4a5cfe;})[_0x4e1e('0x23')](respondWithFilteredResult(_0x51dd87,_0x24ae02))[_0x4e1e('0x44')](handleError(_0x51dd87,null));};exports['show']=function(_0x31b0f3,_0x343bcf){var _0x1b4d69={'raw':!![],'where':{'id':_0x31b0f3['params']['id']}},_0x2863da={};_0x2863da['model']=_[_0x4e1e('0x45')](db['Pause'][_0x4e1e('0x2b')]);_0x2863da[_0x4e1e('0x2f')]=_[_0x4e1e('0x45')](_0x31b0f3[_0x4e1e('0x2f')]);_0x2863da['filters']=_[_0x4e1e('0x31')](_0x2863da[_0x4e1e('0x32')],_0x2863da[_0x4e1e('0x2f')]);_0x1b4d69[_0x4e1e('0x33')]=_['intersection'](_0x2863da[_0x4e1e('0x32')],qs[_0x4e1e('0x34')](_0x31b0f3[_0x4e1e('0x2f')][_0x4e1e('0x34')]));_0x1b4d69[_0x4e1e('0x33')]=_0x1b4d69['attributes'][_0x4e1e('0x46')]?_0x1b4d69[_0x4e1e('0x33')]:_0x2863da[_0x4e1e('0x32')];if(_0x31b0f3[_0x4e1e('0x2f')][_0x4e1e('0x41')]){_0x1b4d69['include']=[{'all':!![]}];}_0x1b4d69=_[_0x4e1e('0x3e')]({},_0x1b4d69,_0x31b0f3[_0x4e1e('0x3f')]);return db[_0x4e1e('0x2a')][_0x4e1e('0x47')](_0x1b4d69)[_0x4e1e('0x23')](handleEntityNotFound(_0x343bcf,null))[_0x4e1e('0x23')](respondWithResult(_0x343bcf,null))['catch'](handleError(_0x343bcf,null));};exports[_0x4e1e('0x48')]=function(_0x57e157,_0x14924a){return db[_0x4e1e('0x2a')][_0x4e1e('0x48')](_0x57e157['body'],{})['then'](function(_0x436d17){var _0x405b5b=_0x57e157[_0x4e1e('0x49')]['get']({'plain':!![]});if(!_0x405b5b)throw new Error(_0x4e1e('0x4a'));if(_0x405b5b['role']===_0x4e1e('0x49')){var _0x214084=_0x436d17[_0x4e1e('0x4b')]({'plain':!![]});var _0x3768f1=_0x4e1e('0x24');return db[_0x4e1e('0x4c')][_0x4e1e('0x47')]({'where':{'name':_0x3768f1,'userProfileId':_0x405b5b[_0x4e1e('0x4d')]},'raw':!![]})[_0x4e1e('0x23')](function(_0x196c37){if(_0x196c37&&_0x196c37['autoAssociation']===0x0){return db['UserProfileResource'][_0x4e1e('0x48')]({'name':_0x214084['name'],'resourceId':_0x214084['id'],'type':_0x196c37['name'],'sectionId':_0x196c37['id']},{})[_0x4e1e('0x23')](function(){return _0x436d17;});}else{return _0x436d17;}})[_0x4e1e('0x44')](function(_0x553fd4){logger[_0x4e1e('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x553fd4);throw _0x553fd4;});}return _0x436d17;})[_0x4e1e('0x23')](respondWithResult(_0x14924a,0xc9))[_0x4e1e('0x44')](handleError(_0x14924a,null));};exports[_0x4e1e('0x4e')]=function(_0x51b9f2,_0x1dfabd){if(_0x51b9f2[_0x4e1e('0x4f')]['id']){delete _0x51b9f2['body']['id'];}return db[_0x4e1e('0x2a')][_0x4e1e('0x47')]({'where':{'id':_0x51b9f2[_0x4e1e('0x50')]['id']}})[_0x4e1e('0x23')](handleEntityNotFound(_0x1dfabd,null))['then'](saveUpdates(_0x51b9f2[_0x4e1e('0x4f')],null))[_0x4e1e('0x23')](respondWithResult(_0x1dfabd,null))[_0x4e1e('0x44')](handleError(_0x1dfabd,null));};exports[_0x4e1e('0x26')]=function(_0x607532,_0x4a110e){return db[_0x4e1e('0x2a')][_0x4e1e('0x47')]({'where':{'id':_0x607532[_0x4e1e('0x50')]['id']}})[_0x4e1e('0x23')](handleEntityNotFound(_0x4a110e,null))[_0x4e1e('0x23')](removeEntity(_0x4a110e,null))['catch'](handleError(_0x4a110e,null));};
\ No newline at end of file