Built motion from commit da617fac.|2.6.6
[motion2.git] / server / api / pause / pause.controller.js
index 7804edc..f76693a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6578=['../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Pauses','UserProfileResource','error','name','send','index','Pause','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','offset','order','sort','where','pick','filter','merge','map','type','options','includeAll','include','findAll','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6578,0xdc));var _0x8657=function(_0x1015a3,_0x14141c){_0x1015a3=_0x1015a3-0x0;var _0x18aa0c=_0x6578[_0x1015a3];return _0x18aa0c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8657('0x0'));var rimraf=require(_0x8657('0x1'));var zipdir=require(_0x8657('0x2'));var jsonpatch=require(_0x8657('0x3'));var rp=require(_0x8657('0x4'));var moment=require(_0x8657('0x5'));var BPromise=require(_0x8657('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8657('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8657('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x8657('0x9'));var toCsv=require(_0x8657('0xa'));var querystring=require(_0x8657('0xb'));var Papa=require(_0x8657('0xc'));var Redis=require(_0x8657('0xd'));var authService=require(_0x8657('0xe'));var qs=require(_0x8657('0xf'));var as=require(_0x8657('0x10'));var hardwareService=require(_0x8657('0x11'));var logger=require(_0x8657('0x12'))(_0x8657('0x13'));var utils=require('../../config/utils');var config=require(_0x8657('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27f70c,_0x32a9d5){_0x32a9d5=_0x32a9d5||0xcc;return function(_0xaf9244){if(_0xaf9244){return _0x27f70c[_0x8657('0x15')](_0x32a9d5);}return _0x27f70c[_0x8657('0x16')](_0x32a9d5)[_0x8657('0x17')]();};}function respondWithResult(_0x1b67be,_0x53f810){_0x53f810=_0x53f810||0xc8;return function(_0x1eea79){if(_0x1eea79){return _0x1b67be[_0x8657('0x16')](_0x53f810)[_0x8657('0x18')](_0x1eea79);}};}function respondWithFilteredResult(_0x28c5ac,_0x238386){return function(_0x17bb78){if(_0x17bb78){var _0x193392=_0x17bb78[_0x8657('0x19')],_0x2a9f04=_0x238386['offset'],_0x4e1b9a=_0x238386['offset']+_0x238386[_0x8657('0x1a')],_0x2de68a;if(_0x4e1b9a>=_0x193392){_0x4e1b9a=_0x193392;_0x2de68a=0xc8;}else{_0x2de68a=0xce;}_0x28c5ac[_0x8657('0x16')](_0x2de68a);return _0x28c5ac[_0x8657('0x1b')](_0x8657('0x1c'),_0x2a9f04+'-'+_0x4e1b9a+'/'+_0x193392)[_0x8657('0x18')](_0x17bb78);}return null;};}function patchUpdates(_0x54020d){return function(_0x5b5d81){try{jsonpatch[_0x8657('0x1d')](_0x5b5d81,_0x54020d,!![]);}catch(_0x468953){return BPromise[_0x8657('0x1e')](_0x468953);}return _0x5b5d81[_0x8657('0x1f')]();};}function saveUpdates(_0x3161b5,_0x127714){return function(_0x30e07b){if(_0x30e07b){return _0x30e07b[_0x8657('0x20')](_0x3161b5)[_0x8657('0x21')](function(_0x177357){return _0x177357;});}return null;};}function removeEntity(_0x440233,_0xa7291e){return function(_0x10d934){if(_0x10d934){return _0x10d934[_0x8657('0x22')]()[_0x8657('0x21')](function(){var _0x5c0fc1=_0x10d934[_0x8657('0x23')]({'plain':!![]});var _0x5ef271=_0x8657('0x24');return db[_0x8657('0x25')]['destroy']({'where':{'type':_0x5ef271,'resourceId':_0x5c0fc1['id']}})[_0x8657('0x21')](function(){return _0x10d934;});})['then'](function(){_0x440233['status'](0xcc)[_0x8657('0x17')]();});}};}function handleEntityNotFound(_0x222e52,_0x566269){return function(_0x1e229b){if(!_0x1e229b){_0x222e52[_0x8657('0x15')](0x194);}return _0x1e229b;};}function handleError(_0x30dacb,_0xa481c5){_0xa481c5=_0xa481c5||0x1f4;return function(_0xcab6e8){logger[_0x8657('0x26')](_0xcab6e8['stack']);if(_0xcab6e8[_0x8657('0x27')]){delete _0xcab6e8[_0x8657('0x27')];}_0x30dacb[_0x8657('0x16')](_0xa481c5)[_0x8657('0x28')](_0xcab6e8);};}exports[_0x8657('0x29')]=function(_0x2f66f8,_0x20cb01){var _0x208fda={},_0x2206d2={},_0x43f9fb={'count':0x0,'rows':[]};var _0x5d5a47=_['map'](db[_0x8657('0x2a')][_0x8657('0x2b')],function(_0x450bdf){return{'name':_0x450bdf['fieldName'],'type':_0x450bdf['type'][_0x8657('0x2c')]};});_0x2206d2[_0x8657('0x2d')]=_['map'](_0x5d5a47,_0x8657('0x27'));_0x2206d2[_0x8657('0x2e')]=_[_0x8657('0x2f')](_0x2f66f8[_0x8657('0x2e')]);_0x2206d2[_0x8657('0x30')]=_['intersection'](_0x2206d2[_0x8657('0x2d')],_0x2206d2[_0x8657('0x2e')]);_0x208fda[_0x8657('0x31')]=_[_0x8657('0x32')](_0x2206d2[_0x8657('0x2d')],qs['fields'](_0x2f66f8[_0x8657('0x2e')][_0x8657('0x33')]));_0x208fda['attributes']=_0x208fda[_0x8657('0x31')][_0x8657('0x34')]?_0x208fda[_0x8657('0x31')]:_0x2206d2['model'];if(!_0x2f66f8['query']['hasOwnProperty'](_0x8657('0x35'))){_0x208fda[_0x8657('0x1a')]=qs[_0x8657('0x1a')](_0x2f66f8[_0x8657('0x2e')][_0x8657('0x1a')]);_0x208fda['offset']=qs['offset'](_0x2f66f8['query'][_0x8657('0x36')]);}_0x208fda[_0x8657('0x37')]=qs[_0x8657('0x38')](_0x2f66f8['query'][_0x8657('0x38')]);_0x208fda[_0x8657('0x39')]=qs['filters'](_[_0x8657('0x3a')](_0x2f66f8[_0x8657('0x2e')],_0x2206d2[_0x8657('0x30')]));if(_0x2f66f8[_0x8657('0x2e')][_0x8657('0x3b')]){_0x208fda[_0x8657('0x39')]=_[_0x8657('0x3c')](_0x208fda[_0x8657('0x39')],{'$or':_[_0x8657('0x3d')](_0x5d5a47,function(_0xc436f){if(_0xc436f[_0x8657('0x3e')]!=='VIRTUAL'){var _0x3b2cd1={};_0x3b2cd1[_0xc436f['name']]={'$like':'%'+_0x2f66f8['query'][_0x8657('0x3b')]+'%'};return _0x3b2cd1;}})});}_0x208fda=_['merge']({},_0x208fda,_0x2f66f8[_0x8657('0x3f')]);var _0xa6887a={'where':_0x208fda[_0x8657('0x39')]};return db[_0x8657('0x2a')]['count'](_0xa6887a)['then'](function(_0x5de135){_0x43f9fb[_0x8657('0x19')]=_0x5de135;if(_0x2f66f8[_0x8657('0x2e')][_0x8657('0x40')]){_0x208fda[_0x8657('0x41')]=[{'all':!![]}];}return db[_0x8657('0x2a')][_0x8657('0x42')](_0x208fda);})['then'](function(_0xb20c0d){_0x43f9fb['rows']=_0xb20c0d;return _0x43f9fb;})[_0x8657('0x21')](respondWithFilteredResult(_0x20cb01,_0x208fda))[_0x8657('0x43')](handleError(_0x20cb01,null));};exports['show']=function(_0x1fa45e,_0x3031ef){var _0x67043f={'raw':!![],'where':{'id':_0x1fa45e[_0x8657('0x44')]['id']}},_0x4ba2d4={};_0x4ba2d4['model']=_[_0x8657('0x2f')](db[_0x8657('0x2a')][_0x8657('0x2b')]);_0x4ba2d4[_0x8657('0x2e')]=_['keys'](_0x1fa45e[_0x8657('0x2e')]);_0x4ba2d4[_0x8657('0x30')]=_['intersection'](_0x4ba2d4[_0x8657('0x2d')],_0x4ba2d4['query']);_0x67043f[_0x8657('0x31')]=_[_0x8657('0x32')](_0x4ba2d4[_0x8657('0x2d')],qs[_0x8657('0x33')](_0x1fa45e[_0x8657('0x2e')][_0x8657('0x33')]));_0x67043f[_0x8657('0x31')]=_0x67043f['attributes'][_0x8657('0x34')]?_0x67043f['attributes']:_0x4ba2d4[_0x8657('0x2d')];if(_0x1fa45e['query'][_0x8657('0x40')]){_0x67043f[_0x8657('0x41')]=[{'all':!![]}];}_0x67043f=_[_0x8657('0x3c')]({},_0x67043f,_0x1fa45e[_0x8657('0x3f')]);return db['Pause'][_0x8657('0x45')](_0x67043f)[_0x8657('0x21')](handleEntityNotFound(_0x3031ef,null))[_0x8657('0x21')](respondWithResult(_0x3031ef,null))[_0x8657('0x43')](handleError(_0x3031ef,null));};exports[_0x8657('0x46')]=function(_0x5807ac,_0xa7e53b){return db[_0x8657('0x2a')]['create'](_0x5807ac[_0x8657('0x47')],{})[_0x8657('0x21')](function(_0x2dac8c){var _0x282edc=_0x5807ac['user'][_0x8657('0x23')]({'plain':!![]});if(!_0x282edc)throw new Error(_0x8657('0x48'));if(_0x282edc[_0x8657('0x49')]===_0x8657('0x4a')){var _0x469f79=_0x2dac8c[_0x8657('0x23')]({'plain':!![]});var _0x3254ea=_0x8657('0x24');return db[_0x8657('0x4b')][_0x8657('0x45')]({'where':{'name':_0x3254ea,'userProfileId':_0x282edc[_0x8657('0x4c')]},'raw':!![]})[_0x8657('0x21')](function(_0x8bb3bc){if(_0x8bb3bc&&_0x8bb3bc[_0x8657('0x4d')]===0x0){return db[_0x8657('0x25')][_0x8657('0x46')]({'name':_0x469f79[_0x8657('0x27')],'resourceId':_0x469f79['id'],'type':_0x8bb3bc[_0x8657('0x27')],'sectionId':_0x8bb3bc['id']},{})[_0x8657('0x21')](function(){return _0x2dac8c;});}else{return _0x2dac8c;}})['catch'](function(_0x25bac0){logger[_0x8657('0x26')](_0x8657('0x4e'),_0x25bac0);throw _0x25bac0;});}return _0x2dac8c;})[_0x8657('0x21')](respondWithResult(_0xa7e53b,0xc9))[_0x8657('0x43')](handleError(_0xa7e53b,null));};exports[_0x8657('0x20')]=function(_0x127cf7,_0x181987){if(_0x127cf7['body']['id']){delete _0x127cf7[_0x8657('0x47')]['id'];}return db[_0x8657('0x2a')]['find']({'where':{'id':_0x127cf7['params']['id']}})['then'](handleEntityNotFound(_0x181987,null))[_0x8657('0x21')](saveUpdates(_0x127cf7[_0x8657('0x47')],null))[_0x8657('0x21')](respondWithResult(_0x181987,null))[_0x8657('0x43')](handleError(_0x181987,null));};exports['destroy']=function(_0x2c9c60,_0x17dfed){return db['Pause'][_0x8657('0x45')]({'where':{'id':_0x2c9c60[_0x8657('0x44')]['id']}})[_0x8657('0x21')](handleEntityNotFound(_0x17dfed,null))[_0x8657('0x21')](removeEntity(_0x17dfed,null))[_0x8657('0x43')](handleError(_0x17dfed,null));};
\ No newline at end of file
+var _0x30d1=['then','get','Pauses','UserProfileResource','destroy','error','stack','name','send','index','map','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','Pause','includeAll','findAll','rows','catch','show','params','rawAttributes','keys','find','create','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save'];(function(_0x5ed46a,_0x1ed3bd){var _0x2eebd3=function(_0x4d3073){while(--_0x4d3073){_0x5ed46a['push'](_0x5ed46a['shift']());}};_0x2eebd3(++_0x1ed3bd);}(_0x30d1,0xc0));var _0x130d=function(_0x6ca7f4,_0x51a5df){_0x6ca7f4=_0x6ca7f4-0x0;var _0x494fa6=_0x30d1[_0x6ca7f4];return _0x494fa6;};'use strict';var emlformat=require(_0x130d('0x0'));var rimraf=require(_0x130d('0x1'));var zipdir=require(_0x130d('0x2'));var jsonpatch=require(_0x130d('0x3'));var rp=require(_0x130d('0x4'));var moment=require('moment');var BPromise=require(_0x130d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x130d('0x6'));var csv=require(_0x130d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x130d('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x130d('0x9'));var jsforce=require(_0x130d('0xa'));var deskjs=require(_0x130d('0xb'));var toCsv=require(_0x130d('0x7'));var querystring=require('querystring');var Papa=require(_0x130d('0xc'));var Redis=require('ioredis');var authService=require(_0x130d('0xd'));var qs=require(_0x130d('0xe'));var as=require(_0x130d('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x130d('0x10'));var utils=require('../../config/utils');var config=require(_0x130d('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x130d('0x12'))['db'];function respondWithStatusCode(_0x1c75be,_0x3b6538){_0x3b6538=_0x3b6538||0xcc;return function(_0x227a6d){if(_0x227a6d){return _0x1c75be[_0x130d('0x13')](_0x3b6538);}return _0x1c75be[_0x130d('0x14')](_0x3b6538)[_0x130d('0x15')]();};}function respondWithResult(_0x553389,_0x3a6c42){_0x3a6c42=_0x3a6c42||0xc8;return function(_0x93ef84){if(_0x93ef84){return _0x553389['status'](_0x3a6c42)['json'](_0x93ef84);}};}function respondWithFilteredResult(_0x1ebc7b,_0x322c3d){return function(_0x4ac050){if(_0x4ac050){var _0x23894a=typeof _0x322c3d[_0x130d('0x16')]===_0x130d('0x17')&&typeof _0x322c3d[_0x130d('0x18')]===_0x130d('0x17');var _0x12f051=_0x4ac050[_0x130d('0x19')];var _0xe5bcb9=_0x23894a?0x0:_0x322c3d[_0x130d('0x16')];var _0x20ccb7=_0x23894a?_0x4ac050[_0x130d('0x19')]:_0x322c3d['offset']+_0x322c3d[_0x130d('0x18')];var _0x5622e0;if(_0x20ccb7>=_0x12f051){_0x20ccb7=_0x12f051;_0x5622e0=0xc8;}else{_0x5622e0=0xce;}_0x1ebc7b[_0x130d('0x14')](_0x5622e0);return _0x1ebc7b['set'](_0x130d('0x1a'),_0xe5bcb9+'-'+_0x20ccb7+'/'+_0x12f051)['json'](_0x4ac050);}return null;};}function patchUpdates(_0x2d3eaa){return function(_0x192acb){try{jsonpatch[_0x130d('0x1b')](_0x192acb,_0x2d3eaa,!![]);}catch(_0xd1a560){return BPromise[_0x130d('0x1c')](_0xd1a560);}return _0x192acb[_0x130d('0x1d')]();};}function saveUpdates(_0x13c746,_0x1a2ed3){return function(_0x2dd12c){if(_0x2dd12c){return _0x2dd12c['update'](_0x13c746)['then'](function(_0x477a85){return _0x477a85;});}return null;};}function removeEntity(_0x51401e,_0x494271){return function(_0x2b6f39){if(_0x2b6f39){return _0x2b6f39['destroy']()[_0x130d('0x1e')](function(){var _0x5b94af=_0x2b6f39[_0x130d('0x1f')]({'plain':!![]});var _0x2ddef9=_0x130d('0x20');return db[_0x130d('0x21')][_0x130d('0x22')]({'where':{'type':_0x2ddef9,'resourceId':_0x5b94af['id']}})['then'](function(){return _0x2b6f39;});})[_0x130d('0x1e')](function(){_0x51401e[_0x130d('0x14')](0xcc)[_0x130d('0x15')]();});}};}function handleEntityNotFound(_0x16c94a,_0xe2bffb){return function(_0x4d1116){if(!_0x4d1116){_0x16c94a[_0x130d('0x13')](0x194);}return _0x4d1116;};}function handleError(_0x38178a,_0x2ab3f2){_0x2ab3f2=_0x2ab3f2||0x1f4;return function(_0x22b51a){logger[_0x130d('0x23')](_0x22b51a[_0x130d('0x24')]);if(_0x22b51a[_0x130d('0x25')]){delete _0x22b51a[_0x130d('0x25')];}_0x38178a[_0x130d('0x14')](_0x2ab3f2)[_0x130d('0x26')](_0x22b51a);};}exports[_0x130d('0x27')]=function(_0x577679,_0x50a714){var _0x3059e5={},_0x2b5cb0={},_0x1d78d4={'count':0x0,'rows':[]};var _0x5e0063=_[_0x130d('0x28')](db['Pause']['rawAttributes'],function(_0x20adf6){return{'name':_0x20adf6['fieldName'],'type':_0x20adf6['type'][_0x130d('0x29')]};});_0x2b5cb0['model']=_[_0x130d('0x28')](_0x5e0063,_0x130d('0x25'));_0x2b5cb0[_0x130d('0x2a')]=_['keys'](_0x577679['query']);_0x2b5cb0[_0x130d('0x2b')]=_[_0x130d('0x2c')](_0x2b5cb0[_0x130d('0x2d')],_0x2b5cb0[_0x130d('0x2a')]);_0x3059e5[_0x130d('0x2e')]=_[_0x130d('0x2c')](_0x2b5cb0[_0x130d('0x2d')],qs[_0x130d('0x2f')](_0x577679[_0x130d('0x2a')]['fields']));_0x3059e5[_0x130d('0x2e')]=_0x3059e5[_0x130d('0x2e')][_0x130d('0x30')]?_0x3059e5['attributes']:_0x2b5cb0[_0x130d('0x2d')];if(!_0x577679['query'][_0x130d('0x31')](_0x130d('0x32'))){_0x3059e5['limit']=qs[_0x130d('0x18')](_0x577679[_0x130d('0x2a')][_0x130d('0x18')]);_0x3059e5[_0x130d('0x16')]=qs[_0x130d('0x16')](_0x577679[_0x130d('0x2a')][_0x130d('0x16')]);}_0x3059e5['order']=qs[_0x130d('0x33')](_0x577679[_0x130d('0x2a')][_0x130d('0x33')]);_0x3059e5[_0x130d('0x34')]=qs[_0x130d('0x2b')](_['pick'](_0x577679['query'],_0x2b5cb0[_0x130d('0x2b')]),_0x5e0063);if(_0x577679[_0x130d('0x2a')][_0x130d('0x35')]){_0x3059e5[_0x130d('0x34')]=_[_0x130d('0x36')](_0x3059e5[_0x130d('0x34')],{'$or':_[_0x130d('0x28')](_0x5e0063,function(_0x1ec819){if(_0x1ec819['type']!==_0x130d('0x37')){var _0x3822d8={};_0x3822d8[_0x1ec819[_0x130d('0x25')]]={'$like':'%'+_0x577679[_0x130d('0x2a')][_0x130d('0x35')]+'%'};return _0x3822d8;}})});}_0x3059e5=_[_0x130d('0x36')]({},_0x3059e5,_0x577679[_0x130d('0x38')]);var _0x3110a0={'where':_0x3059e5[_0x130d('0x34')]};return db[_0x130d('0x39')][_0x130d('0x19')](_0x3110a0)[_0x130d('0x1e')](function(_0x7efbbc){_0x1d78d4[_0x130d('0x19')]=_0x7efbbc;if(_0x577679[_0x130d('0x2a')][_0x130d('0x3a')]){_0x3059e5['include']=[{'all':!![]}];}return db[_0x130d('0x39')][_0x130d('0x3b')](_0x3059e5);})['then'](function(_0x5a197f){_0x1d78d4[_0x130d('0x3c')]=_0x5a197f;return _0x1d78d4;})['then'](respondWithFilteredResult(_0x50a714,_0x3059e5))[_0x130d('0x3d')](handleError(_0x50a714,null));};exports[_0x130d('0x3e')]=function(_0x510ea9,_0x162839){var _0x1f776b={'raw':!![],'where':{'id':_0x510ea9[_0x130d('0x3f')]['id']}},_0x270831={};_0x270831[_0x130d('0x2d')]=_['keys'](db[_0x130d('0x39')][_0x130d('0x40')]);_0x270831[_0x130d('0x2a')]=_[_0x130d('0x41')](_0x510ea9['query']);_0x270831[_0x130d('0x2b')]=_[_0x130d('0x2c')](_0x270831['model'],_0x270831[_0x130d('0x2a')]);_0x1f776b[_0x130d('0x2e')]=_[_0x130d('0x2c')](_0x270831[_0x130d('0x2d')],qs[_0x130d('0x2f')](_0x510ea9[_0x130d('0x2a')][_0x130d('0x2f')]));_0x1f776b[_0x130d('0x2e')]=_0x1f776b['attributes'][_0x130d('0x30')]?_0x1f776b[_0x130d('0x2e')]:_0x270831[_0x130d('0x2d')];if(_0x510ea9[_0x130d('0x2a')][_0x130d('0x3a')]){_0x1f776b['include']=[{'all':!![]}];}_0x1f776b=_['merge']({},_0x1f776b,_0x510ea9[_0x130d('0x38')]);return db[_0x130d('0x39')][_0x130d('0x42')](_0x1f776b)[_0x130d('0x1e')](handleEntityNotFound(_0x162839,null))[_0x130d('0x1e')](respondWithResult(_0x162839,null))[_0x130d('0x3d')](handleError(_0x162839,null));};exports[_0x130d('0x43')]=function(_0x10e7a9,_0x4deb9a){return db[_0x130d('0x39')][_0x130d('0x43')](_0x10e7a9['body'],{})['then'](function(_0x17aad8){var _0x1f1825=_0x10e7a9[_0x130d('0x44')][_0x130d('0x1f')]({'plain':!![]});if(!_0x1f1825)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f1825[_0x130d('0x45')]===_0x130d('0x44')){var _0x351649=_0x17aad8[_0x130d('0x1f')]({'plain':!![]});var _0x5da161='Pauses';return db['UserProfileSection'][_0x130d('0x42')]({'where':{'name':_0x5da161,'userProfileId':_0x1f1825['userProfileId']},'raw':!![]})['then'](function(_0x452a8e){if(_0x452a8e&&_0x452a8e[_0x130d('0x46')]===0x0){return db[_0x130d('0x21')]['create']({'name':_0x351649[_0x130d('0x25')],'resourceId':_0x351649['id'],'type':_0x452a8e['name'],'sectionId':_0x452a8e['id']},{})[_0x130d('0x1e')](function(){return _0x17aad8;});}else{return _0x17aad8;}})['catch'](function(_0x462179){logger[_0x130d('0x23')](_0x130d('0x47'),_0x462179);throw _0x462179;});}return _0x17aad8;})[_0x130d('0x1e')](respondWithResult(_0x4deb9a,0xc9))['catch'](handleError(_0x4deb9a,null));};exports[_0x130d('0x48')]=function(_0x52d0d2,_0x41a183){if(_0x52d0d2[_0x130d('0x49')]['id']){delete _0x52d0d2[_0x130d('0x49')]['id'];}return db['Pause']['find']({'where':{'id':_0x52d0d2['params']['id']}})[_0x130d('0x1e')](handleEntityNotFound(_0x41a183,null))[_0x130d('0x1e')](saveUpdates(_0x52d0d2[_0x130d('0x49')],null))[_0x130d('0x1e')](respondWithResult(_0x41a183,null))[_0x130d('0x3d')](handleError(_0x41a183,null));};exports['destroy']=function(_0x31d978,_0x39f5a9){return db[_0x130d('0x39')][_0x130d('0x42')]({'where':{'id':_0x31d978['params']['id']}})['then'](handleEntityNotFound(_0x39f5a9,null))[_0x130d('0x1e')](removeEntity(_0x39f5a9,null))[_0x130d('0x3d')](handleError(_0x39f5a9,null));};
\ No newline at end of file