Built motion from commit 00bf23f6.|2.6.16
[motion2.git] / server / api / pause / pause.controller.js
index 767ea50..299f236 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc18d=['VIRTUAL','merge','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','eml-format','rimraf','fast-json-patch','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','Pauses','UserProfileResource','destroy','error','stack','name','send','map','Pause','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where'];(function(_0x532575,_0x1c3f7e){var _0x52570b=function(_0x27109a){while(--_0x27109a){_0x532575['push'](_0x532575['shift']());}};_0x52570b(++_0x1c3f7e);}(_0xc18d,0xfb));var _0xdc18=function(_0x512a09,_0x240587){_0x512a09=_0x512a09-0x0;var _0x4d9c60=_0xc18d[_0x512a09];return _0x4d9c60;};'use strict';var emlformat=require(_0xdc18('0x0'));var rimraf=require(_0xdc18('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdc18('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdc18('0x3'));var Mustache=require(_0xdc18('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xdc18('0x5'));var ejs=require(_0xdc18('0x6'));var fs=require('fs');var fs_extra=require(_0xdc18('0x7'));var _=require(_0xdc18('0x8'));var squel=require(_0xdc18('0x9'));var crypto=require('crypto');var jsforce=require(_0xdc18('0xa'));var deskjs=require(_0xdc18('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdc18('0xc'));var Redis=require('ioredis');var authService=require(_0xdc18('0xd'));var qs=require(_0xdc18('0xe'));var as=require(_0xdc18('0xf'));var hardwareService=require(_0xdc18('0x10'));var logger=require(_0xdc18('0x11'))(_0xdc18('0x12'));var utils=require('../../config/utils');var config=require(_0xdc18('0x13'));var licenseUtil=require(_0xdc18('0x14'));var db=require(_0xdc18('0x15'))['db'];function respondWithStatusCode(_0x3b87a2,_0x437822){_0x437822=_0x437822||0xcc;return function(_0x306ec5){if(_0x306ec5){return _0x3b87a2[_0xdc18('0x16')](_0x437822);}return _0x3b87a2[_0xdc18('0x17')](_0x437822)[_0xdc18('0x18')]();};}function respondWithResult(_0x475806,_0x13bafb){_0x13bafb=_0x13bafb||0xc8;return function(_0xced517){if(_0xced517){return _0x475806[_0xdc18('0x17')](_0x13bafb)[_0xdc18('0x19')](_0xced517);}};}function respondWithFilteredResult(_0x5f3aa7,_0x4cae97){return function(_0x173c2d){if(_0x173c2d){var _0x32d94b=typeof _0x4cae97[_0xdc18('0x1a')]===_0xdc18('0x1b')&&typeof _0x4cae97['limit']===_0xdc18('0x1b');var _0x43d991=_0x173c2d[_0xdc18('0x1c')];var _0x183cc=_0x32d94b?0x0:_0x4cae97['offset'];var _0x76ff33=_0x32d94b?_0x173c2d[_0xdc18('0x1c')]:_0x4cae97[_0xdc18('0x1a')]+_0x4cae97[_0xdc18('0x1d')];var _0x1bff9b;if(_0x76ff33>=_0x43d991){_0x76ff33=_0x43d991;_0x1bff9b=0xc8;}else{_0x1bff9b=0xce;}_0x5f3aa7['status'](_0x1bff9b);return _0x5f3aa7[_0xdc18('0x1e')](_0xdc18('0x1f'),_0x183cc+'-'+_0x76ff33+'/'+_0x43d991)['json'](_0x173c2d);}return null;};}function patchUpdates(_0x3388d7){return function(_0x181cbe){try{jsonpatch['apply'](_0x181cbe,_0x3388d7,!![]);}catch(_0x30edbf){return BPromise[_0xdc18('0x20')](_0x30edbf);}return _0x181cbe[_0xdc18('0x21')]();};}function saveUpdates(_0x4a77af,_0x2d94f4){return function(_0x27b5ee){if(_0x27b5ee){return _0x27b5ee[_0xdc18('0x22')](_0x4a77af)[_0xdc18('0x23')](function(_0x4ae68e){return _0x4ae68e;});}return null;};}function removeEntity(_0x2c027b,_0x11ec8c){return function(_0x1f2f25){if(_0x1f2f25){return _0x1f2f25['destroy']()[_0xdc18('0x23')](function(){var _0x50acf9=_0x1f2f25['get']({'plain':!![]});var _0x3435c6=_0xdc18('0x24');return db[_0xdc18('0x25')][_0xdc18('0x26')]({'where':{'type':_0x3435c6,'resourceId':_0x50acf9['id']}})[_0xdc18('0x23')](function(){return _0x1f2f25;});})[_0xdc18('0x23')](function(){_0x2c027b[_0xdc18('0x17')](0xcc)[_0xdc18('0x18')]();});}};}function handleEntityNotFound(_0x3ea409,_0x182807){return function(_0xf57838){if(!_0xf57838){_0x3ea409[_0xdc18('0x16')](0x194);}return _0xf57838;};}function handleError(_0x56371a,_0x51eac9){_0x51eac9=_0x51eac9||0x1f4;return function(_0x24b696){logger[_0xdc18('0x27')](_0x24b696[_0xdc18('0x28')]);if(_0x24b696[_0xdc18('0x29')]){delete _0x24b696[_0xdc18('0x29')];}_0x56371a[_0xdc18('0x17')](_0x51eac9)[_0xdc18('0x2a')](_0x24b696);};}exports['index']=function(_0x152bac,_0x128578){var _0x3077f1={},_0x421bf3={},_0x528784={'count':0x0,'rows':[]};var _0x57f281=_[_0xdc18('0x2b')](db[_0xdc18('0x2c')][_0xdc18('0x2d')],function(_0x137d9c){return{'name':_0x137d9c[_0xdc18('0x2e')],'type':_0x137d9c[_0xdc18('0x2f')][_0xdc18('0x30')]};});_0x421bf3['model']=_['map'](_0x57f281,_0xdc18('0x29'));_0x421bf3[_0xdc18('0x31')]=_[_0xdc18('0x32')](_0x152bac['query']);_0x421bf3[_0xdc18('0x33')]=_[_0xdc18('0x34')](_0x421bf3[_0xdc18('0x35')],_0x421bf3['query']);_0x3077f1[_0xdc18('0x36')]=_[_0xdc18('0x34')](_0x421bf3[_0xdc18('0x35')],qs[_0xdc18('0x37')](_0x152bac[_0xdc18('0x31')]['fields']));_0x3077f1[_0xdc18('0x36')]=_0x3077f1[_0xdc18('0x36')][_0xdc18('0x38')]?_0x3077f1[_0xdc18('0x36')]:_0x421bf3[_0xdc18('0x35')];if(!_0x152bac[_0xdc18('0x31')]['hasOwnProperty'](_0xdc18('0x39'))){_0x3077f1[_0xdc18('0x1d')]=qs[_0xdc18('0x1d')](_0x152bac['query']['limit']);_0x3077f1[_0xdc18('0x1a')]=qs['offset'](_0x152bac['query'][_0xdc18('0x1a')]);}_0x3077f1[_0xdc18('0x3a')]=qs[_0xdc18('0x3b')](_0x152bac['query'][_0xdc18('0x3b')]);_0x3077f1[_0xdc18('0x3c')]=qs[_0xdc18('0x33')](_['pick'](_0x152bac['query'],_0x421bf3['filters']),_0x57f281);if(_0x152bac[_0xdc18('0x31')]['filter']){_0x3077f1[_0xdc18('0x3c')]=_['merge'](_0x3077f1['where'],{'$or':_[_0xdc18('0x2b')](_0x57f281,function(_0x43b9f4){if(_0x43b9f4[_0xdc18('0x2f')]!==_0xdc18('0x3d')){var _0x27cce7={};_0x27cce7[_0x43b9f4['name']]={'$like':'%'+_0x152bac[_0xdc18('0x31')]['filter']+'%'};return _0x27cce7;}})});}_0x3077f1=_[_0xdc18('0x3e')]({},_0x3077f1,_0x152bac['options']);var _0x55f4b1={'where':_0x3077f1['where']};return db[_0xdc18('0x2c')][_0xdc18('0x1c')](_0x55f4b1)[_0xdc18('0x23')](function(_0x34edf6){_0x528784[_0xdc18('0x1c')]=_0x34edf6;if(_0x152bac['query'][_0xdc18('0x3f')]){_0x3077f1[_0xdc18('0x40')]=[{'all':!![]}];}return db[_0xdc18('0x2c')]['findAll'](_0x3077f1);})[_0xdc18('0x23')](function(_0x2ab146){_0x528784[_0xdc18('0x41')]=_0x2ab146;return _0x528784;})[_0xdc18('0x23')](respondWithFilteredResult(_0x128578,_0x3077f1))[_0xdc18('0x42')](handleError(_0x128578,null));};exports[_0xdc18('0x43')]=function(_0x38e572,_0x2b196d){var _0x7dcefe={'raw':!![],'where':{'id':_0x38e572[_0xdc18('0x44')]['id']}},_0x631083={};_0x631083['model']=_[_0xdc18('0x32')](db[_0xdc18('0x2c')][_0xdc18('0x2d')]);_0x631083[_0xdc18('0x31')]=_[_0xdc18('0x32')](_0x38e572['query']);_0x631083['filters']=_[_0xdc18('0x34')](_0x631083[_0xdc18('0x35')],_0x631083[_0xdc18('0x31')]);_0x7dcefe[_0xdc18('0x36')]=_[_0xdc18('0x34')](_0x631083[_0xdc18('0x35')],qs[_0xdc18('0x37')](_0x38e572[_0xdc18('0x31')]['fields']));_0x7dcefe['attributes']=_0x7dcefe[_0xdc18('0x36')][_0xdc18('0x38')]?_0x7dcefe[_0xdc18('0x36')]:_0x631083[_0xdc18('0x35')];if(_0x38e572[_0xdc18('0x31')][_0xdc18('0x3f')]){_0x7dcefe[_0xdc18('0x40')]=[{'all':!![]}];}_0x7dcefe=_[_0xdc18('0x3e')]({},_0x7dcefe,_0x38e572['options']);return db[_0xdc18('0x2c')][_0xdc18('0x45')](_0x7dcefe)['then'](handleEntityNotFound(_0x2b196d,null))[_0xdc18('0x23')](respondWithResult(_0x2b196d,null))[_0xdc18('0x42')](handleError(_0x2b196d,null));};exports['create']=function(_0x452e01,_0x1fc821){return db[_0xdc18('0x2c')][_0xdc18('0x46')](_0x452e01[_0xdc18('0x47')],{})['then'](function(_0x1c0fb0){var _0x29f511=_0x452e01[_0xdc18('0x48')]['get']({'plain':!![]});if(!_0x29f511)throw new Error(_0xdc18('0x49'));if(_0x29f511[_0xdc18('0x4a')]==='user'){var _0x46611e=_0x1c0fb0[_0xdc18('0x4b')]({'plain':!![]});var _0xd5a2d8=_0xdc18('0x24');return db['UserProfileSection'][_0xdc18('0x45')]({'where':{'name':_0xd5a2d8,'userProfileId':_0x29f511[_0xdc18('0x4c')]},'raw':!![]})[_0xdc18('0x23')](function(_0x15aa97){if(_0x15aa97&&_0x15aa97[_0xdc18('0x4d')]===0x0){return db[_0xdc18('0x25')][_0xdc18('0x46')]({'name':_0x46611e[_0xdc18('0x29')],'resourceId':_0x46611e['id'],'type':_0x15aa97[_0xdc18('0x29')],'sectionId':_0x15aa97['id']},{})[_0xdc18('0x23')](function(){return _0x1c0fb0;});}else{return _0x1c0fb0;}})['catch'](function(_0x57c080){logger[_0xdc18('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57c080);throw _0x57c080;});}return _0x1c0fb0;})[_0xdc18('0x23')](respondWithResult(_0x1fc821,0xc9))[_0xdc18('0x42')](handleError(_0x1fc821,null));};exports[_0xdc18('0x22')]=function(_0x2b5ac6,_0x5c7d18){if(_0x2b5ac6[_0xdc18('0x47')]['id']){delete _0x2b5ac6['body']['id'];}return db[_0xdc18('0x2c')][_0xdc18('0x45')]({'where':{'id':_0x2b5ac6[_0xdc18('0x44')]['id']}})[_0xdc18('0x23')](handleEntityNotFound(_0x5c7d18,null))[_0xdc18('0x23')](saveUpdates(_0x2b5ac6[_0xdc18('0x47')],null))['then'](respondWithResult(_0x5c7d18,null))[_0xdc18('0x42')](handleError(_0x5c7d18,null));};exports[_0xdc18('0x26')]=function(_0x381c8d,_0x4d4bb3){return db[_0xdc18('0x2c')][_0xdc18('0x45')]({'where':{'id':_0x381c8d[_0xdc18('0x44')]['id']}})[_0xdc18('0x23')](handleEntityNotFound(_0x4d4bb3,null))[_0xdc18('0x23')](removeEntity(_0x4d4bb3,null))[_0xdc18('0x42')](handleError(_0x4d4bb3,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