Built motion from commit d32f51f5.|2.6.31
[motion2.git] / server / api / pause / pause.controller.js
index e83d796..165ed35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a86=['apply','save','then','destroy','get','UserProfileResource','end','error','stack','name','index','map','Pause','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Pauses','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x513771,_0x20a45){var _0x7458b9=function(_0x253361){while(--_0x253361){_0x513771['push'](_0x513771['shift']());}};_0x7458b9(++_0x20a45);}(_0x3a86,0x11b));var _0x63a8=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0x3a86[_0x420b24];return _0x4da552;};'use strict';var emlformat=require(_0x63a8('0x0'));var rimraf=require(_0x63a8('0x1'));var zipdir=require(_0x63a8('0x2'));var jsonpatch=require(_0x63a8('0x3'));var rp=require(_0x63a8('0x4'));var moment=require(_0x63a8('0x5'));var BPromise=require(_0x63a8('0x6'));var Mustache=require(_0x63a8('0x7'));var util=require(_0x63a8('0x8'));var path=require('path');var sox=require(_0x63a8('0x9'));var csv=require(_0x63a8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x63a8('0xb'));var _=require(_0x63a8('0xc'));var squel=require(_0x63a8('0xd'));var crypto=require(_0x63a8('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x63a8('0xf'));var Redis=require(_0x63a8('0x10'));var authService=require(_0x63a8('0x11'));var qs=require(_0x63a8('0x12'));var as=require(_0x63a8('0x13'));var hardwareService=require(_0x63a8('0x14'));var logger=require(_0x63a8('0x15'))(_0x63a8('0x16'));var utils=require(_0x63a8('0x17'));var config=require(_0x63a8('0x18'));var licenseUtil=require(_0x63a8('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa3ed6,_0x44b813){_0x44b813=_0x44b813||0xcc;return function(_0x24f33a){if(_0x24f33a){return _0xa3ed6[_0x63a8('0x1a')](_0x44b813);}return _0xa3ed6[_0x63a8('0x1b')](_0x44b813)['end']();};}function respondWithResult(_0x257ef3,_0x524653){_0x524653=_0x524653||0xc8;return function(_0x1a2670){if(_0x1a2670){return _0x257ef3[_0x63a8('0x1b')](_0x524653)[_0x63a8('0x1c')](_0x1a2670);}};}function respondWithFilteredResult(_0x235a08,_0x3fd34a){return function(_0x5b034d){if(_0x5b034d){var _0x2caf80=typeof _0x3fd34a[_0x63a8('0x1d')]===_0x63a8('0x1e')&&typeof _0x3fd34a[_0x63a8('0x1f')]===_0x63a8('0x1e');var _0x57e19b=_0x5b034d['count'];var _0xbbf98e=_0x2caf80?0x0:_0x3fd34a['offset'];var _0xc6422c=_0x2caf80?_0x5b034d[_0x63a8('0x20')]:_0x3fd34a[_0x63a8('0x1d')]+_0x3fd34a['limit'];var _0x57b0ff;if(_0xc6422c>=_0x57e19b){_0xc6422c=_0x57e19b;_0x57b0ff=0xc8;}else{_0x57b0ff=0xce;}_0x235a08['status'](_0x57b0ff);return _0x235a08['set']('Content-Range',_0xbbf98e+'-'+_0xc6422c+'/'+_0x57e19b)[_0x63a8('0x1c')](_0x5b034d);}return null;};}function patchUpdates(_0x1e9842){return function(_0x16ad7b){try{jsonpatch[_0x63a8('0x21')](_0x16ad7b,_0x1e9842,!![]);}catch(_0x31313f){return BPromise['reject'](_0x31313f);}return _0x16ad7b[_0x63a8('0x22')]();};}function saveUpdates(_0x21a38c,_0x70b9c5){return function(_0x461989){if(_0x461989){return _0x461989['update'](_0x21a38c)[_0x63a8('0x23')](function(_0x2c92a3){return _0x2c92a3;});}return null;};}function removeEntity(_0x3588ca,_0x207b17){return function(_0x455ef8){if(_0x455ef8){return _0x455ef8[_0x63a8('0x24')]()[_0x63a8('0x23')](function(){var _0x573aac=_0x455ef8[_0x63a8('0x25')]({'plain':!![]});var _0x4ed869='Pauses';return db[_0x63a8('0x26')][_0x63a8('0x24')]({'where':{'type':_0x4ed869,'resourceId':_0x573aac['id']}})[_0x63a8('0x23')](function(){return _0x455ef8;});})[_0x63a8('0x23')](function(){_0x3588ca[_0x63a8('0x1b')](0xcc)[_0x63a8('0x27')]();});}};}function handleEntityNotFound(_0x54b104,_0x5e2856){return function(_0x38a7c6){if(!_0x38a7c6){_0x54b104[_0x63a8('0x1a')](0x194);}return _0x38a7c6;};}function handleError(_0x7ee610,_0x2591b5){_0x2591b5=_0x2591b5||0x1f4;return function(_0x3b3c1c){logger[_0x63a8('0x28')](_0x3b3c1c[_0x63a8('0x29')]);if(_0x3b3c1c[_0x63a8('0x2a')]){delete _0x3b3c1c[_0x63a8('0x2a')];}_0x7ee610[_0x63a8('0x1b')](_0x2591b5)['send'](_0x3b3c1c);};}exports[_0x63a8('0x2b')]=function(_0x106ea8,_0x5525a2){var _0x345bad={},_0x15e769={},_0x3c927e={'count':0x0,'rows':[]};var _0x20a7b4=_[_0x63a8('0x2c')](db[_0x63a8('0x2d')][_0x63a8('0x2e')],function(_0x45548f){return{'name':_0x45548f['fieldName'],'type':_0x45548f[_0x63a8('0x2f')]['key']};});_0x15e769[_0x63a8('0x30')]=_[_0x63a8('0x2c')](_0x20a7b4,_0x63a8('0x2a'));_0x15e769[_0x63a8('0x31')]=_['keys'](_0x106ea8[_0x63a8('0x31')]);_0x15e769[_0x63a8('0x32')]=_[_0x63a8('0x33')](_0x15e769[_0x63a8('0x30')],_0x15e769['query']);_0x345bad[_0x63a8('0x34')]=_['intersection'](_0x15e769[_0x63a8('0x30')],qs['fields'](_0x106ea8[_0x63a8('0x31')][_0x63a8('0x35')]));_0x345bad[_0x63a8('0x34')]=_0x345bad[_0x63a8('0x34')][_0x63a8('0x36')]?_0x345bad[_0x63a8('0x34')]:_0x15e769['model'];if(!_0x106ea8[_0x63a8('0x31')][_0x63a8('0x37')](_0x63a8('0x38'))){_0x345bad[_0x63a8('0x1f')]=qs[_0x63a8('0x1f')](_0x106ea8['query']['limit']);_0x345bad[_0x63a8('0x1d')]=qs[_0x63a8('0x1d')](_0x106ea8[_0x63a8('0x31')]['offset']);}_0x345bad['order']=qs[_0x63a8('0x39')](_0x106ea8[_0x63a8('0x31')][_0x63a8('0x39')]);_0x345bad['where']=qs[_0x63a8('0x32')](_[_0x63a8('0x3a')](_0x106ea8[_0x63a8('0x31')],_0x15e769[_0x63a8('0x32')]),_0x20a7b4);if(_0x106ea8[_0x63a8('0x31')]['filter']){_0x345bad[_0x63a8('0x3b')]=_['merge'](_0x345bad[_0x63a8('0x3b')],{'$or':_[_0x63a8('0x2c')](_0x20a7b4,function(_0x2c3785){if(_0x2c3785['type']!==_0x63a8('0x3c')){var _0x21619e={};_0x21619e[_0x2c3785[_0x63a8('0x2a')]]={'$like':'%'+_0x106ea8[_0x63a8('0x31')][_0x63a8('0x3d')]+'%'};return _0x21619e;}})});}_0x345bad=_[_0x63a8('0x3e')]({},_0x345bad,_0x106ea8[_0x63a8('0x3f')]);var _0x358e37={'where':_0x345bad[_0x63a8('0x3b')]};return db['Pause']['count'](_0x358e37)['then'](function(_0x3ed8ef){_0x3c927e[_0x63a8('0x20')]=_0x3ed8ef;if(_0x106ea8[_0x63a8('0x31')][_0x63a8('0x40')]){_0x345bad[_0x63a8('0x41')]=[{'all':!![]}];}return db[_0x63a8('0x2d')][_0x63a8('0x42')](_0x345bad);})[_0x63a8('0x23')](function(_0x2e2a92){_0x3c927e['rows']=_0x2e2a92;return _0x3c927e;})['then'](respondWithFilteredResult(_0x5525a2,_0x345bad))[_0x63a8('0x43')](handleError(_0x5525a2,null));};exports['show']=function(_0x59b02d,_0x4357c7){var _0x56d396={'raw':!![],'where':{'id':_0x59b02d[_0x63a8('0x44')]['id']}},_0x185bd9={};_0x185bd9[_0x63a8('0x30')]=_['keys'](db[_0x63a8('0x2d')]['rawAttributes']);_0x185bd9[_0x63a8('0x31')]=_[_0x63a8('0x45')](_0x59b02d[_0x63a8('0x31')]);_0x185bd9['filters']=_[_0x63a8('0x33')](_0x185bd9[_0x63a8('0x30')],_0x185bd9[_0x63a8('0x31')]);_0x56d396['attributes']=_[_0x63a8('0x33')](_0x185bd9[_0x63a8('0x30')],qs[_0x63a8('0x35')](_0x59b02d[_0x63a8('0x31')][_0x63a8('0x35')]));_0x56d396[_0x63a8('0x34')]=_0x56d396[_0x63a8('0x34')][_0x63a8('0x36')]?_0x56d396['attributes']:_0x185bd9['model'];if(_0x59b02d['query'][_0x63a8('0x40')]){_0x56d396[_0x63a8('0x41')]=[{'all':!![]}];}_0x56d396=_[_0x63a8('0x3e')]({},_0x56d396,_0x59b02d[_0x63a8('0x3f')]);return db[_0x63a8('0x2d')][_0x63a8('0x46')](_0x56d396)[_0x63a8('0x23')](handleEntityNotFound(_0x4357c7,null))['then'](respondWithResult(_0x4357c7,null))[_0x63a8('0x43')](handleError(_0x4357c7,null));};exports[_0x63a8('0x47')]=function(_0x4ad472,_0x20b76b){return db[_0x63a8('0x2d')]['create'](_0x4ad472[_0x63a8('0x48')],{})[_0x63a8('0x23')](function(_0x4183ce){var _0x58babd=_0x4ad472['user'][_0x63a8('0x25')]({'plain':!![]});if(!_0x58babd)throw new Error(_0x63a8('0x49'));if(_0x58babd['role']===_0x63a8('0x4a')){var _0x1d6ced=_0x4183ce[_0x63a8('0x25')]({'plain':!![]});var _0xd3d605=_0x63a8('0x4b');return db['UserProfileSection']['find']({'where':{'name':_0xd3d605,'userProfileId':_0x58babd['userProfileId']},'raw':!![]})[_0x63a8('0x23')](function(_0x205fd0){if(_0x205fd0&&_0x205fd0[_0x63a8('0x4c')]===0x0){return db['UserProfileResource'][_0x63a8('0x47')]({'name':_0x1d6ced[_0x63a8('0x2a')],'resourceId':_0x1d6ced['id'],'type':_0x205fd0['name'],'sectionId':_0x205fd0['id']},{})[_0x63a8('0x23')](function(){return _0x4183ce;});}else{return _0x4183ce;}})[_0x63a8('0x43')](function(_0x4d481c){logger[_0x63a8('0x28')](_0x63a8('0x4d'),_0x4d481c);throw _0x4d481c;});}return _0x4183ce;})['then'](respondWithResult(_0x20b76b,0xc9))['catch'](handleError(_0x20b76b,null));};exports[_0x63a8('0x4e')]=function(_0x1051b1,_0x24994c){if(_0x1051b1['body']['id']){delete _0x1051b1[_0x63a8('0x48')]['id'];}return db['Pause']['find']({'where':{'id':_0x1051b1[_0x63a8('0x44')]['id']}})[_0x63a8('0x23')](handleEntityNotFound(_0x24994c,null))['then'](saveUpdates(_0x1051b1[_0x63a8('0x48')],null))[_0x63a8('0x23')](respondWithResult(_0x24994c,null))[_0x63a8('0x43')](handleError(_0x24994c,null));};exports[_0x63a8('0x24')]=function(_0x560d79,_0x2919b6){return db[_0x63a8('0x2d')]['find']({'where':{'id':_0x560d79[_0x63a8('0x44')]['id']}})[_0x63a8('0x23')](handleEntityNotFound(_0x2919b6,null))[_0x63a8('0x23')](removeEntity(_0x2919b6,null))['catch'](handleError(_0x2919b6,null));};
\ No newline at end of file
+var _0xfc12=['sox','lodash','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','Pauses','error','stack','name','send','index','map','rawAttributes','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','Pause','findAll','rows','show','params','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0xc7cb54,_0x456334){var _0x1a85f0=function(_0x6904b0){while(--_0x6904b0){_0xc7cb54['push'](_0xc7cb54['shift']());}};_0x1a85f0(++_0x456334);}(_0xfc12,0x9a));var _0x2fc1=function(_0x2948ad,_0x427c8a){_0x2948ad=_0x2948ad-0x0;var _0x37256=_0xfc12[_0x2948ad];return _0x37256;};'use strict';var emlformat=require(_0x2fc1('0x0'));var rimraf=require(_0x2fc1('0x1'));var zipdir=require(_0x2fc1('0x2'));var jsonpatch=require(_0x2fc1('0x3'));var rp=require(_0x2fc1('0x4'));var moment=require(_0x2fc1('0x5'));var BPromise=require(_0x2fc1('0x6'));var Mustache=require(_0x2fc1('0x7'));var util=require(_0x2fc1('0x8'));var path=require(_0x2fc1('0x9'));var sox=require(_0x2fc1('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2fc1('0xb'));var squel=require('squel');var crypto=require(_0x2fc1('0xc'));var jsforce=require(_0x2fc1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2fc1('0xe'));var querystring=require('querystring');var Papa=require(_0x2fc1('0xf'));var Redis=require('ioredis');var authService=require(_0x2fc1('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2fc1('0x11'))(_0x2fc1('0x12'));var utils=require(_0x2fc1('0x13'));var config=require(_0x2fc1('0x14'));var licenseUtil=require(_0x2fc1('0x15'));var db=require(_0x2fc1('0x16'))['db'];function respondWithStatusCode(_0x2ea450,_0x2a20a3){_0x2a20a3=_0x2a20a3||0xcc;return function(_0x37dc40){if(_0x37dc40){return _0x2ea450[_0x2fc1('0x17')](_0x2a20a3);}return _0x2ea450['status'](_0x2a20a3)[_0x2fc1('0x18')]();};}function respondWithResult(_0x28a005,_0x42da0e){_0x42da0e=_0x42da0e||0xc8;return function(_0x5c3867){if(_0x5c3867){return _0x28a005[_0x2fc1('0x19')](_0x42da0e)[_0x2fc1('0x1a')](_0x5c3867);}};}function respondWithFilteredResult(_0x33f1f1,_0x235282){return function(_0x14766a){if(_0x14766a){var _0x49afc9=typeof _0x235282[_0x2fc1('0x1b')]===_0x2fc1('0x1c')&&typeof _0x235282[_0x2fc1('0x1d')]===_0x2fc1('0x1c');var _0x4f3ddf=_0x14766a[_0x2fc1('0x1e')];var _0x4599f9=_0x49afc9?0x0:_0x235282['offset'];var _0x2fa80a=_0x49afc9?_0x14766a['count']:_0x235282['offset']+_0x235282[_0x2fc1('0x1d')];var _0x3d7b92;if(_0x2fa80a>=_0x4f3ddf){_0x2fa80a=_0x4f3ddf;_0x3d7b92=0xc8;}else{_0x3d7b92=0xce;}_0x33f1f1[_0x2fc1('0x19')](_0x3d7b92);return _0x33f1f1[_0x2fc1('0x1f')](_0x2fc1('0x20'),_0x4599f9+'-'+_0x2fa80a+'/'+_0x4f3ddf)['json'](_0x14766a);}return null;};}function patchUpdates(_0x3e5ff0){return function(_0x220e23){try{jsonpatch[_0x2fc1('0x21')](_0x220e23,_0x3e5ff0,!![]);}catch(_0x31d49e){return BPromise[_0x2fc1('0x22')](_0x31d49e);}return _0x220e23[_0x2fc1('0x23')]();};}function saveUpdates(_0x2a3aa4,_0x2e6750){return function(_0x3b1622){if(_0x3b1622){return _0x3b1622[_0x2fc1('0x24')](_0x2a3aa4)['then'](function(_0x2a6460){return _0x2a6460;});}return null;};}function removeEntity(_0x4f8164,_0x1d67cc){return function(_0x1b6635){if(_0x1b6635){return _0x1b6635[_0x2fc1('0x25')]()[_0x2fc1('0x26')](function(){var _0x38ce28=_0x1b6635['get']({'plain':!![]});var _0x41c94a=_0x2fc1('0x27');return db['UserProfileResource'][_0x2fc1('0x25')]({'where':{'type':_0x41c94a,'resourceId':_0x38ce28['id']}})['then'](function(){return _0x1b6635;});})[_0x2fc1('0x26')](function(){_0x4f8164[_0x2fc1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a9327,_0x1d3cee){return function(_0x302abb){if(!_0x302abb){_0x5a9327[_0x2fc1('0x17')](0x194);}return _0x302abb;};}function handleError(_0x46227a,_0x74180f){_0x74180f=_0x74180f||0x1f4;return function(_0x386dfd){logger[_0x2fc1('0x28')](_0x386dfd[_0x2fc1('0x29')]);if(_0x386dfd[_0x2fc1('0x2a')]){delete _0x386dfd[_0x2fc1('0x2a')];}_0x46227a['status'](_0x74180f)[_0x2fc1('0x2b')](_0x386dfd);};}exports[_0x2fc1('0x2c')]=function(_0x2dac9f,_0x575769){var _0x279646={},_0x4b4589={},_0xc094af={'count':0x0,'rows':[]};var _0x3ab004=_[_0x2fc1('0x2d')](db['Pause'][_0x2fc1('0x2e')],function(_0x201bd9){return{'name':_0x201bd9['fieldName'],'type':_0x201bd9['type'][_0x2fc1('0x2f')]};});_0x4b4589[_0x2fc1('0x30')]=_[_0x2fc1('0x2d')](_0x3ab004,_0x2fc1('0x2a'));_0x4b4589['query']=_[_0x2fc1('0x31')](_0x2dac9f[_0x2fc1('0x32')]);_0x4b4589[_0x2fc1('0x33')]=_['intersection'](_0x4b4589[_0x2fc1('0x30')],_0x4b4589[_0x2fc1('0x32')]);_0x279646['attributes']=_[_0x2fc1('0x34')](_0x4b4589[_0x2fc1('0x30')],qs[_0x2fc1('0x35')](_0x2dac9f[_0x2fc1('0x32')][_0x2fc1('0x35')]));_0x279646[_0x2fc1('0x36')]=_0x279646['attributes'][_0x2fc1('0x37')]?_0x279646[_0x2fc1('0x36')]:_0x4b4589['model'];if(!_0x2dac9f[_0x2fc1('0x32')][_0x2fc1('0x38')](_0x2fc1('0x39'))){_0x279646[_0x2fc1('0x1d')]=qs[_0x2fc1('0x1d')](_0x2dac9f[_0x2fc1('0x32')][_0x2fc1('0x1d')]);_0x279646[_0x2fc1('0x1b')]=qs[_0x2fc1('0x1b')](_0x2dac9f[_0x2fc1('0x32')][_0x2fc1('0x1b')]);}_0x279646['order']=qs[_0x2fc1('0x3a')](_0x2dac9f[_0x2fc1('0x32')][_0x2fc1('0x3a')]);_0x279646[_0x2fc1('0x3b')]=qs[_0x2fc1('0x33')](_[_0x2fc1('0x3c')](_0x2dac9f[_0x2fc1('0x32')],_0x4b4589[_0x2fc1('0x33')]),_0x3ab004);if(_0x2dac9f['query']['filter']){_0x279646['where']=_[_0x2fc1('0x3d')](_0x279646[_0x2fc1('0x3b')],{'$or':_['map'](_0x3ab004,function(_0x348ba9){if(_0x348ba9[_0x2fc1('0x3e')]!==_0x2fc1('0x3f')){var _0x3857c4={};_0x3857c4[_0x348ba9[_0x2fc1('0x2a')]]={'$like':'%'+_0x2dac9f[_0x2fc1('0x32')][_0x2fc1('0x40')]+'%'};return _0x3857c4;}})});}_0x279646=_[_0x2fc1('0x3d')]({},_0x279646,_0x2dac9f['options']);var _0x30ff13={'where':_0x279646['where']};return db['Pause'][_0x2fc1('0x1e')](_0x30ff13)['then'](function(_0x4af8f3){_0xc094af[_0x2fc1('0x1e')]=_0x4af8f3;if(_0x2dac9f[_0x2fc1('0x32')][_0x2fc1('0x41')]){_0x279646[_0x2fc1('0x42')]=[{'all':!![]}];}return db[_0x2fc1('0x43')][_0x2fc1('0x44')](_0x279646);})[_0x2fc1('0x26')](function(_0x566e51){_0xc094af[_0x2fc1('0x45')]=_0x566e51;return _0xc094af;})[_0x2fc1('0x26')](respondWithFilteredResult(_0x575769,_0x279646))['catch'](handleError(_0x575769,null));};exports[_0x2fc1('0x46')]=function(_0x3bd8bd,_0x67333e){var _0x1e20c4={'raw':!![],'where':{'id':_0x3bd8bd[_0x2fc1('0x47')]['id']}},_0x3894bb={};_0x3894bb[_0x2fc1('0x30')]=_['keys'](db[_0x2fc1('0x43')][_0x2fc1('0x2e')]);_0x3894bb[_0x2fc1('0x32')]=_[_0x2fc1('0x31')](_0x3bd8bd['query']);_0x3894bb[_0x2fc1('0x33')]=_[_0x2fc1('0x34')](_0x3894bb['model'],_0x3894bb['query']);_0x1e20c4[_0x2fc1('0x36')]=_['intersection'](_0x3894bb[_0x2fc1('0x30')],qs['fields'](_0x3bd8bd['query'][_0x2fc1('0x35')]));_0x1e20c4['attributes']=_0x1e20c4[_0x2fc1('0x36')][_0x2fc1('0x37')]?_0x1e20c4[_0x2fc1('0x36')]:_0x3894bb[_0x2fc1('0x30')];if(_0x3bd8bd[_0x2fc1('0x32')]['includeAll']){_0x1e20c4['include']=[{'all':!![]}];}_0x1e20c4=_[_0x2fc1('0x3d')]({},_0x1e20c4,_0x3bd8bd[_0x2fc1('0x48')]);return db['Pause'][_0x2fc1('0x49')](_0x1e20c4)[_0x2fc1('0x26')](handleEntityNotFound(_0x67333e,null))[_0x2fc1('0x26')](respondWithResult(_0x67333e,null))[_0x2fc1('0x4a')](handleError(_0x67333e,null));};exports[_0x2fc1('0x4b')]=function(_0x3aa655,_0x22e555){return db[_0x2fc1('0x43')][_0x2fc1('0x4b')](_0x3aa655['body'],{})[_0x2fc1('0x26')](function(_0x34d8ef){var _0x5e898e=_0x3aa655[_0x2fc1('0x4c')]['get']({'plain':!![]});if(!_0x5e898e)throw new Error(_0x2fc1('0x4d'));if(_0x5e898e['role']===_0x2fc1('0x4c')){var _0x59cfa0=_0x34d8ef['get']({'plain':!![]});var _0x41ff2a='Pauses';return db[_0x2fc1('0x4e')][_0x2fc1('0x49')]({'where':{'name':_0x41ff2a,'userProfileId':_0x5e898e['userProfileId']},'raw':!![]})[_0x2fc1('0x26')](function(_0x48773d){if(_0x48773d&&_0x48773d[_0x2fc1('0x4f')]===0x0){return db[_0x2fc1('0x50')][_0x2fc1('0x4b')]({'name':_0x59cfa0[_0x2fc1('0x2a')],'resourceId':_0x59cfa0['id'],'type':_0x48773d[_0x2fc1('0x2a')],'sectionId':_0x48773d['id']},{})[_0x2fc1('0x26')](function(){return _0x34d8ef;});}else{return _0x34d8ef;}})[_0x2fc1('0x4a')](function(_0x499f70){logger[_0x2fc1('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x499f70);throw _0x499f70;});}return _0x34d8ef;})[_0x2fc1('0x26')](respondWithResult(_0x22e555,0xc9))[_0x2fc1('0x4a')](handleError(_0x22e555,null));};exports[_0x2fc1('0x24')]=function(_0x1fa0dd,_0x28b766){if(_0x1fa0dd[_0x2fc1('0x51')]['id']){delete _0x1fa0dd[_0x2fc1('0x51')]['id'];}return db[_0x2fc1('0x43')][_0x2fc1('0x49')]({'where':{'id':_0x1fa0dd[_0x2fc1('0x47')]['id']}})[_0x2fc1('0x26')](handleEntityNotFound(_0x28b766,null))[_0x2fc1('0x26')](saveUpdates(_0x1fa0dd[_0x2fc1('0x51')],null))['then'](respondWithResult(_0x28b766,null))[_0x2fc1('0x4a')](handleError(_0x28b766,null));};exports[_0x2fc1('0x25')]=function(_0x5391e3,_0x2a0d21){return db[_0x2fc1('0x43')]['find']({'where':{'id':_0x5391e3[_0x2fc1('0x47')]['id']}})[_0x2fc1('0x26')](handleEntityNotFound(_0x2a0d21,null))[_0x2fc1('0x26')](removeEntity(_0x2a0d21,null))['catch'](handleError(_0x2a0d21,null));};
\ No newline at end of file