Built motion from commit 00bf23f6.|2.6.16
[motion2.git] / server / api / pause / pause.controller.js
index 1fabca1..299f236 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f61=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','get','Pauses','UserProfileResource','sendStatus','error','stack','name','map','Pause','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','order','sort','merge','type','VIRTUAL','filter','options','where','include','findAll','rows','catch','show','keys','length','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x455fe1,_0x5abac5){var _0x5a72ed=function(_0x1e1f71){while(--_0x1e1f71){_0x455fe1['push'](_0x455fe1['shift']());}};_0x5a72ed(++_0x5abac5);}(_0x6f61,0x95));var _0x16f6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6f61[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x16f6('0x0'));var zipdir=require(_0x16f6('0x1'));var jsonpatch=require(_0x16f6('0x2'));var rp=require(_0x16f6('0x3'));var moment=require(_0x16f6('0x4'));var BPromise=require(_0x16f6('0x5'));var Mustache=require(_0x16f6('0x6'));var util=require(_0x16f6('0x7'));var path=require(_0x16f6('0x8'));var sox=require(_0x16f6('0x9'));var csv=require(_0x16f6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x16f6('0xb'));var _=require(_0x16f6('0xc'));var squel=require('squel');var crypto=require(_0x16f6('0xd'));var jsforce=require(_0x16f6('0xe'));var deskjs=require(_0x16f6('0xf'));var toCsv=require(_0x16f6('0xa'));var querystring=require(_0x16f6('0x10'));var Papa=require(_0x16f6('0x11'));var Redis=require(_0x16f6('0x12'));var authService=require(_0x16f6('0x13'));var qs=require(_0x16f6('0x14'));var as=require(_0x16f6('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x16f6('0x16'))(_0x16f6('0x17'));var utils=require(_0x16f6('0x18'));var config=require(_0x16f6('0x19'));var licenseUtil=require(_0x16f6('0x1a'));var db=require(_0x16f6('0x1b'))['db'];function respondWithStatusCode(_0x2fa210,_0x4d89cc){_0x4d89cc=_0x4d89cc||0xcc;return function(_0x7ef0b7){if(_0x7ef0b7){return _0x2fa210['sendStatus'](_0x4d89cc);}return _0x2fa210['status'](_0x4d89cc)[_0x16f6('0x1c')]();};}function respondWithResult(_0x48fcd4,_0x153214){_0x153214=_0x153214||0xc8;return function(_0x18e7eb){if(_0x18e7eb){return _0x48fcd4[_0x16f6('0x1d')](_0x153214)[_0x16f6('0x1e')](_0x18e7eb);}};}function respondWithFilteredResult(_0x11391c,_0x24e69b){return function(_0x2a093b){if(_0x2a093b){var _0xce15e9=typeof _0x24e69b[_0x16f6('0x1f')]==='undefined'&&typeof _0x24e69b['limit']===_0x16f6('0x20');var _0x366285=_0x2a093b[_0x16f6('0x21')];var _0x5e43c2=_0xce15e9?0x0:_0x24e69b['offset'];var _0x4f0dac=_0xce15e9?_0x2a093b[_0x16f6('0x21')]:_0x24e69b['offset']+_0x24e69b[_0x16f6('0x22')];var _0x5e6f43;if(_0x4f0dac>=_0x366285){_0x4f0dac=_0x366285;_0x5e6f43=0xc8;}else{_0x5e6f43=0xce;}_0x11391c[_0x16f6('0x1d')](_0x5e6f43);return _0x11391c['set'](_0x16f6('0x23'),_0x5e43c2+'-'+_0x4f0dac+'/'+_0x366285)[_0x16f6('0x1e')](_0x2a093b);}return null;};}function patchUpdates(_0x220614){return function(_0x251dc6){try{jsonpatch[_0x16f6('0x24')](_0x251dc6,_0x220614,!![]);}catch(_0x3e0001){return BPromise['reject'](_0x3e0001);}return _0x251dc6[_0x16f6('0x25')]();};}function saveUpdates(_0x21730c,_0x234c17){return function(_0x3d50a8){if(_0x3d50a8){return _0x3d50a8[_0x16f6('0x26')](_0x21730c)[_0x16f6('0x27')](function(_0x4e3b9e){return _0x4e3b9e;});}return null;};}function removeEntity(_0xf79044,_0x34d5c0){return function(_0x2db353){if(_0x2db353){return _0x2db353[_0x16f6('0x28')]()[_0x16f6('0x27')](function(){var _0x278fd1=_0x2db353[_0x16f6('0x29')]({'plain':!![]});var _0x4adbd9=_0x16f6('0x2a');return db[_0x16f6('0x2b')]['destroy']({'where':{'type':_0x4adbd9,'resourceId':_0x278fd1['id']}})[_0x16f6('0x27')](function(){return _0x2db353;});})[_0x16f6('0x27')](function(){_0xf79044[_0x16f6('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10e3f9,_0x653e00){return function(_0x4008dd){if(!_0x4008dd){_0x10e3f9[_0x16f6('0x2c')](0x194);}return _0x4008dd;};}function handleError(_0x49055d,_0x3427e6){_0x3427e6=_0x3427e6||0x1f4;return function(_0xe50939){logger[_0x16f6('0x2d')](_0xe50939[_0x16f6('0x2e')]);if(_0xe50939['name']){delete _0xe50939[_0x16f6('0x2f')];}_0x49055d[_0x16f6('0x1d')](_0x3427e6)['send'](_0xe50939);};}exports['index']=function(_0x224ea7,_0x45c717){var _0x23c65d={},_0x265609={},_0x1dbc44={'count':0x0,'rows':[]};var _0x5f19a4=_[_0x16f6('0x30')](db[_0x16f6('0x31')][_0x16f6('0x32')],function(_0x3ad875){return{'name':_0x3ad875[_0x16f6('0x33')],'type':_0x3ad875['type'][_0x16f6('0x34')]};});_0x265609[_0x16f6('0x35')]=_['map'](_0x5f19a4,_0x16f6('0x2f'));_0x265609[_0x16f6('0x36')]=_['keys'](_0x224ea7[_0x16f6('0x36')]);_0x265609[_0x16f6('0x37')]=_['intersection'](_0x265609[_0x16f6('0x35')],_0x265609[_0x16f6('0x36')]);_0x23c65d[_0x16f6('0x38')]=_[_0x16f6('0x39')](_0x265609[_0x16f6('0x35')],qs[_0x16f6('0x3a')](_0x224ea7[_0x16f6('0x36')]['fields']));_0x23c65d[_0x16f6('0x38')]=_0x23c65d[_0x16f6('0x38')]['length']?_0x23c65d[_0x16f6('0x38')]:_0x265609[_0x16f6('0x35')];if(!_0x224ea7['query']['hasOwnProperty']('nolimit')){_0x23c65d[_0x16f6('0x22')]=qs[_0x16f6('0x22')](_0x224ea7['query']['limit']);_0x23c65d[_0x16f6('0x1f')]=qs[_0x16f6('0x1f')](_0x224ea7[_0x16f6('0x36')]['offset']);}_0x23c65d[_0x16f6('0x3b')]=qs[_0x16f6('0x3c')](_0x224ea7['query'][_0x16f6('0x3c')]);_0x23c65d['where']=qs[_0x16f6('0x37')](_['pick'](_0x224ea7[_0x16f6('0x36')],_0x265609['filters']),_0x5f19a4);if(_0x224ea7[_0x16f6('0x36')]['filter']){_0x23c65d['where']=_[_0x16f6('0x3d')](_0x23c65d['where'],{'$or':_[_0x16f6('0x30')](_0x5f19a4,function(_0x43862d){if(_0x43862d[_0x16f6('0x3e')]!==_0x16f6('0x3f')){var _0x3c9eca={};_0x3c9eca[_0x43862d[_0x16f6('0x2f')]]={'$like':'%'+_0x224ea7[_0x16f6('0x36')][_0x16f6('0x40')]+'%'};return _0x3c9eca;}})});}_0x23c65d=_[_0x16f6('0x3d')]({},_0x23c65d,_0x224ea7[_0x16f6('0x41')]);var _0x176d04={'where':_0x23c65d[_0x16f6('0x42')]};return db[_0x16f6('0x31')][_0x16f6('0x21')](_0x176d04)[_0x16f6('0x27')](function(_0x25cc10){_0x1dbc44['count']=_0x25cc10;if(_0x224ea7[_0x16f6('0x36')]['includeAll']){_0x23c65d[_0x16f6('0x43')]=[{'all':!![]}];}return db[_0x16f6('0x31')][_0x16f6('0x44')](_0x23c65d);})[_0x16f6('0x27')](function(_0x496127){_0x1dbc44[_0x16f6('0x45')]=_0x496127;return _0x1dbc44;})[_0x16f6('0x27')](respondWithFilteredResult(_0x45c717,_0x23c65d))[_0x16f6('0x46')](handleError(_0x45c717,null));};exports[_0x16f6('0x47')]=function(_0x482fdc,_0x10abde){var _0x21c7c9={'raw':!![],'where':{'id':_0x482fdc['params']['id']}},_0x2569be={};_0x2569be[_0x16f6('0x35')]=_[_0x16f6('0x48')](db[_0x16f6('0x31')][_0x16f6('0x32')]);_0x2569be[_0x16f6('0x36')]=_[_0x16f6('0x48')](_0x482fdc[_0x16f6('0x36')]);_0x2569be[_0x16f6('0x37')]=_[_0x16f6('0x39')](_0x2569be['model'],_0x2569be[_0x16f6('0x36')]);_0x21c7c9[_0x16f6('0x38')]=_[_0x16f6('0x39')](_0x2569be[_0x16f6('0x35')],qs[_0x16f6('0x3a')](_0x482fdc[_0x16f6('0x36')]['fields']));_0x21c7c9[_0x16f6('0x38')]=_0x21c7c9['attributes'][_0x16f6('0x49')]?_0x21c7c9[_0x16f6('0x38')]:_0x2569be[_0x16f6('0x35')];if(_0x482fdc[_0x16f6('0x36')]['includeAll']){_0x21c7c9[_0x16f6('0x43')]=[{'all':!![]}];}_0x21c7c9=_[_0x16f6('0x3d')]({},_0x21c7c9,_0x482fdc[_0x16f6('0x41')]);return db[_0x16f6('0x31')][_0x16f6('0x4a')](_0x21c7c9)['then'](handleEntityNotFound(_0x10abde,null))['then'](respondWithResult(_0x10abde,null))[_0x16f6('0x46')](handleError(_0x10abde,null));};exports['create']=function(_0x311c75,_0x1bcf0e){return db[_0x16f6('0x31')]['create'](_0x311c75[_0x16f6('0x4b')],{})[_0x16f6('0x27')](function(_0x9c68b6){var _0x27a14e=_0x311c75['user'][_0x16f6('0x29')]({'plain':!![]});if(!_0x27a14e)throw new Error(_0x16f6('0x4c'));if(_0x27a14e[_0x16f6('0x4d')]==='user'){var _0x531472=_0x9c68b6[_0x16f6('0x29')]({'plain':!![]});var _0x26a332=_0x16f6('0x2a');return db[_0x16f6('0x4e')][_0x16f6('0x4a')]({'where':{'name':_0x26a332,'userProfileId':_0x27a14e[_0x16f6('0x4f')]},'raw':!![]})[_0x16f6('0x27')](function(_0x1f7f77){if(_0x1f7f77&&_0x1f7f77[_0x16f6('0x50')]===0x0){return db[_0x16f6('0x2b')]['create']({'name':_0x531472[_0x16f6('0x2f')],'resourceId':_0x531472['id'],'type':_0x1f7f77['name'],'sectionId':_0x1f7f77['id']},{})[_0x16f6('0x27')](function(){return _0x9c68b6;});}else{return _0x9c68b6;}})[_0x16f6('0x46')](function(_0x2d695a){logger[_0x16f6('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d695a);throw _0x2d695a;});}return _0x9c68b6;})['then'](respondWithResult(_0x1bcf0e,0xc9))[_0x16f6('0x46')](handleError(_0x1bcf0e,null));};exports['update']=function(_0x54d27f,_0x549ef8){if(_0x54d27f[_0x16f6('0x4b')]['id']){delete _0x54d27f[_0x16f6('0x4b')]['id'];}return db[_0x16f6('0x31')][_0x16f6('0x4a')]({'where':{'id':_0x54d27f[_0x16f6('0x51')]['id']}})['then'](handleEntityNotFound(_0x549ef8,null))[_0x16f6('0x27')](saveUpdates(_0x54d27f[_0x16f6('0x4b')],null))[_0x16f6('0x27')](respondWithResult(_0x549ef8,null))['catch'](handleError(_0x549ef8,null));};exports[_0x16f6('0x28')]=function(_0x1e9786,_0x4a3624){return db[_0x16f6('0x31')]['find']({'where':{'id':_0x1e9786[_0x16f6('0x51')]['id']}})[_0x16f6('0x27')](handleEntityNotFound(_0x4a3624,null))[_0x16f6('0x27')](removeEntity(_0x4a3624,null))[_0x16f6('0x46')](handleError(_0x4a3624,null));};
\ No newline at end of file
+var _0x95b6=['Pauses','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','merge','VIRTUAL','options','Pause','include','findAll','rows','show','params','includeAll','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','get'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x95b6,0xd2));var _0x695b=function(_0x1642ba,_0x44b1ba){_0x1642ba=_0x1642ba-0x0;var _0x4d39a2=_0x95b6[_0x1642ba];return _0x4d39a2;};'use strict';var emlformat=require(_0x695b('0x0'));var rimraf=require(_0x695b('0x1'));var zipdir=require(_0x695b('0x2'));var jsonpatch=require(_0x695b('0x3'));var rp=require('request-promise');var moment=require(_0x695b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x695b('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x695b('0x6'));var ejs=require(_0x695b('0x7'));var fs=require('fs');var fs_extra=require(_0x695b('0x8'));var _=require('lodash');var squel=require(_0x695b('0x9'));var crypto=require(_0x695b('0xa'));var jsforce=require(_0x695b('0xb'));var deskjs=require(_0x695b('0xc'));var toCsv=require(_0x695b('0x6'));var querystring=require('querystring');var Papa=require(_0x695b('0xd'));var Redis=require(_0x695b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x695b('0xf'));var as=require(_0x695b('0x10'));var hardwareService=require(_0x695b('0x11'));var logger=require(_0x695b('0x12'))(_0x695b('0x13'));var utils=require(_0x695b('0x14'));var config=require(_0x695b('0x15'));var licenseUtil=require(_0x695b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36d628,_0x21bf45){_0x21bf45=_0x21bf45||0xcc;return function(_0xcbcc48){if(_0xcbcc48){return _0x36d628[_0x695b('0x17')](_0x21bf45);}return _0x36d628['status'](_0x21bf45)[_0x695b('0x18')]();};}function respondWithResult(_0xbced9d,_0x3142ee){_0x3142ee=_0x3142ee||0xc8;return function(_0x513c06){if(_0x513c06){return _0xbced9d['status'](_0x3142ee)[_0x695b('0x19')](_0x513c06);}};}function respondWithFilteredResult(_0x2391fa,_0x8c3ff5){return function(_0x310663){if(_0x310663){var _0xf774d2=typeof _0x8c3ff5[_0x695b('0x1a')]===_0x695b('0x1b')&&typeof _0x8c3ff5[_0x695b('0x1c')]===_0x695b('0x1b');var _0x20dd0f=_0x310663[_0x695b('0x1d')];var _0x1ea1e5=_0xf774d2?0x0:_0x8c3ff5[_0x695b('0x1a')];var _0x593867=_0xf774d2?_0x310663[_0x695b('0x1d')]:_0x8c3ff5[_0x695b('0x1a')]+_0x8c3ff5['limit'];var _0x40492e;if(_0x593867>=_0x20dd0f){_0x593867=_0x20dd0f;_0x40492e=0xc8;}else{_0x40492e=0xce;}_0x2391fa[_0x695b('0x1e')](_0x40492e);return _0x2391fa[_0x695b('0x1f')](_0x695b('0x20'),_0x1ea1e5+'-'+_0x593867+'/'+_0x20dd0f)[_0x695b('0x19')](_0x310663);}return null;};}function patchUpdates(_0x2cac36){return function(_0x34ee48){try{jsonpatch[_0x695b('0x21')](_0x34ee48,_0x2cac36,!![]);}catch(_0x5dc3ec){return BPromise[_0x695b('0x22')](_0x5dc3ec);}return _0x34ee48[_0x695b('0x23')]();};}function saveUpdates(_0x591d65,_0x21cfb8){return function(_0x5554be){if(_0x5554be){return _0x5554be['update'](_0x591d65)[_0x695b('0x24')](function(_0x4af77e){return _0x4af77e;});}return null;};}function removeEntity(_0x21f41e,_0x2f6632){return function(_0x5e408f){if(_0x5e408f){return _0x5e408f[_0x695b('0x25')]()['then'](function(){var _0xcee938=_0x5e408f[_0x695b('0x26')]({'plain':!![]});var _0x5f0a2c=_0x695b('0x27');return db[_0x695b('0x28')]['destroy']({'where':{'type':_0x5f0a2c,'resourceId':_0xcee938['id']}})[_0x695b('0x24')](function(){return _0x5e408f;});})[_0x695b('0x24')](function(){_0x21f41e['status'](0xcc)[_0x695b('0x18')]();});}};}function handleEntityNotFound(_0x5bf3bd,_0x42b38e){return function(_0x2cb410){if(!_0x2cb410){_0x5bf3bd[_0x695b('0x17')](0x194);}return _0x2cb410;};}function handleError(_0x4f59ee,_0x628766){_0x628766=_0x628766||0x1f4;return function(_0x1e6a8e){logger['error'](_0x1e6a8e[_0x695b('0x29')]);if(_0x1e6a8e[_0x695b('0x2a')]){delete _0x1e6a8e[_0x695b('0x2a')];}_0x4f59ee[_0x695b('0x1e')](_0x628766)[_0x695b('0x2b')](_0x1e6a8e);};}exports[_0x695b('0x2c')]=function(_0x5350d6,_0x358c91){var _0x237620={},_0xc853a6={},_0x18f9e2={'count':0x0,'rows':[]};var _0x639649=_[_0x695b('0x2d')](db['Pause'][_0x695b('0x2e')],function(_0x5b94df){return{'name':_0x5b94df[_0x695b('0x2f')],'type':_0x5b94df[_0x695b('0x30')][_0x695b('0x31')]};});_0xc853a6[_0x695b('0x32')]=_[_0x695b('0x2d')](_0x639649,'name');_0xc853a6[_0x695b('0x33')]=_[_0x695b('0x34')](_0x5350d6[_0x695b('0x33')]);_0xc853a6[_0x695b('0x35')]=_['intersection'](_0xc853a6['model'],_0xc853a6[_0x695b('0x33')]);_0x237620['attributes']=_[_0x695b('0x36')](_0xc853a6['model'],qs['fields'](_0x5350d6['query'][_0x695b('0x37')]));_0x237620[_0x695b('0x38')]=_0x237620[_0x695b('0x38')][_0x695b('0x39')]?_0x237620[_0x695b('0x38')]:_0xc853a6[_0x695b('0x32')];if(!_0x5350d6[_0x695b('0x33')]['hasOwnProperty']('nolimit')){_0x237620[_0x695b('0x1c')]=qs[_0x695b('0x1c')](_0x5350d6[_0x695b('0x33')][_0x695b('0x1c')]);_0x237620['offset']=qs[_0x695b('0x1a')](_0x5350d6[_0x695b('0x33')][_0x695b('0x1a')]);}_0x237620[_0x695b('0x3a')]=qs[_0x695b('0x3b')](_0x5350d6[_0x695b('0x33')][_0x695b('0x3b')]);_0x237620[_0x695b('0x3c')]=qs['filters'](_[_0x695b('0x3d')](_0x5350d6[_0x695b('0x33')],_0xc853a6[_0x695b('0x35')]),_0x639649);if(_0x5350d6[_0x695b('0x33')]['filter']){_0x237620[_0x695b('0x3c')]=_[_0x695b('0x3e')](_0x237620['where'],{'$or':_[_0x695b('0x2d')](_0x639649,function(_0x382452){if(_0x382452['type']!==_0x695b('0x3f')){var _0x2fe56b={};_0x2fe56b[_0x382452[_0x695b('0x2a')]]={'$like':'%'+_0x5350d6[_0x695b('0x33')]['filter']+'%'};return _0x2fe56b;}})});}_0x237620=_[_0x695b('0x3e')]({},_0x237620,_0x5350d6[_0x695b('0x40')]);var _0x4ec50a={'where':_0x237620['where']};return db[_0x695b('0x41')][_0x695b('0x1d')](_0x4ec50a)[_0x695b('0x24')](function(_0x44a463){_0x18f9e2[_0x695b('0x1d')]=_0x44a463;if(_0x5350d6['query']['includeAll']){_0x237620[_0x695b('0x42')]=[{'all':!![]}];}return db[_0x695b('0x41')][_0x695b('0x43')](_0x237620);})[_0x695b('0x24')](function(_0x3d7b4d){_0x18f9e2[_0x695b('0x44')]=_0x3d7b4d;return _0x18f9e2;})[_0x695b('0x24')](respondWithFilteredResult(_0x358c91,_0x237620))['catch'](handleError(_0x358c91,null));};exports[_0x695b('0x45')]=function(_0x33ce42,_0x182528){var _0x2836c0={'raw':!![],'where':{'id':_0x33ce42[_0x695b('0x46')]['id']}},_0x748bbc={};_0x748bbc['model']=_[_0x695b('0x34')](db['Pause'][_0x695b('0x2e')]);_0x748bbc['query']=_[_0x695b('0x34')](_0x33ce42[_0x695b('0x33')]);_0x748bbc[_0x695b('0x35')]=_[_0x695b('0x36')](_0x748bbc[_0x695b('0x32')],_0x748bbc[_0x695b('0x33')]);_0x2836c0[_0x695b('0x38')]=_[_0x695b('0x36')](_0x748bbc[_0x695b('0x32')],qs[_0x695b('0x37')](_0x33ce42[_0x695b('0x33')][_0x695b('0x37')]));_0x2836c0[_0x695b('0x38')]=_0x2836c0[_0x695b('0x38')]['length']?_0x2836c0[_0x695b('0x38')]:_0x748bbc[_0x695b('0x32')];if(_0x33ce42[_0x695b('0x33')][_0x695b('0x47')]){_0x2836c0['include']=[{'all':!![]}];}_0x2836c0=_['merge']({},_0x2836c0,_0x33ce42[_0x695b('0x40')]);return db[_0x695b('0x41')][_0x695b('0x48')](_0x2836c0)[_0x695b('0x24')](handleEntityNotFound(_0x182528,null))['then'](respondWithResult(_0x182528,null))[_0x695b('0x49')](handleError(_0x182528,null));};exports[_0x695b('0x4a')]=function(_0x3dba35,_0x3da231){return db[_0x695b('0x41')][_0x695b('0x4a')](_0x3dba35['body'],{})['then'](function(_0x225932){var _0xb685df=_0x3dba35['user'][_0x695b('0x26')]({'plain':!![]});if(!_0xb685df)throw new Error(_0x695b('0x4b'));if(_0xb685df[_0x695b('0x4c')]===_0x695b('0x4d')){var _0x1c18cd=_0x225932[_0x695b('0x26')]({'plain':!![]});var _0x13b776='Pauses';return db['UserProfileSection'][_0x695b('0x48')]({'where':{'name':_0x13b776,'userProfileId':_0xb685df[_0x695b('0x4e')]},'raw':!![]})[_0x695b('0x24')](function(_0xbb4875){if(_0xbb4875&&_0xbb4875[_0x695b('0x4f')]===0x0){return db[_0x695b('0x28')][_0x695b('0x4a')]({'name':_0x1c18cd[_0x695b('0x2a')],'resourceId':_0x1c18cd['id'],'type':_0xbb4875[_0x695b('0x2a')],'sectionId':_0xbb4875['id']},{})[_0x695b('0x24')](function(){return _0x225932;});}else{return _0x225932;}})[_0x695b('0x49')](function(_0x338411){logger[_0x695b('0x50')](_0x695b('0x51'),_0x338411);throw _0x338411;});}return _0x225932;})['then'](respondWithResult(_0x3da231,0xc9))[_0x695b('0x49')](handleError(_0x3da231,null));};exports['update']=function(_0x2e89b1,_0x5b7e61){if(_0x2e89b1['body']['id']){delete _0x2e89b1[_0x695b('0x52')]['id'];}return db[_0x695b('0x41')]['find']({'where':{'id':_0x2e89b1[_0x695b('0x46')]['id']}})['then'](handleEntityNotFound(_0x5b7e61,null))[_0x695b('0x24')](saveUpdates(_0x2e89b1[_0x695b('0x52')],null))['then'](respondWithResult(_0x5b7e61,null))[_0x695b('0x49')](handleError(_0x5b7e61,null));};exports[_0x695b('0x25')]=function(_0x27ab89,_0x1d8e66){return db['Pause'][_0x695b('0x48')]({'where':{'id':_0x27ab89['params']['id']}})['then'](handleEntityNotFound(_0x1d8e66,null))['then'](removeEntity(_0x1d8e66,null))[_0x695b('0x49')](handleError(_0x1d8e66,null));};
\ No newline at end of file