Built motion from commit d5e4af8c.|2.6.23
[motion2.git] / server / api / pause / pause.controller.js
index b2b2b07..ce92cdb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62bd=['find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','count','offset','Content-Range','reject','save','update','destroy','then','get','Pauses','UserProfileResource','sendStatus','error','stack','name','send','map','Pause','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes'];(function(_0x119248,_0xfa77b5){var _0x431917=function(_0x2e97f3){while(--_0x2e97f3){_0x119248['push'](_0x119248['shift']());}};_0x431917(++_0xfa77b5);}(_0x62bd,0xb3));var _0xd62b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x62bd[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd62b('0x0'));var rimraf=require(_0xd62b('0x1'));var zipdir=require(_0xd62b('0x2'));var jsonpatch=require(_0xd62b('0x3'));var rp=require(_0xd62b('0x4'));var moment=require(_0xd62b('0x5'));var BPromise=require(_0xd62b('0x6'));var Mustache=require(_0xd62b('0x7'));var util=require(_0xd62b('0x8'));var path=require(_0xd62b('0x9'));var sox=require(_0xd62b('0xa'));var csv=require('to-csv');var ejs=require(_0xd62b('0xb'));var fs=require('fs');var _=require(_0xd62b('0xc'));var squel=require(_0xd62b('0xd'));var crypto=require(_0xd62b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd62b('0xf'));var toCsv=require(_0xd62b('0x10'));var querystring=require('querystring');var Papa=require(_0xd62b('0x11'));var Redis=require(_0xd62b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd62b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd62b('0x14'));var logger=require(_0xd62b('0x15'))(_0xd62b('0x16'));var utils=require(_0xd62b('0x17'));var config=require(_0xd62b('0x18'));var licenseUtil=require(_0xd62b('0x19'));var db=require(_0xd62b('0x1a'))['db'];function respondWithStatusCode(_0x311777,_0x2c8743){_0x2c8743=_0x2c8743||0xcc;return function(_0x58ad2a){if(_0x58ad2a){return _0x311777['sendStatus'](_0x2c8743);}return _0x311777[_0xd62b('0x1b')](_0x2c8743)[_0xd62b('0x1c')]();};}function respondWithResult(_0x3518a8,_0x277907){_0x277907=_0x277907||0xc8;return function(_0x44b79f){if(_0x44b79f){return _0x3518a8[_0xd62b('0x1b')](_0x277907)[_0xd62b('0x1d')](_0x44b79f);}};}function respondWithFilteredResult(_0x1f9c2e,_0x5c5fa3){return function(_0x52eff3){if(_0x52eff3){var _0x4e8f57=_0x52eff3[_0xd62b('0x1e')],_0x3acdbb=_0x5c5fa3[_0xd62b('0x1f')],_0x4423c1=_0x5c5fa3['offset']+_0x5c5fa3['limit'],_0x32ad9a;if(_0x4423c1>=_0x4e8f57){_0x4423c1=_0x4e8f57;_0x32ad9a=0xc8;}else{_0x32ad9a=0xce;}_0x1f9c2e[_0xd62b('0x1b')](_0x32ad9a);return _0x1f9c2e['set'](_0xd62b('0x20'),_0x3acdbb+'-'+_0x4423c1+'/'+_0x4e8f57)[_0xd62b('0x1d')](_0x52eff3);}return null;};}function patchUpdates(_0x3b6257){return function(_0x3b490){try{jsonpatch['apply'](_0x3b490,_0x3b6257,!![]);}catch(_0x3d5f9d){return BPromise[_0xd62b('0x21')](_0x3d5f9d);}return _0x3b490[_0xd62b('0x22')]();};}function saveUpdates(_0x34cae7,_0x322fc8){return function(_0x508370){if(_0x508370){return _0x508370[_0xd62b('0x23')](_0x34cae7)['then'](function(_0x39662a){return _0x39662a;});}return null;};}function removeEntity(_0x284165,_0x8eee57){return function(_0x1c76b3){if(_0x1c76b3){return _0x1c76b3[_0xd62b('0x24')]()[_0xd62b('0x25')](function(){var _0x224105=_0x1c76b3[_0xd62b('0x26')]({'plain':!![]});var _0x44c882=_0xd62b('0x27');return db[_0xd62b('0x28')][_0xd62b('0x24')]({'where':{'type':_0x44c882,'resourceId':_0x224105['id']}})['then'](function(){return _0x1c76b3;});})[_0xd62b('0x25')](function(){_0x284165[_0xd62b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bda60,_0x446833){return function(_0x116564){if(!_0x116564){_0x4bda60[_0xd62b('0x29')](0x194);}return _0x116564;};}function handleError(_0xab2870,_0xe6ad00){_0xe6ad00=_0xe6ad00||0x1f4;return function(_0x124d74){logger[_0xd62b('0x2a')](_0x124d74[_0xd62b('0x2b')]);if(_0x124d74[_0xd62b('0x2c')]){delete _0x124d74['name'];}_0xab2870[_0xd62b('0x1b')](_0xe6ad00)[_0xd62b('0x2d')](_0x124d74);};}exports['index']=function(_0x31ad99,_0x3ac4fb){var _0x12b8a0={},_0x19e670={},_0x23b7f1={'count':0x0,'rows':[]};var _0x5c875d=_[_0xd62b('0x2e')](db[_0xd62b('0x2f')]['rawAttributes'],function(_0x458c25){return{'name':_0x458c25[_0xd62b('0x30')],'type':_0x458c25[_0xd62b('0x31')][_0xd62b('0x32')]};});_0x19e670[_0xd62b('0x33')]=_[_0xd62b('0x2e')](_0x5c875d,'name');_0x19e670[_0xd62b('0x34')]=_[_0xd62b('0x35')](_0x31ad99['query']);_0x19e670[_0xd62b('0x36')]=_[_0xd62b('0x37')](_0x19e670[_0xd62b('0x33')],_0x19e670[_0xd62b('0x34')]);_0x12b8a0[_0xd62b('0x38')]=_[_0xd62b('0x37')](_0x19e670[_0xd62b('0x33')],qs[_0xd62b('0x39')](_0x31ad99[_0xd62b('0x34')]['fields']));_0x12b8a0['attributes']=_0x12b8a0['attributes'][_0xd62b('0x3a')]?_0x12b8a0['attributes']:_0x19e670['model'];if(!_0x31ad99['query'][_0xd62b('0x3b')]('nolimit')){_0x12b8a0[_0xd62b('0x3c')]=qs[_0xd62b('0x3c')](_0x31ad99[_0xd62b('0x34')]['limit']);_0x12b8a0[_0xd62b('0x1f')]=qs[_0xd62b('0x1f')](_0x31ad99['query'][_0xd62b('0x1f')]);}_0x12b8a0[_0xd62b('0x3d')]=qs[_0xd62b('0x3e')](_0x31ad99[_0xd62b('0x34')][_0xd62b('0x3e')]);_0x12b8a0['where']=qs[_0xd62b('0x36')](_[_0xd62b('0x3f')](_0x31ad99[_0xd62b('0x34')],_0x19e670['filters']),_0x5c875d);if(_0x31ad99[_0xd62b('0x34')][_0xd62b('0x40')]){_0x12b8a0[_0xd62b('0x41')]=_[_0xd62b('0x42')](_0x12b8a0[_0xd62b('0x41')],{'$or':_[_0xd62b('0x2e')](_0x5c875d,function(_0x258f33){if(_0x258f33[_0xd62b('0x31')]!==_0xd62b('0x43')){var _0x5baa5b={};_0x5baa5b[_0x258f33[_0xd62b('0x2c')]]={'$like':'%'+_0x31ad99['query']['filter']+'%'};return _0x5baa5b;}})});}_0x12b8a0=_[_0xd62b('0x42')]({},_0x12b8a0,_0x31ad99[_0xd62b('0x44')]);var _0x576a5e={'where':_0x12b8a0[_0xd62b('0x41')]};return db[_0xd62b('0x2f')]['count'](_0x576a5e)['then'](function(_0x448906){_0x23b7f1['count']=_0x448906;if(_0x31ad99[_0xd62b('0x34')][_0xd62b('0x45')]){_0x12b8a0[_0xd62b('0x46')]=[{'all':!![]}];}return db[_0xd62b('0x2f')][_0xd62b('0x47')](_0x12b8a0);})[_0xd62b('0x25')](function(_0x332bf0){_0x23b7f1['rows']=_0x332bf0;return _0x23b7f1;})[_0xd62b('0x25')](respondWithFilteredResult(_0x3ac4fb,_0x12b8a0))[_0xd62b('0x48')](handleError(_0x3ac4fb,null));};exports[_0xd62b('0x49')]=function(_0x126f59,_0x48ce4a){var _0x29193e={'raw':!![],'where':{'id':_0x126f59[_0xd62b('0x4a')]['id']}},_0x23e04a={};_0x23e04a[_0xd62b('0x33')]=_['keys'](db[_0xd62b('0x2f')][_0xd62b('0x4b')]);_0x23e04a[_0xd62b('0x34')]=_[_0xd62b('0x35')](_0x126f59[_0xd62b('0x34')]);_0x23e04a[_0xd62b('0x36')]=_[_0xd62b('0x37')](_0x23e04a[_0xd62b('0x33')],_0x23e04a[_0xd62b('0x34')]);_0x29193e[_0xd62b('0x38')]=_['intersection'](_0x23e04a[_0xd62b('0x33')],qs[_0xd62b('0x39')](_0x126f59[_0xd62b('0x34')]['fields']));_0x29193e[_0xd62b('0x38')]=_0x29193e[_0xd62b('0x38')]['length']?_0x29193e['attributes']:_0x23e04a[_0xd62b('0x33')];if(_0x126f59['query'][_0xd62b('0x45')]){_0x29193e[_0xd62b('0x46')]=[{'all':!![]}];}_0x29193e=_[_0xd62b('0x42')]({},_0x29193e,_0x126f59[_0xd62b('0x44')]);return db[_0xd62b('0x2f')][_0xd62b('0x4c')](_0x29193e)[_0xd62b('0x25')](handleEntityNotFound(_0x48ce4a,null))[_0xd62b('0x25')](respondWithResult(_0x48ce4a,null))[_0xd62b('0x48')](handleError(_0x48ce4a,null));};exports[_0xd62b('0x4d')]=function(_0x582935,_0x1c33f4){return db[_0xd62b('0x2f')][_0xd62b('0x4d')](_0x582935['body'],{})[_0xd62b('0x25')](function(_0xc2a564){var _0x1d3239=_0x582935[_0xd62b('0x4e')][_0xd62b('0x26')]({'plain':!![]});if(!_0x1d3239)throw new Error(_0xd62b('0x4f'));if(_0x1d3239[_0xd62b('0x50')]==='user'){var _0x41ed88=_0xc2a564['get']({'plain':!![]});var _0x123897=_0xd62b('0x27');return db['UserProfileSection'][_0xd62b('0x4c')]({'where':{'name':_0x123897,'userProfileId':_0x1d3239[_0xd62b('0x51')]},'raw':!![]})[_0xd62b('0x25')](function(_0x2000e6){if(_0x2000e6&&_0x2000e6[_0xd62b('0x52')]===0x0){return db[_0xd62b('0x28')]['create']({'name':_0x41ed88['name'],'resourceId':_0x41ed88['id'],'type':_0x2000e6[_0xd62b('0x2c')],'sectionId':_0x2000e6['id']},{})[_0xd62b('0x25')](function(){return _0xc2a564;});}else{return _0xc2a564;}})[_0xd62b('0x48')](function(_0xf30926){logger['error'](_0xd62b('0x53'),_0xf30926);throw _0xf30926;});}return _0xc2a564;})[_0xd62b('0x25')](respondWithResult(_0x1c33f4,0xc9))[_0xd62b('0x48')](handleError(_0x1c33f4,null));};exports[_0xd62b('0x23')]=function(_0x3808c1,_0x1d5491){if(_0x3808c1[_0xd62b('0x54')]['id']){delete _0x3808c1[_0xd62b('0x54')]['id'];}return db[_0xd62b('0x2f')]['find']({'where':{'id':_0x3808c1[_0xd62b('0x4a')]['id']}})[_0xd62b('0x25')](handleEntityNotFound(_0x1d5491,null))[_0xd62b('0x25')](saveUpdates(_0x3808c1['body'],null))[_0xd62b('0x25')](respondWithResult(_0x1d5491,null))[_0xd62b('0x48')](handleError(_0x1d5491,null));};exports['destroy']=function(_0x4f6098,_0x268b8b){return db[_0xd62b('0x2f')]['find']({'where':{'id':_0x4f6098[_0xd62b('0x4a')]['id']}})[_0xd62b('0x25')](handleEntityNotFound(_0x268b8b,null))[_0xd62b('0x25')](removeEntity(_0x268b8b,null))[_0xd62b('0x48')](handleError(_0x268b8b,null));};
\ No newline at end of file
+var _0xefc6=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','Pauses','destroy','sendStatus','error','name','send','map','Pause','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','rows','params','keys','rawAttributes','length','include','merge','catch','create','body','user'];(function(_0x54861f,_0x1ebd08){var _0x4a6c3c=function(_0x370d28){while(--_0x370d28){_0x54861f['push'](_0x54861f['shift']());}};_0x4a6c3c(++_0x1ebd08);}(_0xefc6,0xf8));var _0x6efc=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xefc6[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6efc('0x0'));var zipdir=require(_0x6efc('0x1'));var jsonpatch=require(_0x6efc('0x2'));var rp=require(_0x6efc('0x3'));var moment=require(_0x6efc('0x4'));var BPromise=require(_0x6efc('0x5'));var Mustache=require(_0x6efc('0x6'));var util=require(_0x6efc('0x7'));var path=require(_0x6efc('0x8'));var sox=require('sox');var csv=require(_0x6efc('0x9'));var ejs=require(_0x6efc('0xa'));var fs=require('fs');var fs_extra=require(_0x6efc('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6efc('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6efc('0xd'));var Papa=require('papaparse');var Redis=require(_0x6efc('0xe'));var authService=require(_0x6efc('0xf'));var qs=require(_0x6efc('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6efc('0x11'));var logger=require(_0x6efc('0x12'))(_0x6efc('0x13'));var utils=require('../../config/utils');var config=require(_0x6efc('0x14'));var licenseUtil=require(_0x6efc('0x15'));var db=require(_0x6efc('0x16'))['db'];function respondWithStatusCode(_0x1afd51,_0x2e1359){_0x2e1359=_0x2e1359||0xcc;return function(_0x57570e){if(_0x57570e){return _0x1afd51['sendStatus'](_0x2e1359);}return _0x1afd51[_0x6efc('0x17')](_0x2e1359)[_0x6efc('0x18')]();};}function respondWithResult(_0x180492,_0x5c57e9){_0x5c57e9=_0x5c57e9||0xc8;return function(_0x277cbd){if(_0x277cbd){return _0x180492['status'](_0x5c57e9)[_0x6efc('0x19')](_0x277cbd);}};}function respondWithFilteredResult(_0x2d8e97,_0x55a500){return function(_0x8de859){if(_0x8de859){var _0x66797=typeof _0x55a500[_0x6efc('0x1a')]===_0x6efc('0x1b')&&typeof _0x55a500['limit']===_0x6efc('0x1b');var _0x13f534=_0x8de859['count'];var _0x57e14e=_0x66797?0x0:_0x55a500[_0x6efc('0x1a')];var _0x5e009e=_0x66797?_0x8de859[_0x6efc('0x1c')]:_0x55a500['offset']+_0x55a500[_0x6efc('0x1d')];var _0x3f0d7c;if(_0x5e009e>=_0x13f534){_0x5e009e=_0x13f534;_0x3f0d7c=0xc8;}else{_0x3f0d7c=0xce;}_0x2d8e97['status'](_0x3f0d7c);return _0x2d8e97['set'](_0x6efc('0x1e'),_0x57e14e+'-'+_0x5e009e+'/'+_0x13f534)['json'](_0x8de859);}return null;};}function patchUpdates(_0x2e52e4){return function(_0x4ad1c1){try{jsonpatch[_0x6efc('0x1f')](_0x4ad1c1,_0x2e52e4,!![]);}catch(_0x4f0d01){return BPromise[_0x6efc('0x20')](_0x4f0d01);}return _0x4ad1c1[_0x6efc('0x21')]();};}function saveUpdates(_0x2e2084,_0x20daa2){return function(_0x4d8aa0){if(_0x4d8aa0){return _0x4d8aa0[_0x6efc('0x22')](_0x2e2084)[_0x6efc('0x23')](function(_0x2f69eb){return _0x2f69eb;});}return null;};}function removeEntity(_0x23c8b6,_0x28b45f){return function(_0xd2ae4f){if(_0xd2ae4f){return _0xd2ae4f['destroy']()[_0x6efc('0x23')](function(){var _0x4f8128=_0xd2ae4f['get']({'plain':!![]});var _0x37986d=_0x6efc('0x24');return db['UserProfileResource'][_0x6efc('0x25')]({'where':{'type':_0x37986d,'resourceId':_0x4f8128['id']}})[_0x6efc('0x23')](function(){return _0xd2ae4f;});})[_0x6efc('0x23')](function(){_0x23c8b6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44758a,_0xb5213f){return function(_0x27b3d6){if(!_0x27b3d6){_0x44758a[_0x6efc('0x26')](0x194);}return _0x27b3d6;};}function handleError(_0x595435,_0x5dba50){_0x5dba50=_0x5dba50||0x1f4;return function(_0x1c6f9e){logger[_0x6efc('0x27')](_0x1c6f9e['stack']);if(_0x1c6f9e['name']){delete _0x1c6f9e[_0x6efc('0x28')];}_0x595435[_0x6efc('0x17')](_0x5dba50)[_0x6efc('0x29')](_0x1c6f9e);};}exports['index']=function(_0x4e71a9,_0x3e1d4f){var _0x2c74f6={},_0x1ca04c={},_0x3667c1={'count':0x0,'rows':[]};var _0x57817a=_[_0x6efc('0x2a')](db[_0x6efc('0x2b')]['rawAttributes'],function(_0x1d3804){return{'name':_0x1d3804[_0x6efc('0x2c')],'type':_0x1d3804['type'][_0x6efc('0x2d')]};});_0x1ca04c[_0x6efc('0x2e')]=_[_0x6efc('0x2a')](_0x57817a,_0x6efc('0x28'));_0x1ca04c[_0x6efc('0x2f')]=_['keys'](_0x4e71a9[_0x6efc('0x2f')]);_0x1ca04c[_0x6efc('0x30')]=_['intersection'](_0x1ca04c[_0x6efc('0x2e')],_0x1ca04c['query']);_0x2c74f6['attributes']=_[_0x6efc('0x31')](_0x1ca04c[_0x6efc('0x2e')],qs[_0x6efc('0x32')](_0x4e71a9[_0x6efc('0x2f')][_0x6efc('0x32')]));_0x2c74f6[_0x6efc('0x33')]=_0x2c74f6['attributes']['length']?_0x2c74f6['attributes']:_0x1ca04c[_0x6efc('0x2e')];if(!_0x4e71a9[_0x6efc('0x2f')][_0x6efc('0x34')](_0x6efc('0x35'))){_0x2c74f6[_0x6efc('0x1d')]=qs[_0x6efc('0x1d')](_0x4e71a9['query'][_0x6efc('0x1d')]);_0x2c74f6[_0x6efc('0x1a')]=qs[_0x6efc('0x1a')](_0x4e71a9[_0x6efc('0x2f')]['offset']);}_0x2c74f6[_0x6efc('0x36')]=qs[_0x6efc('0x37')](_0x4e71a9[_0x6efc('0x2f')][_0x6efc('0x37')]);_0x2c74f6[_0x6efc('0x38')]=qs['filters'](_['pick'](_0x4e71a9[_0x6efc('0x2f')],_0x1ca04c[_0x6efc('0x30')]),_0x57817a);if(_0x4e71a9['query'][_0x6efc('0x39')]){_0x2c74f6['where']=_['merge'](_0x2c74f6['where'],{'$or':_[_0x6efc('0x2a')](_0x57817a,function(_0x16ff42){if(_0x16ff42['type']!==_0x6efc('0x3a')){var _0x85f7b3={};_0x85f7b3[_0x16ff42['name']]={'$like':'%'+_0x4e71a9[_0x6efc('0x2f')]['filter']+'%'};return _0x85f7b3;}})});}_0x2c74f6=_['merge']({},_0x2c74f6,_0x4e71a9[_0x6efc('0x3b')]);var _0x5266fc={'where':_0x2c74f6['where']};return db[_0x6efc('0x2b')]['count'](_0x5266fc)[_0x6efc('0x23')](function(_0x142b28){_0x3667c1[_0x6efc('0x1c')]=_0x142b28;if(_0x4e71a9[_0x6efc('0x2f')][_0x6efc('0x3c')]){_0x2c74f6['include']=[{'all':!![]}];}return db[_0x6efc('0x2b')]['findAll'](_0x2c74f6);})[_0x6efc('0x23')](function(_0x45395a){_0x3667c1[_0x6efc('0x3d')]=_0x45395a;return _0x3667c1;})[_0x6efc('0x23')](respondWithFilteredResult(_0x3e1d4f,_0x2c74f6))['catch'](handleError(_0x3e1d4f,null));};exports['show']=function(_0x43355c,_0x2f5956){var _0x547c23={'raw':!![],'where':{'id':_0x43355c[_0x6efc('0x3e')]['id']}},_0xc61d6f={};_0xc61d6f[_0x6efc('0x2e')]=_[_0x6efc('0x3f')](db[_0x6efc('0x2b')][_0x6efc('0x40')]);_0xc61d6f[_0x6efc('0x2f')]=_['keys'](_0x43355c[_0x6efc('0x2f')]);_0xc61d6f[_0x6efc('0x30')]=_[_0x6efc('0x31')](_0xc61d6f[_0x6efc('0x2e')],_0xc61d6f[_0x6efc('0x2f')]);_0x547c23['attributes']=_[_0x6efc('0x31')](_0xc61d6f[_0x6efc('0x2e')],qs['fields'](_0x43355c['query']['fields']));_0x547c23[_0x6efc('0x33')]=_0x547c23[_0x6efc('0x33')][_0x6efc('0x41')]?_0x547c23[_0x6efc('0x33')]:_0xc61d6f[_0x6efc('0x2e')];if(_0x43355c[_0x6efc('0x2f')][_0x6efc('0x3c')]){_0x547c23[_0x6efc('0x42')]=[{'all':!![]}];}_0x547c23=_[_0x6efc('0x43')]({},_0x547c23,_0x43355c[_0x6efc('0x3b')]);return db[_0x6efc('0x2b')]['find'](_0x547c23)['then'](handleEntityNotFound(_0x2f5956,null))[_0x6efc('0x23')](respondWithResult(_0x2f5956,null))[_0x6efc('0x44')](handleError(_0x2f5956,null));};exports[_0x6efc('0x45')]=function(_0x590884,_0x1561d0){return db['Pause'][_0x6efc('0x45')](_0x590884[_0x6efc('0x46')],{})[_0x6efc('0x23')](function(_0x520ad9){var _0x4119ae=_0x590884[_0x6efc('0x47')][_0x6efc('0x48')]({'plain':!![]});if(!_0x4119ae)throw new Error(_0x6efc('0x49'));if(_0x4119ae[_0x6efc('0x4a')]===_0x6efc('0x47')){var _0x576ac7=_0x520ad9[_0x6efc('0x48')]({'plain':!![]});var _0x57faaf='Pauses';return db['UserProfileSection'][_0x6efc('0x4b')]({'where':{'name':_0x57faaf,'userProfileId':_0x4119ae[_0x6efc('0x4c')]},'raw':!![]})['then'](function(_0xe39c15){if(_0xe39c15&&_0xe39c15[_0x6efc('0x4d')]===0x0){return db[_0x6efc('0x4e')]['create']({'name':_0x576ac7[_0x6efc('0x28')],'resourceId':_0x576ac7['id'],'type':_0xe39c15[_0x6efc('0x28')],'sectionId':_0xe39c15['id']},{})[_0x6efc('0x23')](function(){return _0x520ad9;});}else{return _0x520ad9;}})['catch'](function(_0x335aec){logger['error'](_0x6efc('0x4f'),_0x335aec);throw _0x335aec;});}return _0x520ad9;})[_0x6efc('0x23')](respondWithResult(_0x1561d0,0xc9))[_0x6efc('0x44')](handleError(_0x1561d0,null));};exports[_0x6efc('0x22')]=function(_0x5b7f7f,_0x37ee53){if(_0x5b7f7f[_0x6efc('0x46')]['id']){delete _0x5b7f7f[_0x6efc('0x46')]['id'];}return db[_0x6efc('0x2b')]['find']({'where':{'id':_0x5b7f7f[_0x6efc('0x3e')]['id']}})['then'](handleEntityNotFound(_0x37ee53,null))[_0x6efc('0x23')](saveUpdates(_0x5b7f7f[_0x6efc('0x46')],null))[_0x6efc('0x23')](respondWithResult(_0x37ee53,null))[_0x6efc('0x44')](handleError(_0x37ee53,null));};exports['destroy']=function(_0x28890b,_0x13367d){return db[_0x6efc('0x2b')][_0x6efc('0x4b')]({'where':{'id':_0x28890b['params']['id']}})['then'](handleEntityNotFound(_0x13367d,null))[_0x6efc('0x23')](removeEntity(_0x13367d,null))[_0x6efc('0x44')](handleError(_0x13367d,null));};
\ No newline at end of file