Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / api / pause / pause.controller.js
index 86fcab2..e0bc017 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabf6=['VIRTUAL','options','Pause','then','includeAll','include','findAll','rows','catch','params','keys','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','Pauses','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge'];(function(_0x300809,_0x1b16a5){var _0x2ea75e=function(_0x47d968){while(--_0x47d968){_0x300809['push'](_0x300809['shift']());}};_0x2ea75e(++_0x1b16a5);}(_0xabf6,0xba));var _0x6abf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xabf6[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6abf('0x0'));var zipdir=require(_0x6abf('0x1'));var jsonpatch=require(_0x6abf('0x2'));var rp=require(_0x6abf('0x3'));var moment=require(_0x6abf('0x4'));var BPromise=require(_0x6abf('0x5'));var Mustache=require(_0x6abf('0x6'));var util=require(_0x6abf('0x7'));var path=require('path');var sox=require(_0x6abf('0x8'));var csv=require('to-csv');var ejs=require(_0x6abf('0x9'));var fs=require('fs');var fs_extra=require(_0x6abf('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6abf('0xb'));var jsforce=require(_0x6abf('0xc'));var deskjs=require(_0x6abf('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6abf('0xe'));var Papa=require(_0x6abf('0xf'));var Redis=require(_0x6abf('0x10'));var authService=require(_0x6abf('0x11'));var qs=require(_0x6abf('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6abf('0x13'));var logger=require(_0x6abf('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x6abf('0x15'));var licenseUtil=require(_0x6abf('0x16'));var db=require(_0x6abf('0x17'))['db'];function respondWithStatusCode(_0x272ed6,_0x223911){_0x223911=_0x223911||0xcc;return function(_0x1f042f){if(_0x1f042f){return _0x272ed6[_0x6abf('0x18')](_0x223911);}return _0x272ed6['status'](_0x223911)[_0x6abf('0x19')]();};}function respondWithResult(_0x45b83a,_0x43be3c){_0x43be3c=_0x43be3c||0xc8;return function(_0xc06c41){if(_0xc06c41){return _0x45b83a[_0x6abf('0x1a')](_0x43be3c)[_0x6abf('0x1b')](_0xc06c41);}};}function respondWithFilteredResult(_0x374acd,_0x1b3915){return function(_0x5d0d68){if(_0x5d0d68){var _0x11ed27=typeof _0x1b3915[_0x6abf('0x1c')]===_0x6abf('0x1d')&&typeof _0x1b3915[_0x6abf('0x1e')]===_0x6abf('0x1d');var _0x19e8aa=_0x5d0d68['count'];var _0x52177c=_0x11ed27?0x0:_0x1b3915[_0x6abf('0x1c')];var _0x1c58d4=_0x11ed27?_0x5d0d68[_0x6abf('0x1f')]:_0x1b3915[_0x6abf('0x1c')]+_0x1b3915['limit'];var _0x3b1016;if(_0x1c58d4>=_0x19e8aa){_0x1c58d4=_0x19e8aa;_0x3b1016=0xc8;}else{_0x3b1016=0xce;}_0x374acd[_0x6abf('0x1a')](_0x3b1016);return _0x374acd[_0x6abf('0x20')](_0x6abf('0x21'),_0x52177c+'-'+_0x1c58d4+'/'+_0x19e8aa)[_0x6abf('0x1b')](_0x5d0d68);}return null;};}function patchUpdates(_0x473cb4){return function(_0x591885){try{jsonpatch[_0x6abf('0x22')](_0x591885,_0x473cb4,!![]);}catch(_0x46bc4c){return BPromise[_0x6abf('0x23')](_0x46bc4c);}return _0x591885[_0x6abf('0x24')]();};}function saveUpdates(_0x44f86d,_0x5844e1){return function(_0x3d7f94){if(_0x3d7f94){return _0x3d7f94[_0x6abf('0x25')](_0x44f86d)['then'](function(_0x163b20){return _0x163b20;});}return null;};}function removeEntity(_0x574792,_0x4b7790){return function(_0x210863){if(_0x210863){return _0x210863['destroy']()['then'](function(){var _0xba3d66=_0x210863['get']({'plain':!![]});var _0x3a6ffc=_0x6abf('0x26');return db[_0x6abf('0x27')][_0x6abf('0x28')]({'where':{'type':_0x3a6ffc,'resourceId':_0xba3d66['id']}})['then'](function(){return _0x210863;});})['then'](function(){_0x574792[_0x6abf('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58b8e6,_0x499204){return function(_0x688d0d){if(!_0x688d0d){_0x58b8e6[_0x6abf('0x18')](0x194);}return _0x688d0d;};}function handleError(_0xb71cbe,_0x4e87dd){_0x4e87dd=_0x4e87dd||0x1f4;return function(_0x4ae152){logger[_0x6abf('0x29')](_0x4ae152[_0x6abf('0x2a')]);if(_0x4ae152[_0x6abf('0x2b')]){delete _0x4ae152[_0x6abf('0x2b')];}_0xb71cbe[_0x6abf('0x1a')](_0x4e87dd)[_0x6abf('0x2c')](_0x4ae152);};}exports[_0x6abf('0x2d')]=function(_0x4dbe84,_0x5db4c9){var _0x8fbb4f={},_0x1b02ad={},_0x233245={'count':0x0,'rows':[]};var _0x43b3fa=_[_0x6abf('0x2e')](db['Pause'][_0x6abf('0x2f')],function(_0x4db3cc){return{'name':_0x4db3cc['fieldName'],'type':_0x4db3cc[_0x6abf('0x30')][_0x6abf('0x31')]};});_0x1b02ad[_0x6abf('0x32')]=_[_0x6abf('0x2e')](_0x43b3fa,_0x6abf('0x2b'));_0x1b02ad[_0x6abf('0x33')]=_['keys'](_0x4dbe84[_0x6abf('0x33')]);_0x1b02ad[_0x6abf('0x34')]=_[_0x6abf('0x35')](_0x1b02ad[_0x6abf('0x32')],_0x1b02ad[_0x6abf('0x33')]);_0x8fbb4f['attributes']=_['intersection'](_0x1b02ad['model'],qs[_0x6abf('0x36')](_0x4dbe84[_0x6abf('0x33')][_0x6abf('0x36')]));_0x8fbb4f['attributes']=_0x8fbb4f[_0x6abf('0x37')][_0x6abf('0x38')]?_0x8fbb4f[_0x6abf('0x37')]:_0x1b02ad['model'];if(!_0x4dbe84[_0x6abf('0x33')][_0x6abf('0x39')]('nolimit')){_0x8fbb4f[_0x6abf('0x1e')]=qs[_0x6abf('0x1e')](_0x4dbe84[_0x6abf('0x33')]['limit']);_0x8fbb4f[_0x6abf('0x1c')]=qs[_0x6abf('0x1c')](_0x4dbe84[_0x6abf('0x33')][_0x6abf('0x1c')]);}_0x8fbb4f['order']=qs[_0x6abf('0x3a')](_0x4dbe84[_0x6abf('0x33')][_0x6abf('0x3a')]);_0x8fbb4f[_0x6abf('0x3b')]=qs[_0x6abf('0x34')](_[_0x6abf('0x3c')](_0x4dbe84[_0x6abf('0x33')],_0x1b02ad[_0x6abf('0x34')]),_0x43b3fa);if(_0x4dbe84[_0x6abf('0x33')][_0x6abf('0x3d')]){_0x8fbb4f[_0x6abf('0x3b')]=_[_0x6abf('0x3e')](_0x8fbb4f[_0x6abf('0x3b')],{'$or':_[_0x6abf('0x2e')](_0x43b3fa,function(_0xe501b7){if(_0xe501b7[_0x6abf('0x30')]!==_0x6abf('0x3f')){var _0x23e56a={};_0x23e56a[_0xe501b7[_0x6abf('0x2b')]]={'$like':'%'+_0x4dbe84['query'][_0x6abf('0x3d')]+'%'};return _0x23e56a;}})});}_0x8fbb4f=_['merge']({},_0x8fbb4f,_0x4dbe84[_0x6abf('0x40')]);var _0x76f13d={'where':_0x8fbb4f[_0x6abf('0x3b')]};return db[_0x6abf('0x41')][_0x6abf('0x1f')](_0x76f13d)[_0x6abf('0x42')](function(_0x3b7255){_0x233245[_0x6abf('0x1f')]=_0x3b7255;if(_0x4dbe84[_0x6abf('0x33')][_0x6abf('0x43')]){_0x8fbb4f[_0x6abf('0x44')]=[{'all':!![]}];}return db[_0x6abf('0x41')][_0x6abf('0x45')](_0x8fbb4f);})[_0x6abf('0x42')](function(_0x31f40){_0x233245[_0x6abf('0x46')]=_0x31f40;return _0x233245;})['then'](respondWithFilteredResult(_0x5db4c9,_0x8fbb4f))[_0x6abf('0x47')](handleError(_0x5db4c9,null));};exports['show']=function(_0x1030fd,_0xbce7ad){var _0x26e599={'raw':!![],'where':{'id':_0x1030fd[_0x6abf('0x48')]['id']}},_0x4ed103={};_0x4ed103[_0x6abf('0x32')]=_[_0x6abf('0x49')](db[_0x6abf('0x41')][_0x6abf('0x2f')]);_0x4ed103[_0x6abf('0x33')]=_['keys'](_0x1030fd[_0x6abf('0x33')]);_0x4ed103['filters']=_[_0x6abf('0x35')](_0x4ed103[_0x6abf('0x32')],_0x4ed103[_0x6abf('0x33')]);_0x26e599[_0x6abf('0x37')]=_[_0x6abf('0x35')](_0x4ed103[_0x6abf('0x32')],qs[_0x6abf('0x36')](_0x1030fd[_0x6abf('0x33')][_0x6abf('0x36')]));_0x26e599[_0x6abf('0x37')]=_0x26e599[_0x6abf('0x37')][_0x6abf('0x38')]?_0x26e599[_0x6abf('0x37')]:_0x4ed103['model'];if(_0x1030fd['query'][_0x6abf('0x43')]){_0x26e599[_0x6abf('0x44')]=[{'all':!![]}];}_0x26e599=_[_0x6abf('0x3e')]({},_0x26e599,_0x1030fd['options']);return db[_0x6abf('0x41')][_0x6abf('0x4a')](_0x26e599)['then'](handleEntityNotFound(_0xbce7ad,null))[_0x6abf('0x42')](respondWithResult(_0xbce7ad,null))[_0x6abf('0x47')](handleError(_0xbce7ad,null));};exports[_0x6abf('0x4b')]=function(_0x39af66,_0x1aaaab){return db[_0x6abf('0x41')][_0x6abf('0x4b')](_0x39af66['body'],{})['then'](function(_0x41a709){var _0x21c4f7=_0x39af66[_0x6abf('0x4c')][_0x6abf('0x4d')]({'plain':!![]});if(!_0x21c4f7)throw new Error(_0x6abf('0x4e'));if(_0x21c4f7[_0x6abf('0x4f')]==='user'){var _0x364562=_0x41a709[_0x6abf('0x4d')]({'plain':!![]});var _0x4e906b='Pauses';return db[_0x6abf('0x50')]['find']({'where':{'name':_0x4e906b,'userProfileId':_0x21c4f7[_0x6abf('0x51')]},'raw':!![]})[_0x6abf('0x42')](function(_0x1ec15f){if(_0x1ec15f&&_0x1ec15f['autoAssociation']===0x0){return db[_0x6abf('0x27')]['create']({'name':_0x364562[_0x6abf('0x2b')],'resourceId':_0x364562['id'],'type':_0x1ec15f[_0x6abf('0x2b')],'sectionId':_0x1ec15f['id']},{})[_0x6abf('0x42')](function(){return _0x41a709;});}else{return _0x41a709;}})['catch'](function(_0x54bb79){logger[_0x6abf('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54bb79);throw _0x54bb79;});}return _0x41a709;})[_0x6abf('0x42')](respondWithResult(_0x1aaaab,0xc9))[_0x6abf('0x47')](handleError(_0x1aaaab,null));};exports[_0x6abf('0x25')]=function(_0x560857,_0x1789b9){if(_0x560857['body']['id']){delete _0x560857['body']['id'];}return db[_0x6abf('0x41')][_0x6abf('0x4a')]({'where':{'id':_0x560857[_0x6abf('0x48')]['id']}})['then'](handleEntityNotFound(_0x1789b9,null))['then'](saveUpdates(_0x560857[_0x6abf('0x52')],null))[_0x6abf('0x42')](respondWithResult(_0x1789b9,null))[_0x6abf('0x47')](handleError(_0x1789b9,null));};exports['destroy']=function(_0x1fb1f6,_0x33d27b){return db[_0x6abf('0x41')][_0x6abf('0x4a')]({'where':{'id':_0x1fb1f6['params']['id']}})[_0x6abf('0x42')](handleEntityNotFound(_0x33d27b,null))[_0x6abf('0x42')](removeEntity(_0x33d27b,null))[_0x6abf('0x47')](handleError(_0x33d27b,null));};
\ No newline at end of file
+var _0x3d81=['pick','filter','merge','VIRTUAL','options','includeAll','catch','show','params','rawAttributes','keys','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','rimraf','request-promise','mustache','util','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','set','apply','reject','update','then','destroy','get','end','error','name','send','index','map','Pause','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where'];(function(_0x41bdb7,_0x2d3c1c){var _0xa1e594=function(_0x4aa014){while(--_0x4aa014){_0x41bdb7['push'](_0x41bdb7['shift']());}};_0xa1e594(++_0x2d3c1c);}(_0x3d81,0x1dd));var _0x13d8=function(_0x40ae6d,_0x4d9242){_0x40ae6d=_0x40ae6d-0x0;var _0x58d456=_0x3d81[_0x40ae6d];return _0x58d456;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x13d8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x13d8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x13d8('0x2'));var util=require(_0x13d8('0x3'));var path=require('path');var sox=require(_0x13d8('0x4'));var csv=require(_0x13d8('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x13d8('0x6'));var _=require(_0x13d8('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x13d8('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x13d8('0x5'));var querystring=require(_0x13d8('0x9'));var Papa=require(_0x13d8('0xa'));var Redis=require('ioredis');var authService=require(_0x13d8('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0x13d8('0xc'));var hardwareService=require(_0x13d8('0xd'));var logger=require(_0x13d8('0xe'))(_0x13d8('0xf'));var utils=require(_0x13d8('0x10'));var config=require(_0x13d8('0x11'));var licenseUtil=require(_0x13d8('0x12'));var db=require(_0x13d8('0x13'))['db'];function respondWithStatusCode(_0x1bff55,_0x5c46ec){_0x5c46ec=_0x5c46ec||0xcc;return function(_0x4a7bc9){if(_0x4a7bc9){return _0x1bff55['sendStatus'](_0x5c46ec);}return _0x1bff55['status'](_0x5c46ec)['end']();};}function respondWithResult(_0x27cb15,_0x380325){_0x380325=_0x380325||0xc8;return function(_0x11ae2c){if(_0x11ae2c){return _0x27cb15[_0x13d8('0x14')](_0x380325)[_0x13d8('0x15')](_0x11ae2c);}};}function respondWithFilteredResult(_0x30a69c,_0x12c58b){return function(_0x595507){if(_0x595507){var _0x161a14=typeof _0x12c58b[_0x13d8('0x16')]===_0x13d8('0x17')&&typeof _0x12c58b['limit']===_0x13d8('0x17');var _0x336e0e=_0x595507['count'];var _0x29173f=_0x161a14?0x0:_0x12c58b[_0x13d8('0x16')];var _0x1496f0=_0x161a14?_0x595507[_0x13d8('0x18')]:_0x12c58b[_0x13d8('0x16')]+_0x12c58b['limit'];var _0x1a6956;if(_0x1496f0>=_0x336e0e){_0x1496f0=_0x336e0e;_0x1a6956=0xc8;}else{_0x1a6956=0xce;}_0x30a69c[_0x13d8('0x14')](_0x1a6956);return _0x30a69c[_0x13d8('0x19')]('Content-Range',_0x29173f+'-'+_0x1496f0+'/'+_0x336e0e)[_0x13d8('0x15')](_0x595507);}return null;};}function patchUpdates(_0x25dcd0){return function(_0x3f307b){try{jsonpatch[_0x13d8('0x1a')](_0x3f307b,_0x25dcd0,!![]);}catch(_0x1f399d){return BPromise[_0x13d8('0x1b')](_0x1f399d);}return _0x3f307b['save']();};}function saveUpdates(_0x38f5eb,_0xd5773f){return function(_0x47871f){if(_0x47871f){return _0x47871f[_0x13d8('0x1c')](_0x38f5eb)[_0x13d8('0x1d')](function(_0x12a1de){return _0x12a1de;});}return null;};}function removeEntity(_0x3ec3f8,_0xfdae0a){return function(_0x1cbf96){if(_0x1cbf96){return _0x1cbf96[_0x13d8('0x1e')]()[_0x13d8('0x1d')](function(){var _0x37b28b=_0x1cbf96[_0x13d8('0x1f')]({'plain':!![]});var _0x2a35f3='Pauses';return db['UserProfileResource']['destroy']({'where':{'type':_0x2a35f3,'resourceId':_0x37b28b['id']}})[_0x13d8('0x1d')](function(){return _0x1cbf96;});})[_0x13d8('0x1d')](function(){_0x3ec3f8[_0x13d8('0x14')](0xcc)[_0x13d8('0x20')]();});}};}function handleEntityNotFound(_0x465dd6,_0x2c8564){return function(_0x221f89){if(!_0x221f89){_0x465dd6['sendStatus'](0x194);}return _0x221f89;};}function handleError(_0x5edcb5,_0x834092){_0x834092=_0x834092||0x1f4;return function(_0x47baa7){logger[_0x13d8('0x21')](_0x47baa7['stack']);if(_0x47baa7[_0x13d8('0x22')]){delete _0x47baa7['name'];}_0x5edcb5[_0x13d8('0x14')](_0x834092)[_0x13d8('0x23')](_0x47baa7);};}exports[_0x13d8('0x24')]=function(_0x5f3a01,_0x3ef271){var _0x290903={},_0x1ab8ab={},_0x3f6750={'count':0x0,'rows':[]};var _0x45c0dd=_[_0x13d8('0x25')](db[_0x13d8('0x26')]['rawAttributes'],function(_0x114a35){return{'name':_0x114a35[_0x13d8('0x27')],'type':_0x114a35[_0x13d8('0x28')][_0x13d8('0x29')]};});_0x1ab8ab['model']=_[_0x13d8('0x25')](_0x45c0dd,_0x13d8('0x22'));_0x1ab8ab[_0x13d8('0x2a')]=_['keys'](_0x5f3a01['query']);_0x1ab8ab[_0x13d8('0x2b')]=_[_0x13d8('0x2c')](_0x1ab8ab[_0x13d8('0x2d')],_0x1ab8ab['query']);_0x290903[_0x13d8('0x2e')]=_[_0x13d8('0x2c')](_0x1ab8ab[_0x13d8('0x2d')],qs[_0x13d8('0x2f')](_0x5f3a01['query'][_0x13d8('0x2f')]));_0x290903[_0x13d8('0x2e')]=_0x290903[_0x13d8('0x2e')][_0x13d8('0x30')]?_0x290903[_0x13d8('0x2e')]:_0x1ab8ab[_0x13d8('0x2d')];if(!_0x5f3a01[_0x13d8('0x2a')][_0x13d8('0x31')](_0x13d8('0x32'))){_0x290903[_0x13d8('0x33')]=qs[_0x13d8('0x33')](_0x5f3a01['query'][_0x13d8('0x33')]);_0x290903[_0x13d8('0x16')]=qs[_0x13d8('0x16')](_0x5f3a01[_0x13d8('0x2a')]['offset']);}_0x290903[_0x13d8('0x34')]=qs[_0x13d8('0x35')](_0x5f3a01['query']['sort']);_0x290903[_0x13d8('0x36')]=qs['filters'](_[_0x13d8('0x37')](_0x5f3a01[_0x13d8('0x2a')],_0x1ab8ab['filters']),_0x45c0dd);if(_0x5f3a01['query'][_0x13d8('0x38')]){_0x290903[_0x13d8('0x36')]=_[_0x13d8('0x39')](_0x290903[_0x13d8('0x36')],{'$or':_['map'](_0x45c0dd,function(_0x55fb11){if(_0x55fb11[_0x13d8('0x28')]!==_0x13d8('0x3a')){var _0x367503={};_0x367503[_0x55fb11[_0x13d8('0x22')]]={'$like':'%'+_0x5f3a01[_0x13d8('0x2a')][_0x13d8('0x38')]+'%'};return _0x367503;}})});}_0x290903=_[_0x13d8('0x39')]({},_0x290903,_0x5f3a01[_0x13d8('0x3b')]);var _0x23b4dd={'where':_0x290903[_0x13d8('0x36')]};return db[_0x13d8('0x26')][_0x13d8('0x18')](_0x23b4dd)[_0x13d8('0x1d')](function(_0x5cd62f){_0x3f6750[_0x13d8('0x18')]=_0x5cd62f;if(_0x5f3a01['query'][_0x13d8('0x3c')]){_0x290903['include']=[{'all':!![]}];}return db[_0x13d8('0x26')]['findAll'](_0x290903);})[_0x13d8('0x1d')](function(_0x14c6b1){_0x3f6750['rows']=_0x14c6b1;return _0x3f6750;})[_0x13d8('0x1d')](respondWithFilteredResult(_0x3ef271,_0x290903))[_0x13d8('0x3d')](handleError(_0x3ef271,null));};exports[_0x13d8('0x3e')]=function(_0x3cb5c5,_0x459e90){var _0x3eeec8={'raw':!![],'where':{'id':_0x3cb5c5[_0x13d8('0x3f')]['id']}},_0x3b7282={};_0x3b7282[_0x13d8('0x2d')]=_['keys'](db[_0x13d8('0x26')][_0x13d8('0x40')]);_0x3b7282[_0x13d8('0x2a')]=_[_0x13d8('0x41')](_0x3cb5c5[_0x13d8('0x2a')]);_0x3b7282[_0x13d8('0x2b')]=_[_0x13d8('0x2c')](_0x3b7282[_0x13d8('0x2d')],_0x3b7282[_0x13d8('0x2a')]);_0x3eeec8[_0x13d8('0x2e')]=_[_0x13d8('0x2c')](_0x3b7282[_0x13d8('0x2d')],qs[_0x13d8('0x2f')](_0x3cb5c5[_0x13d8('0x2a')][_0x13d8('0x2f')]));_0x3eeec8[_0x13d8('0x2e')]=_0x3eeec8[_0x13d8('0x2e')][_0x13d8('0x30')]?_0x3eeec8['attributes']:_0x3b7282['model'];if(_0x3cb5c5[_0x13d8('0x2a')][_0x13d8('0x3c')]){_0x3eeec8['include']=[{'all':!![]}];}_0x3eeec8=_[_0x13d8('0x39')]({},_0x3eeec8,_0x3cb5c5[_0x13d8('0x3b')]);return db[_0x13d8('0x26')]['find'](_0x3eeec8)[_0x13d8('0x1d')](handleEntityNotFound(_0x459e90,null))[_0x13d8('0x1d')](respondWithResult(_0x459e90,null))['catch'](handleError(_0x459e90,null));};exports[_0x13d8('0x42')]=function(_0xb4f4f4,_0x96d1e3){return db[_0x13d8('0x26')]['create'](_0xb4f4f4[_0x13d8('0x43')],{})[_0x13d8('0x1d')](function(_0x4439af){var _0x40082f=_0xb4f4f4['user'][_0x13d8('0x1f')]({'plain':!![]});if(!_0x40082f)throw new Error(_0x13d8('0x44'));if(_0x40082f[_0x13d8('0x45')]===_0x13d8('0x46')){var _0x169b54=_0x4439af[_0x13d8('0x1f')]({'plain':!![]});var _0x319853='Pauses';return db[_0x13d8('0x47')][_0x13d8('0x48')]({'where':{'name':_0x319853,'userProfileId':_0x40082f[_0x13d8('0x49')]},'raw':!![]})[_0x13d8('0x1d')](function(_0x45898f){if(_0x45898f&&_0x45898f[_0x13d8('0x4a')]===0x0){return db[_0x13d8('0x4b')][_0x13d8('0x42')]({'name':_0x169b54[_0x13d8('0x22')],'resourceId':_0x169b54['id'],'type':_0x45898f[_0x13d8('0x22')],'sectionId':_0x45898f['id']},{})[_0x13d8('0x1d')](function(){return _0x4439af;});}else{return _0x4439af;}})[_0x13d8('0x3d')](function(_0xbc1fd6){logger[_0x13d8('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xbc1fd6);throw _0xbc1fd6;});}return _0x4439af;})[_0x13d8('0x1d')](respondWithResult(_0x96d1e3,0xc9))[_0x13d8('0x3d')](handleError(_0x96d1e3,null));};exports[_0x13d8('0x1c')]=function(_0x21f742,_0x1e97ef){if(_0x21f742[_0x13d8('0x43')]['id']){delete _0x21f742[_0x13d8('0x43')]['id'];}return db['Pause'][_0x13d8('0x48')]({'where':{'id':_0x21f742['params']['id']}})[_0x13d8('0x1d')](handleEntityNotFound(_0x1e97ef,null))[_0x13d8('0x1d')](saveUpdates(_0x21f742['body'],null))[_0x13d8('0x1d')](respondWithResult(_0x1e97ef,null))[_0x13d8('0x3d')](handleError(_0x1e97ef,null));};exports[_0x13d8('0x1e')]=function(_0x46570e,_0x38db1a){return db[_0x13d8('0x26')][_0x13d8('0x48')]({'where':{'id':_0x46570e[_0x13d8('0x3f')]['id']}})[_0x13d8('0x1d')](handleEntityNotFound(_0x38db1a,null))[_0x13d8('0x1d')](removeEntity(_0x38db1a,null))[_0x13d8('0x3d')](handleError(_0x38db1a,null));};
\ No newline at end of file