Built motion from commit 96f8de6d.|2.6.3
[motion2.git] / server / api / disposition / disposition.controller.js
index 9de6ad9..21bb8f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb07=['desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','status','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','Disposition','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','rows','params','fields','length','includeAll','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xcb07,0x98));var _0x7cb0=function(_0xe30e17,_0xce02be){_0xe30e17=_0xe30e17-0x0;var _0x2342c9=_0xcb07[_0xe30e17];return _0x2342c9;};'use strict';var emlformat=require(_0x7cb0('0x0'));var rimraf=require(_0x7cb0('0x1'));var zipdir=require(_0x7cb0('0x2'));var jsonpatch=require(_0x7cb0('0x3'));var rp=require(_0x7cb0('0x4'));var moment=require('moment');var BPromise=require(_0x7cb0('0x5'));var Mustache=require(_0x7cb0('0x6'));var util=require(_0x7cb0('0x7'));var path=require('path');var sox=require(_0x7cb0('0x8'));var csv=require('to-csv');var ejs=require(_0x7cb0('0x9'));var fs=require('fs');var fs_extra=require(_0x7cb0('0xa'));var _=require('lodash');var squel=require(_0x7cb0('0xb'));var crypto=require(_0x7cb0('0xc'));var jsforce=require(_0x7cb0('0xd'));var deskjs=require(_0x7cb0('0xe'));var toCsv=require(_0x7cb0('0xf'));var querystring=require(_0x7cb0('0x10'));var Papa=require(_0x7cb0('0x11'));var Redis=require('ioredis');var authService=require(_0x7cb0('0x12'));var qs=require(_0x7cb0('0x13'));var as=require(_0x7cb0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7cb0('0x15'));var utils=require(_0x7cb0('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x354344,_0x55b8bf){_0x55b8bf=_0x55b8bf||0xcc;return function(_0x2176de){if(_0x2176de){return _0x354344[_0x7cb0('0x17')](_0x55b8bf);}return _0x354344[_0x7cb0('0x18')](_0x55b8bf)['end']();};}function respondWithResult(_0x5abaee,_0x27d184){_0x27d184=_0x27d184||0xc8;return function(_0x1c7a66){if(_0x1c7a66){return _0x5abaee[_0x7cb0('0x18')](_0x27d184)['json'](_0x1c7a66);}};}function respondWithFilteredResult(_0xea1b72,_0x4e1e08){return function(_0x58aec0){if(_0x58aec0){var _0x3c7578=typeof _0x4e1e08['offset']===_0x7cb0('0x19')&&typeof _0x4e1e08[_0x7cb0('0x1a')]===_0x7cb0('0x19');var _0x34f163=_0x58aec0['count'];var _0xa77ddd=_0x3c7578?0x0:_0x4e1e08[_0x7cb0('0x1b')];var _0x2b6982=_0x3c7578?_0x58aec0[_0x7cb0('0x1c')]:_0x4e1e08[_0x7cb0('0x1b')]+_0x4e1e08[_0x7cb0('0x1a')];var _0x4cfbc8;if(_0x2b6982>=_0x34f163){_0x2b6982=_0x34f163;_0x4cfbc8=0xc8;}else{_0x4cfbc8=0xce;}_0xea1b72[_0x7cb0('0x18')](_0x4cfbc8);return _0xea1b72[_0x7cb0('0x1d')](_0x7cb0('0x1e'),_0xa77ddd+'-'+_0x2b6982+'/'+_0x34f163)['json'](_0x58aec0);}return null;};}function patchUpdates(_0x356937){return function(_0x54605e){try{jsonpatch[_0x7cb0('0x1f')](_0x54605e,_0x356937,!![]);}catch(_0x8d7d87){return BPromise[_0x7cb0('0x20')](_0x8d7d87);}return _0x54605e[_0x7cb0('0x21')]();};}function saveUpdates(_0x16ef84,_0x371503){return function(_0x1c84c7){if(_0x1c84c7){return _0x1c84c7[_0x7cb0('0x22')](_0x16ef84)[_0x7cb0('0x23')](function(_0x232754){return _0x232754;});}return null;};}function removeEntity(_0x4b164d,_0x180039){return function(_0x248085){if(_0x248085){return _0x248085[_0x7cb0('0x24')]()[_0x7cb0('0x23')](function(){var _0x1051b0=_0x248085[_0x7cb0('0x25')]({'plain':!![]});var _0x2a3c2c='Dispositions';return db[_0x7cb0('0x26')][_0x7cb0('0x24')]({'where':{'type':_0x2a3c2c,'resourceId':_0x1051b0['id']}})[_0x7cb0('0x23')](function(){return _0x248085;});})[_0x7cb0('0x23')](function(){_0x4b164d[_0x7cb0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f3d3d,_0x6c38b){return function(_0x1e0dd3){if(!_0x1e0dd3){_0x1f3d3d['sendStatus'](0x194);}return _0x1e0dd3;};}function handleError(_0x1090ea,_0x87798d){_0x87798d=_0x87798d||0x1f4;return function(_0x14a645){logger[_0x7cb0('0x27')](_0x14a645[_0x7cb0('0x28')]);if(_0x14a645[_0x7cb0('0x29')]){delete _0x14a645[_0x7cb0('0x29')];}_0x1090ea[_0x7cb0('0x18')](_0x87798d)[_0x7cb0('0x2a')](_0x14a645);};}exports[_0x7cb0('0x2b')]=function(_0x152607,_0x49d230){var _0x54ba78={},_0x2a1263={},_0x744377={'count':0x0,'rows':[]};var _0x569574=_['map'](db[_0x7cb0('0x2c')][_0x7cb0('0x2d')],function(_0x2f8760){return{'name':_0x2f8760[_0x7cb0('0x2e')],'type':_0x2f8760['type'][_0x7cb0('0x2f')]};});_0x2a1263[_0x7cb0('0x30')]=_[_0x7cb0('0x31')](_0x569574,_0x7cb0('0x29'));_0x2a1263[_0x7cb0('0x32')]=_[_0x7cb0('0x33')](_0x152607['query']);_0x2a1263[_0x7cb0('0x34')]=_[_0x7cb0('0x35')](_0x2a1263['model'],_0x2a1263[_0x7cb0('0x32')]);_0x54ba78['attributes']=_[_0x7cb0('0x35')](_0x2a1263[_0x7cb0('0x30')],qs['fields'](_0x152607[_0x7cb0('0x32')]['fields']));_0x54ba78[_0x7cb0('0x36')]=_0x54ba78[_0x7cb0('0x36')]['length']?_0x54ba78[_0x7cb0('0x36')]:_0x2a1263[_0x7cb0('0x30')];if(!_0x152607[_0x7cb0('0x32')][_0x7cb0('0x37')]('nolimit')){_0x54ba78[_0x7cb0('0x1a')]=qs[_0x7cb0('0x1a')](_0x152607['query'][_0x7cb0('0x1a')]);_0x54ba78['offset']=qs['offset'](_0x152607[_0x7cb0('0x32')][_0x7cb0('0x1b')]);}_0x54ba78[_0x7cb0('0x38')]=qs[_0x7cb0('0x39')](_0x152607['query'][_0x7cb0('0x39')]);_0x54ba78[_0x7cb0('0x3a')]=qs['filters'](_[_0x7cb0('0x3b')](_0x152607[_0x7cb0('0x32')],_0x2a1263[_0x7cb0('0x34')]),_0x569574);if(_0x152607['query'][_0x7cb0('0x3c')]){_0x54ba78[_0x7cb0('0x3a')]=_[_0x7cb0('0x3d')](_0x54ba78['where'],{'$or':_['map'](_0x569574,function(_0x463e48){if(_0x463e48[_0x7cb0('0x3e')]!==_0x7cb0('0x3f')){var _0x16379d={};_0x16379d[_0x463e48[_0x7cb0('0x29')]]={'$like':'%'+_0x152607[_0x7cb0('0x32')][_0x7cb0('0x3c')]+'%'};return _0x16379d;}})});}_0x54ba78=_['merge']({},_0x54ba78,_0x152607[_0x7cb0('0x40')]);var _0x42ab45={'where':_0x54ba78[_0x7cb0('0x3a')]};return db[_0x7cb0('0x2c')]['count'](_0x42ab45)[_0x7cb0('0x23')](function(_0x37d5ff){_0x744377[_0x7cb0('0x1c')]=_0x37d5ff;if(_0x152607['query']['includeAll']){_0x54ba78['include']=[{'all':!![]}];}return db['Disposition'][_0x7cb0('0x41')](_0x54ba78);})[_0x7cb0('0x23')](function(_0x4cfefc){_0x744377[_0x7cb0('0x42')]=_0x4cfefc;return _0x744377;})['then'](respondWithFilteredResult(_0x49d230,_0x54ba78))['catch'](handleError(_0x49d230,null));};exports['show']=function(_0x516470,_0x4e2348){var _0x2d0168={'raw':!![],'where':{'id':_0x516470[_0x7cb0('0x43')]['id']}},_0xae5194={};_0xae5194['model']=_['keys'](db[_0x7cb0('0x2c')][_0x7cb0('0x2d')]);_0xae5194['query']=_['keys'](_0x516470['query']);_0xae5194['filters']=_[_0x7cb0('0x35')](_0xae5194[_0x7cb0('0x30')],_0xae5194[_0x7cb0('0x32')]);_0x2d0168[_0x7cb0('0x36')]=_[_0x7cb0('0x35')](_0xae5194['model'],qs[_0x7cb0('0x44')](_0x516470[_0x7cb0('0x32')]['fields']));_0x2d0168[_0x7cb0('0x36')]=_0x2d0168[_0x7cb0('0x36')][_0x7cb0('0x45')]?_0x2d0168['attributes']:_0xae5194['model'];if(_0x516470[_0x7cb0('0x32')][_0x7cb0('0x46')]){_0x2d0168[_0x7cb0('0x47')]=[{'all':!![]}];}_0x2d0168=_[_0x7cb0('0x3d')]({},_0x2d0168,_0x516470[_0x7cb0('0x40')]);return db[_0x7cb0('0x2c')][_0x7cb0('0x48')](_0x2d0168)[_0x7cb0('0x23')](handleEntityNotFound(_0x4e2348,null))[_0x7cb0('0x23')](respondWithResult(_0x4e2348,null))[_0x7cb0('0x49')](handleError(_0x4e2348,null));};exports['create']=function(_0x496437,_0x7f0752){return db[_0x7cb0('0x2c')][_0x7cb0('0x4a')](_0x496437[_0x7cb0('0x4b')],{})[_0x7cb0('0x23')](function(_0x3081ec){var _0x489abc=_0x496437[_0x7cb0('0x4c')]['get']({'plain':!![]});if(!_0x489abc)throw new Error(_0x7cb0('0x4d'));if(_0x489abc[_0x7cb0('0x4e')]===_0x7cb0('0x4c')){var _0x1decd1=_0x3081ec['get']({'plain':!![]});var _0x3cfe10=_0x7cb0('0x4f');return db[_0x7cb0('0x50')][_0x7cb0('0x48')]({'where':{'name':_0x3cfe10,'userProfileId':_0x489abc[_0x7cb0('0x51')]},'raw':!![]})[_0x7cb0('0x23')](function(_0x1dd4cf){if(_0x1dd4cf&&_0x1dd4cf[_0x7cb0('0x52')]===0x0){return db[_0x7cb0('0x26')][_0x7cb0('0x4a')]({'name':_0x1decd1[_0x7cb0('0x29')],'resourceId':_0x1decd1['id'],'type':_0x1dd4cf[_0x7cb0('0x29')],'sectionId':_0x1dd4cf['id']},{})[_0x7cb0('0x23')](function(){return _0x3081ec;});}else{return _0x3081ec;}})[_0x7cb0('0x49')](function(_0x5b6972){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b6972);throw _0x5b6972;});}return _0x3081ec;})[_0x7cb0('0x23')](respondWithResult(_0x7f0752,0xc9))[_0x7cb0('0x49')](handleError(_0x7f0752,null));};exports[_0x7cb0('0x22')]=function(_0x489d32,_0x1c2185){if(_0x489d32[_0x7cb0('0x4b')]['id']){delete _0x489d32['body']['id'];}return db['Disposition']['find']({'where':{'id':_0x489d32[_0x7cb0('0x43')]['id']}})[_0x7cb0('0x23')](handleEntityNotFound(_0x1c2185,null))[_0x7cb0('0x23')](saveUpdates(_0x489d32[_0x7cb0('0x4b')],null))[_0x7cb0('0x23')](respondWithResult(_0x1c2185,null))[_0x7cb0('0x49')](handleError(_0x1c2185,null));};exports[_0x7cb0('0x24')]=function(_0x1ed619,_0x2bf295){return db[_0x7cb0('0x2c')][_0x7cb0('0x48')]({'where':{'id':_0x1ed619[_0x7cb0('0x43')]['id']}})[_0x7cb0('0x23')](handleEntityNotFound(_0x2bf295,null))['then'](removeEntity(_0x2bf295,null))[_0x7cb0('0x49')](handleError(_0x2bf295,null));};
\ No newline at end of file
+var _0xbcc7=['find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','eml-format','rimraf','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','get','error','stack','name','send','index','map','Disposition','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','show','params','rawAttributes','includeAll'];(function(_0x1633a0,_0x3cdfc1){var _0x523846=function(_0x564b28){while(--_0x564b28){_0x1633a0['push'](_0x1633a0['shift']());}};_0x523846(++_0x3cdfc1);}(_0xbcc7,0x19a));var _0x7bcc=function(_0x58ae8a,_0x3c619e){_0x58ae8a=_0x58ae8a-0x0;var _0x2f0b6b=_0xbcc7[_0x58ae8a];return _0x2f0b6b;};'use strict';var emlformat=require(_0x7bcc('0x0'));var rimraf=require(_0x7bcc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7bcc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7bcc('0x3'));var Mustache=require('mustache');var util=require(_0x7bcc('0x4'));var path=require(_0x7bcc('0x5'));var sox=require('sox');var csv=require(_0x7bcc('0x6'));var ejs=require(_0x7bcc('0x7'));var fs=require('fs');var fs_extra=require(_0x7bcc('0x8'));var _=require(_0x7bcc('0x9'));var squel=require(_0x7bcc('0xa'));var crypto=require(_0x7bcc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7bcc('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7bcc('0xd'));var Papa=require(_0x7bcc('0xe'));var Redis=require('ioredis');var authService=require(_0x7bcc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bcc('0x10'))(_0x7bcc('0x11'));var utils=require(_0x7bcc('0x12'));var config=require(_0x7bcc('0x13'));var licenseUtil=require(_0x7bcc('0x14'));var db=require(_0x7bcc('0x15'))['db'];function respondWithStatusCode(_0xae46e8,_0x51b0e8){_0x51b0e8=_0x51b0e8||0xcc;return function(_0x3e3580){if(_0x3e3580){return _0xae46e8[_0x7bcc('0x16')](_0x51b0e8);}return _0xae46e8[_0x7bcc('0x17')](_0x51b0e8)[_0x7bcc('0x18')]();};}function respondWithResult(_0x39f912,_0x217896){_0x217896=_0x217896||0xc8;return function(_0x4a2539){if(_0x4a2539){return _0x39f912[_0x7bcc('0x17')](_0x217896)[_0x7bcc('0x19')](_0x4a2539);}};}function respondWithFilteredResult(_0x148618,_0x461ff7){return function(_0x30caa2){if(_0x30caa2){var _0x134d55=typeof _0x461ff7[_0x7bcc('0x1a')]==='undefined'&&typeof _0x461ff7[_0x7bcc('0x1b')]==='undefined';var _0x3156f3=_0x30caa2[_0x7bcc('0x1c')];var _0x340bd6=_0x134d55?0x0:_0x461ff7[_0x7bcc('0x1a')];var _0x49168c=_0x134d55?_0x30caa2['count']:_0x461ff7[_0x7bcc('0x1a')]+_0x461ff7[_0x7bcc('0x1b')];var _0x1a1b7f;if(_0x49168c>=_0x3156f3){_0x49168c=_0x3156f3;_0x1a1b7f=0xc8;}else{_0x1a1b7f=0xce;}_0x148618[_0x7bcc('0x17')](_0x1a1b7f);return _0x148618[_0x7bcc('0x1d')](_0x7bcc('0x1e'),_0x340bd6+'-'+_0x49168c+'/'+_0x3156f3)[_0x7bcc('0x19')](_0x30caa2);}return null;};}function patchUpdates(_0x3d0719){return function(_0x15b2c3){try{jsonpatch['apply'](_0x15b2c3,_0x3d0719,!![]);}catch(_0x553865){return BPromise[_0x7bcc('0x1f')](_0x553865);}return _0x15b2c3[_0x7bcc('0x20')]();};}function saveUpdates(_0x34ee2a,_0x3050cf){return function(_0x201f40){if(_0x201f40){return _0x201f40[_0x7bcc('0x21')](_0x34ee2a)[_0x7bcc('0x22')](function(_0x345671){return _0x345671;});}return null;};}function removeEntity(_0x32b3ea,_0x54c611){return function(_0x2d25b8){if(_0x2d25b8){return _0x2d25b8[_0x7bcc('0x23')]()[_0x7bcc('0x22')](function(){var _0x3875df=_0x2d25b8[_0x7bcc('0x24')]({'plain':!![]});var _0x1d085c='Dispositions';return db['UserProfileResource'][_0x7bcc('0x23')]({'where':{'type':_0x1d085c,'resourceId':_0x3875df['id']}})['then'](function(){return _0x2d25b8;});})['then'](function(){_0x32b3ea[_0x7bcc('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f79a0,_0xe594c6){return function(_0x1725e5){if(!_0x1725e5){_0x3f79a0['sendStatus'](0x194);}return _0x1725e5;};}function handleError(_0x17c3ce,_0x1dea55){_0x1dea55=_0x1dea55||0x1f4;return function(_0x2e92e1){logger[_0x7bcc('0x25')](_0x2e92e1[_0x7bcc('0x26')]);if(_0x2e92e1[_0x7bcc('0x27')]){delete _0x2e92e1[_0x7bcc('0x27')];}_0x17c3ce['status'](_0x1dea55)[_0x7bcc('0x28')](_0x2e92e1);};}exports[_0x7bcc('0x29')]=function(_0x51105b,_0x5d4131){var _0x472b73={},_0x5010ab={},_0x19bda9={'count':0x0,'rows':[]};var _0x284476=_[_0x7bcc('0x2a')](db[_0x7bcc('0x2b')]['rawAttributes'],function(_0x351c12){return{'name':_0x351c12[_0x7bcc('0x2c')],'type':_0x351c12[_0x7bcc('0x2d')]['key']};});_0x5010ab[_0x7bcc('0x2e')]=_[_0x7bcc('0x2a')](_0x284476,_0x7bcc('0x27'));_0x5010ab[_0x7bcc('0x2f')]=_[_0x7bcc('0x30')](_0x51105b[_0x7bcc('0x2f')]);_0x5010ab[_0x7bcc('0x31')]=_[_0x7bcc('0x32')](_0x5010ab[_0x7bcc('0x2e')],_0x5010ab[_0x7bcc('0x2f')]);_0x472b73[_0x7bcc('0x33')]=_['intersection'](_0x5010ab[_0x7bcc('0x2e')],qs[_0x7bcc('0x34')](_0x51105b[_0x7bcc('0x2f')]['fields']));_0x472b73['attributes']=_0x472b73[_0x7bcc('0x33')][_0x7bcc('0x35')]?_0x472b73[_0x7bcc('0x33')]:_0x5010ab[_0x7bcc('0x2e')];if(!_0x51105b[_0x7bcc('0x2f')][_0x7bcc('0x36')](_0x7bcc('0x37'))){_0x472b73['limit']=qs['limit'](_0x51105b['query']['limit']);_0x472b73[_0x7bcc('0x1a')]=qs[_0x7bcc('0x1a')](_0x51105b[_0x7bcc('0x2f')]['offset']);}_0x472b73[_0x7bcc('0x38')]=qs[_0x7bcc('0x39')](_0x51105b[_0x7bcc('0x2f')]['sort']);_0x472b73['where']=qs[_0x7bcc('0x31')](_[_0x7bcc('0x3a')](_0x51105b[_0x7bcc('0x2f')],_0x5010ab['filters']),_0x284476);if(_0x51105b['query'][_0x7bcc('0x3b')]){_0x472b73[_0x7bcc('0x3c')]=_[_0x7bcc('0x3d')](_0x472b73['where'],{'$or':_[_0x7bcc('0x2a')](_0x284476,function(_0x3f3357){if(_0x3f3357[_0x7bcc('0x2d')]!==_0x7bcc('0x3e')){var _0x10bd59={};_0x10bd59[_0x3f3357[_0x7bcc('0x27')]]={'$like':'%'+_0x51105b['query'][_0x7bcc('0x3b')]+'%'};return _0x10bd59;}})});}_0x472b73=_[_0x7bcc('0x3d')]({},_0x472b73,_0x51105b['options']);var _0x10618e={'where':_0x472b73[_0x7bcc('0x3c')]};return db[_0x7bcc('0x2b')][_0x7bcc('0x1c')](_0x10618e)[_0x7bcc('0x22')](function(_0x1b4d75){_0x19bda9[_0x7bcc('0x1c')]=_0x1b4d75;if(_0x51105b[_0x7bcc('0x2f')]['includeAll']){_0x472b73[_0x7bcc('0x3f')]=[{'all':!![]}];}return db[_0x7bcc('0x2b')][_0x7bcc('0x40')](_0x472b73);})[_0x7bcc('0x22')](function(_0x4074d7){_0x19bda9[_0x7bcc('0x41')]=_0x4074d7;return _0x19bda9;})['then'](respondWithFilteredResult(_0x5d4131,_0x472b73))['catch'](handleError(_0x5d4131,null));};exports[_0x7bcc('0x42')]=function(_0x2f502a,_0x59aa4e){var _0x2adb79={'raw':!![],'where':{'id':_0x2f502a[_0x7bcc('0x43')]['id']}},_0x2d3938={};_0x2d3938[_0x7bcc('0x2e')]=_[_0x7bcc('0x30')](db[_0x7bcc('0x2b')][_0x7bcc('0x44')]);_0x2d3938['query']=_[_0x7bcc('0x30')](_0x2f502a[_0x7bcc('0x2f')]);_0x2d3938[_0x7bcc('0x31')]=_[_0x7bcc('0x32')](_0x2d3938[_0x7bcc('0x2e')],_0x2d3938['query']);_0x2adb79[_0x7bcc('0x33')]=_[_0x7bcc('0x32')](_0x2d3938['model'],qs[_0x7bcc('0x34')](_0x2f502a[_0x7bcc('0x2f')][_0x7bcc('0x34')]));_0x2adb79['attributes']=_0x2adb79[_0x7bcc('0x33')][_0x7bcc('0x35')]?_0x2adb79['attributes']:_0x2d3938[_0x7bcc('0x2e')];if(_0x2f502a[_0x7bcc('0x2f')][_0x7bcc('0x45')]){_0x2adb79[_0x7bcc('0x3f')]=[{'all':!![]}];}_0x2adb79=_[_0x7bcc('0x3d')]({},_0x2adb79,_0x2f502a['options']);return db[_0x7bcc('0x2b')][_0x7bcc('0x46')](_0x2adb79)['then'](handleEntityNotFound(_0x59aa4e,null))[_0x7bcc('0x22')](respondWithResult(_0x59aa4e,null))['catch'](handleError(_0x59aa4e,null));};exports[_0x7bcc('0x47')]=function(_0x5d4654,_0x29cb88){return db['Disposition']['create'](_0x5d4654[_0x7bcc('0x48')],{})[_0x7bcc('0x22')](function(_0x487361){var _0x16e40d=_0x5d4654[_0x7bcc('0x49')][_0x7bcc('0x24')]({'plain':!![]});if(!_0x16e40d)throw new Error(_0x7bcc('0x4a'));if(_0x16e40d[_0x7bcc('0x4b')]===_0x7bcc('0x49')){var _0x2304f0=_0x487361[_0x7bcc('0x24')]({'plain':!![]});var _0x40fde8=_0x7bcc('0x4c');return db[_0x7bcc('0x4d')][_0x7bcc('0x46')]({'where':{'name':_0x40fde8,'userProfileId':_0x16e40d['userProfileId']},'raw':!![]})[_0x7bcc('0x22')](function(_0x370465){if(_0x370465&&_0x370465['autoAssociation']===0x0){return db['UserProfileResource'][_0x7bcc('0x47')]({'name':_0x2304f0[_0x7bcc('0x27')],'resourceId':_0x2304f0['id'],'type':_0x370465['name'],'sectionId':_0x370465['id']},{})['then'](function(){return _0x487361;});}else{return _0x487361;}})['catch'](function(_0x52b09d){logger['error'](_0x7bcc('0x4e'),_0x52b09d);throw _0x52b09d;});}return _0x487361;})[_0x7bcc('0x22')](respondWithResult(_0x29cb88,0xc9))['catch'](handleError(_0x29cb88,null));};exports['update']=function(_0x432d84,_0x392b88){if(_0x432d84[_0x7bcc('0x48')]['id']){delete _0x432d84[_0x7bcc('0x48')]['id'];}return db[_0x7bcc('0x2b')][_0x7bcc('0x46')]({'where':{'id':_0x432d84['params']['id']}})['then'](handleEntityNotFound(_0x392b88,null))[_0x7bcc('0x22')](saveUpdates(_0x432d84[_0x7bcc('0x48')],null))[_0x7bcc('0x22')](respondWithResult(_0x392b88,null))[_0x7bcc('0x4f')](handleError(_0x392b88,null));};exports['destroy']=function(_0x495396,_0x5a0e09){return db[_0x7bcc('0x2b')]['find']({'where':{'id':_0x495396[_0x7bcc('0x43')]['id']}})[_0x7bcc('0x22')](handleEntityNotFound(_0x5a0e09,null))[_0x7bcc('0x22')](removeEntity(_0x5a0e09,null))['catch'](handleError(_0x5a0e09,null));};
\ No newline at end of file