Built motion from commit d5e4af8c.|2.6.23
[motion2.git] / server / api / pause / pause.controller.js
index 5061e91..ce92cdb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80f6=['save','update','then','destroy','Pauses','UserProfileResource','end','error','stack','name','send','index','map','Pause','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x80f6,0x89));var _0x680f=function(_0x17c197,_0x3bcb50){_0x17c197=_0x17c197-0x0;var _0x3d4e3f=_0x80f6[_0x17c197];return _0x3d4e3f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x680f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x680f('0x1'));var rp=require(_0x680f('0x2'));var moment=require('moment');var BPromise=require(_0x680f('0x3'));var Mustache=require(_0x680f('0x4'));var util=require(_0x680f('0x5'));var path=require(_0x680f('0x6'));var sox=require(_0x680f('0x7'));var csv=require(_0x680f('0x8'));var ejs=require(_0x680f('0x9'));var fs=require('fs');var fs_extra=require(_0x680f('0xa'));var _=require('lodash');var squel=require(_0x680f('0xb'));var crypto=require(_0x680f('0xc'));var jsforce=require(_0x680f('0xd'));var deskjs=require(_0x680f('0xe'));var toCsv=require(_0x680f('0x8'));var querystring=require(_0x680f('0xf'));var Papa=require(_0x680f('0x10'));var Redis=require(_0x680f('0x11'));var authService=require(_0x680f('0x12'));var qs=require(_0x680f('0x13'));var as=require(_0x680f('0x14'));var hardwareService=require(_0x680f('0x15'));var logger=require(_0x680f('0x16'))(_0x680f('0x17'));var utils=require(_0x680f('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x680f('0x19'));var db=require(_0x680f('0x1a'))['db'];function respondWithStatusCode(_0x9c8189,_0x1b7c8f){_0x1b7c8f=_0x1b7c8f||0xcc;return function(_0x382938){if(_0x382938){return _0x9c8189[_0x680f('0x1b')](_0x1b7c8f);}return _0x9c8189[_0x680f('0x1c')](_0x1b7c8f)['end']();};}function respondWithResult(_0x23f61e,_0x42ec97){_0x42ec97=_0x42ec97||0xc8;return function(_0x2deae9){if(_0x2deae9){return _0x23f61e[_0x680f('0x1c')](_0x42ec97)[_0x680f('0x1d')](_0x2deae9);}};}function respondWithFilteredResult(_0xd6ce26,_0x191a60){return function(_0x24c67b){if(_0x24c67b){var _0x29b58d=typeof _0x191a60[_0x680f('0x1e')]===_0x680f('0x1f')&&typeof _0x191a60[_0x680f('0x20')]===_0x680f('0x1f');var _0x1ecba1=_0x24c67b[_0x680f('0x21')];var _0x2f6561=_0x29b58d?0x0:_0x191a60[_0x680f('0x1e')];var _0x4008d0=_0x29b58d?_0x24c67b['count']:_0x191a60[_0x680f('0x1e')]+_0x191a60['limit'];var _0x2f7f7a;if(_0x4008d0>=_0x1ecba1){_0x4008d0=_0x1ecba1;_0x2f7f7a=0xc8;}else{_0x2f7f7a=0xce;}_0xd6ce26[_0x680f('0x1c')](_0x2f7f7a);return _0xd6ce26['set'](_0x680f('0x22'),_0x2f6561+'-'+_0x4008d0+'/'+_0x1ecba1)['json'](_0x24c67b);}return null;};}function patchUpdates(_0x2fd9cd){return function(_0x38a489){try{jsonpatch[_0x680f('0x23')](_0x38a489,_0x2fd9cd,!![]);}catch(_0x346125){return BPromise[_0x680f('0x24')](_0x346125);}return _0x38a489[_0x680f('0x25')]();};}function saveUpdates(_0x1359d3,_0x3e9be6){return function(_0xcf79e8){if(_0xcf79e8){return _0xcf79e8[_0x680f('0x26')](_0x1359d3)[_0x680f('0x27')](function(_0xe427fc){return _0xe427fc;});}return null;};}function removeEntity(_0x70da7a,_0x2c2f30){return function(_0x2f052d){if(_0x2f052d){return _0x2f052d[_0x680f('0x28')]()['then'](function(){var _0x29982e=_0x2f052d['get']({'plain':!![]});var _0x1601a5=_0x680f('0x29');return db[_0x680f('0x2a')][_0x680f('0x28')]({'where':{'type':_0x1601a5,'resourceId':_0x29982e['id']}})[_0x680f('0x27')](function(){return _0x2f052d;});})[_0x680f('0x27')](function(){_0x70da7a[_0x680f('0x1c')](0xcc)[_0x680f('0x2b')]();});}};}function handleEntityNotFound(_0x3a7ae0,_0x4352cd){return function(_0x40fe31){if(!_0x40fe31){_0x3a7ae0['sendStatus'](0x194);}return _0x40fe31;};}function handleError(_0x5a08ae,_0x8d431a){_0x8d431a=_0x8d431a||0x1f4;return function(_0x4d5f33){logger[_0x680f('0x2c')](_0x4d5f33[_0x680f('0x2d')]);if(_0x4d5f33[_0x680f('0x2e')]){delete _0x4d5f33[_0x680f('0x2e')];}_0x5a08ae[_0x680f('0x1c')](_0x8d431a)[_0x680f('0x2f')](_0x4d5f33);};}exports[_0x680f('0x30')]=function(_0x3adfa1,_0x5ac518){var _0x21bc39={},_0x203a92={},_0x468a46={'count':0x0,'rows':[]};var _0x392260=_[_0x680f('0x31')](db[_0x680f('0x32')]['rawAttributes'],function(_0x48b1d1){return{'name':_0x48b1d1[_0x680f('0x33')],'type':_0x48b1d1['type'][_0x680f('0x34')]};});_0x203a92[_0x680f('0x35')]=_['map'](_0x392260,_0x680f('0x2e'));_0x203a92['query']=_[_0x680f('0x36')](_0x3adfa1[_0x680f('0x37')]);_0x203a92[_0x680f('0x38')]=_['intersection'](_0x203a92['model'],_0x203a92[_0x680f('0x37')]);_0x21bc39['attributes']=_[_0x680f('0x39')](_0x203a92[_0x680f('0x35')],qs[_0x680f('0x3a')](_0x3adfa1[_0x680f('0x37')]['fields']));_0x21bc39[_0x680f('0x3b')]=_0x21bc39[_0x680f('0x3b')][_0x680f('0x3c')]?_0x21bc39[_0x680f('0x3b')]:_0x203a92[_0x680f('0x35')];if(!_0x3adfa1[_0x680f('0x37')]['hasOwnProperty']('nolimit')){_0x21bc39[_0x680f('0x20')]=qs[_0x680f('0x20')](_0x3adfa1['query']['limit']);_0x21bc39[_0x680f('0x1e')]=qs[_0x680f('0x1e')](_0x3adfa1[_0x680f('0x37')][_0x680f('0x1e')]);}_0x21bc39[_0x680f('0x3d')]=qs[_0x680f('0x3e')](_0x3adfa1[_0x680f('0x37')][_0x680f('0x3e')]);_0x21bc39[_0x680f('0x3f')]=qs[_0x680f('0x38')](_[_0x680f('0x40')](_0x3adfa1[_0x680f('0x37')],_0x203a92['filters']),_0x392260);if(_0x3adfa1[_0x680f('0x37')][_0x680f('0x41')]){_0x21bc39[_0x680f('0x3f')]=_[_0x680f('0x42')](_0x21bc39[_0x680f('0x3f')],{'$or':_[_0x680f('0x31')](_0x392260,function(_0x1cc20b){if(_0x1cc20b[_0x680f('0x43')]!==_0x680f('0x44')){var _0x1d8bbc={};_0x1d8bbc[_0x1cc20b[_0x680f('0x2e')]]={'$like':'%'+_0x3adfa1[_0x680f('0x37')]['filter']+'%'};return _0x1d8bbc;}})});}_0x21bc39=_[_0x680f('0x42')]({},_0x21bc39,_0x3adfa1[_0x680f('0x45')]);var _0x4fa699={'where':_0x21bc39[_0x680f('0x3f')]};return db[_0x680f('0x32')][_0x680f('0x21')](_0x4fa699)['then'](function(_0x1e4128){_0x468a46[_0x680f('0x21')]=_0x1e4128;if(_0x3adfa1[_0x680f('0x37')]['includeAll']){_0x21bc39[_0x680f('0x46')]=[{'all':!![]}];}return db[_0x680f('0x32')][_0x680f('0x47')](_0x21bc39);})[_0x680f('0x27')](function(_0x28ebf6){_0x468a46[_0x680f('0x48')]=_0x28ebf6;return _0x468a46;})['then'](respondWithFilteredResult(_0x5ac518,_0x21bc39))[_0x680f('0x49')](handleError(_0x5ac518,null));};exports[_0x680f('0x4a')]=function(_0x27e783,_0x10683c){var _0x2517eb={'raw':!![],'where':{'id':_0x27e783[_0x680f('0x4b')]['id']}},_0x5e1007={};_0x5e1007[_0x680f('0x35')]=_['keys'](db[_0x680f('0x32')][_0x680f('0x4c')]);_0x5e1007[_0x680f('0x37')]=_[_0x680f('0x36')](_0x27e783[_0x680f('0x37')]);_0x5e1007[_0x680f('0x38')]=_[_0x680f('0x39')](_0x5e1007['model'],_0x5e1007[_0x680f('0x37')]);_0x2517eb[_0x680f('0x3b')]=_[_0x680f('0x39')](_0x5e1007[_0x680f('0x35')],qs[_0x680f('0x3a')](_0x27e783[_0x680f('0x37')][_0x680f('0x3a')]));_0x2517eb[_0x680f('0x3b')]=_0x2517eb[_0x680f('0x3b')][_0x680f('0x3c')]?_0x2517eb[_0x680f('0x3b')]:_0x5e1007['model'];if(_0x27e783[_0x680f('0x37')][_0x680f('0x4d')]){_0x2517eb[_0x680f('0x46')]=[{'all':!![]}];}_0x2517eb=_[_0x680f('0x42')]({},_0x2517eb,_0x27e783[_0x680f('0x45')]);return db['Pause']['find'](_0x2517eb)['then'](handleEntityNotFound(_0x10683c,null))['then'](respondWithResult(_0x10683c,null))[_0x680f('0x49')](handleError(_0x10683c,null));};exports[_0x680f('0x4e')]=function(_0x4c44ec,_0x172a86){return db['Pause']['create'](_0x4c44ec[_0x680f('0x4f')],{})[_0x680f('0x27')](function(_0x55bc22){var _0xb5f2e4=_0x4c44ec[_0x680f('0x50')]['get']({'plain':!![]});if(!_0xb5f2e4)throw new Error(_0x680f('0x51'));if(_0xb5f2e4[_0x680f('0x52')]===_0x680f('0x50')){var _0x7f43fb=_0x55bc22['get']({'plain':!![]});var _0x348e1e=_0x680f('0x29');return db[_0x680f('0x53')]['find']({'where':{'name':_0x348e1e,'userProfileId':_0xb5f2e4['userProfileId']},'raw':!![]})[_0x680f('0x27')](function(_0x48f65c){if(_0x48f65c&&_0x48f65c[_0x680f('0x54')]===0x0){return db[_0x680f('0x2a')][_0x680f('0x4e')]({'name':_0x7f43fb[_0x680f('0x2e')],'resourceId':_0x7f43fb['id'],'type':_0x48f65c['name'],'sectionId':_0x48f65c['id']},{})[_0x680f('0x27')](function(){return _0x55bc22;});}else{return _0x55bc22;}})[_0x680f('0x49')](function(_0x5d97ff){logger[_0x680f('0x2c')](_0x680f('0x55'),_0x5d97ff);throw _0x5d97ff;});}return _0x55bc22;})[_0x680f('0x27')](respondWithResult(_0x172a86,0xc9))['catch'](handleError(_0x172a86,null));};exports[_0x680f('0x26')]=function(_0x468d1d,_0x6cf1b6){if(_0x468d1d['body']['id']){delete _0x468d1d[_0x680f('0x4f')]['id'];}return db['Pause']['find']({'where':{'id':_0x468d1d['params']['id']}})[_0x680f('0x27')](handleEntityNotFound(_0x6cf1b6,null))[_0x680f('0x27')](saveUpdates(_0x468d1d[_0x680f('0x4f')],null))['then'](respondWithResult(_0x6cf1b6,null))[_0x680f('0x49')](handleError(_0x6cf1b6,null));};exports[_0x680f('0x28')]=function(_0x1719da,_0x528d16){return db[_0x680f('0x32')][_0x680f('0x56')]({'where':{'id':_0x1719da['params']['id']}})[_0x680f('0x27')](handleEntityNotFound(_0x528d16,null))[_0x680f('0x27')](removeEntity(_0x528d16,null))[_0x680f('0x49')](handleError(_0x528d16,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