Built motion from commit 06eb8eb0.|2.6.31
[motion2.git] / server / api / disposition / disposition.controller.js
index f6c09fa..0928958 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x741a=['map','Disposition','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','rawAttributes','length','include','create','body','user','role','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','get','Dispositions','UserProfileResource','destroy','stack','name','send','index'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x741a,0x7b));var _0xa741=function(_0x1f1283,_0x1bea3b){_0x1f1283=_0x1f1283-0x0;var _0x205041=_0x741a[_0x1f1283];return _0x205041;};'use strict';var emlformat=require(_0xa741('0x0'));var rimraf=require(_0xa741('0x1'));var zipdir=require(_0xa741('0x2'));var jsonpatch=require(_0xa741('0x3'));var rp=require('request-promise');var moment=require(_0xa741('0x4'));var BPromise=require(_0xa741('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa741('0x6'));var csv=require(_0xa741('0x7'));var ejs=require(_0xa741('0x8'));var fs=require('fs');var fs_extra=require(_0xa741('0x9'));var _=require(_0xa741('0xa'));var squel=require(_0xa741('0xb'));var crypto=require(_0xa741('0xc'));var jsforce=require(_0xa741('0xd'));var deskjs=require(_0xa741('0xe'));var toCsv=require(_0xa741('0x7'));var querystring=require(_0xa741('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa741('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa741('0x11'));var hardwareService=require(_0xa741('0x12'));var logger=require(_0xa741('0x13'))(_0xa741('0x14'));var utils=require(_0xa741('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa741('0x16'));var db=require(_0xa741('0x17'))['db'];function respondWithStatusCode(_0x4c4fea,_0x5b6b73){_0x5b6b73=_0x5b6b73||0xcc;return function(_0x352fac){if(_0x352fac){return _0x4c4fea[_0xa741('0x18')](_0x5b6b73);}return _0x4c4fea['status'](_0x5b6b73)[_0xa741('0x19')]();};}function respondWithResult(_0x521687,_0x1fdfdb){_0x1fdfdb=_0x1fdfdb||0xc8;return function(_0x8c30b2){if(_0x8c30b2){return _0x521687[_0xa741('0x1a')](_0x1fdfdb)[_0xa741('0x1b')](_0x8c30b2);}};}function respondWithFilteredResult(_0xc2802d,_0x4ca719){return function(_0x1aba66){if(_0x1aba66){var _0x4cc6fe=typeof _0x4ca719[_0xa741('0x1c')]===_0xa741('0x1d')&&typeof _0x4ca719[_0xa741('0x1e')]===_0xa741('0x1d');var _0x4c5379=_0x1aba66[_0xa741('0x1f')];var _0x53e035=_0x4cc6fe?0x0:_0x4ca719['offset'];var _0x46ae68=_0x4cc6fe?_0x1aba66[_0xa741('0x1f')]:_0x4ca719[_0xa741('0x1c')]+_0x4ca719['limit'];var _0x160456;if(_0x46ae68>=_0x4c5379){_0x46ae68=_0x4c5379;_0x160456=0xc8;}else{_0x160456=0xce;}_0xc2802d[_0xa741('0x1a')](_0x160456);return _0xc2802d[_0xa741('0x20')](_0xa741('0x21'),_0x53e035+'-'+_0x46ae68+'/'+_0x4c5379)[_0xa741('0x1b')](_0x1aba66);}return null;};}function patchUpdates(_0x57a7d5){return function(_0x36439d){try{jsonpatch['apply'](_0x36439d,_0x57a7d5,!![]);}catch(_0x3224da){return BPromise[_0xa741('0x22')](_0x3224da);}return _0x36439d['save']();};}function saveUpdates(_0x1f9b33,_0x2710ba){return function(_0x1d8315){if(_0x1d8315){return _0x1d8315[_0xa741('0x23')](_0x1f9b33)[_0xa741('0x24')](function(_0x185f65){return _0x185f65;});}return null;};}function removeEntity(_0xc755d,_0x1b7b55){return function(_0x2c90cc){if(_0x2c90cc){return _0x2c90cc['destroy']()[_0xa741('0x24')](function(){var _0xf1f20b=_0x2c90cc[_0xa741('0x25')]({'plain':!![]});var _0x123ef0=_0xa741('0x26');return db[_0xa741('0x27')][_0xa741('0x28')]({'where':{'type':_0x123ef0,'resourceId':_0xf1f20b['id']}})[_0xa741('0x24')](function(){return _0x2c90cc;});})[_0xa741('0x24')](function(){_0xc755d[_0xa741('0x1a')](0xcc)[_0xa741('0x19')]();});}};}function handleEntityNotFound(_0x42a65c,_0x930efd){return function(_0x15829b){if(!_0x15829b){_0x42a65c[_0xa741('0x18')](0x194);}return _0x15829b;};}function handleError(_0x14ee3d,_0x1b59df){_0x1b59df=_0x1b59df||0x1f4;return function(_0x5f0184){logger['error'](_0x5f0184[_0xa741('0x29')]);if(_0x5f0184['name']){delete _0x5f0184[_0xa741('0x2a')];}_0x14ee3d[_0xa741('0x1a')](_0x1b59df)[_0xa741('0x2b')](_0x5f0184);};}exports[_0xa741('0x2c')]=function(_0x18f436,_0xf3a1a9){var _0x3cb3d7={},_0x139460={},_0x421d35={'count':0x0,'rows':[]};var _0x27721e=_[_0xa741('0x2d')](db[_0xa741('0x2e')]['rawAttributes'],function(_0x41d3a4){return{'name':_0x41d3a4[_0xa741('0x2f')],'type':_0x41d3a4[_0xa741('0x30')][_0xa741('0x31')]};});_0x139460[_0xa741('0x32')]=_[_0xa741('0x2d')](_0x27721e,_0xa741('0x2a'));_0x139460['query']=_[_0xa741('0x33')](_0x18f436[_0xa741('0x34')]);_0x139460[_0xa741('0x35')]=_[_0xa741('0x36')](_0x139460[_0xa741('0x32')],_0x139460[_0xa741('0x34')]);_0x3cb3d7[_0xa741('0x37')]=_['intersection'](_0x139460[_0xa741('0x32')],qs[_0xa741('0x38')](_0x18f436['query'][_0xa741('0x38')]));_0x3cb3d7[_0xa741('0x37')]=_0x3cb3d7[_0xa741('0x37')]['length']?_0x3cb3d7[_0xa741('0x37')]:_0x139460['model'];if(!_0x18f436[_0xa741('0x34')][_0xa741('0x39')](_0xa741('0x3a'))){_0x3cb3d7[_0xa741('0x1e')]=qs[_0xa741('0x1e')](_0x18f436[_0xa741('0x34')]['limit']);_0x3cb3d7['offset']=qs[_0xa741('0x1c')](_0x18f436[_0xa741('0x34')][_0xa741('0x1c')]);}_0x3cb3d7[_0xa741('0x3b')]=qs['sort'](_0x18f436[_0xa741('0x34')][_0xa741('0x3c')]);_0x3cb3d7[_0xa741('0x3d')]=qs[_0xa741('0x35')](_[_0xa741('0x3e')](_0x18f436['query'],_0x139460[_0xa741('0x35')]),_0x27721e);if(_0x18f436['query'][_0xa741('0x3f')]){_0x3cb3d7[_0xa741('0x3d')]=_[_0xa741('0x40')](_0x3cb3d7[_0xa741('0x3d')],{'$or':_[_0xa741('0x2d')](_0x27721e,function(_0xbd93da){if(_0xbd93da['type']!==_0xa741('0x41')){var _0x5307dc={};_0x5307dc[_0xbd93da[_0xa741('0x2a')]]={'$like':'%'+_0x18f436[_0xa741('0x34')][_0xa741('0x3f')]+'%'};return _0x5307dc;}})});}_0x3cb3d7=_[_0xa741('0x40')]({},_0x3cb3d7,_0x18f436[_0xa741('0x42')]);var _0x4b2527={'where':_0x3cb3d7[_0xa741('0x3d')]};return db[_0xa741('0x2e')][_0xa741('0x1f')](_0x4b2527)[_0xa741('0x24')](function(_0x3f2393){_0x421d35[_0xa741('0x1f')]=_0x3f2393;if(_0x18f436[_0xa741('0x34')][_0xa741('0x43')]){_0x3cb3d7['include']=[{'all':!![]}];}return db[_0xa741('0x2e')]['findAll'](_0x3cb3d7);})[_0xa741('0x24')](function(_0x3c4b17){_0x421d35[_0xa741('0x44')]=_0x3c4b17;return _0x421d35;})[_0xa741('0x24')](respondWithFilteredResult(_0xf3a1a9,_0x3cb3d7))[_0xa741('0x45')](handleError(_0xf3a1a9,null));};exports[_0xa741('0x46')]=function(_0x3be627,_0x2d6fad){var _0x14fe95={'raw':!![],'where':{'id':_0x3be627[_0xa741('0x47')]['id']}},_0xc38236={};_0xc38236[_0xa741('0x32')]=_[_0xa741('0x33')](db[_0xa741('0x2e')][_0xa741('0x48')]);_0xc38236[_0xa741('0x34')]=_[_0xa741('0x33')](_0x3be627['query']);_0xc38236['filters']=_[_0xa741('0x36')](_0xc38236[_0xa741('0x32')],_0xc38236[_0xa741('0x34')]);_0x14fe95[_0xa741('0x37')]=_[_0xa741('0x36')](_0xc38236[_0xa741('0x32')],qs[_0xa741('0x38')](_0x3be627[_0xa741('0x34')]['fields']));_0x14fe95['attributes']=_0x14fe95['attributes'][_0xa741('0x49')]?_0x14fe95[_0xa741('0x37')]:_0xc38236['model'];if(_0x3be627[_0xa741('0x34')][_0xa741('0x43')]){_0x14fe95[_0xa741('0x4a')]=[{'all':!![]}];}_0x14fe95=_[_0xa741('0x40')]({},_0x14fe95,_0x3be627[_0xa741('0x42')]);return db[_0xa741('0x2e')]['find'](_0x14fe95)[_0xa741('0x24')](handleEntityNotFound(_0x2d6fad,null))[_0xa741('0x24')](respondWithResult(_0x2d6fad,null))[_0xa741('0x45')](handleError(_0x2d6fad,null));};exports[_0xa741('0x4b')]=function(_0x36545d,_0x29741f){return db[_0xa741('0x2e')][_0xa741('0x4b')](_0x36545d[_0xa741('0x4c')],{})[_0xa741('0x24')](function(_0xbe14df){var _0x27d95a=_0x36545d[_0xa741('0x4d')][_0xa741('0x25')]({'plain':!![]});if(!_0x27d95a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x27d95a[_0xa741('0x4e')]==='user'){var _0x4ca868=_0xbe14df['get']({'plain':!![]});var _0x3649b5=_0xa741('0x26');return db['UserProfileSection'][_0xa741('0x4f')]({'where':{'name':_0x3649b5,'userProfileId':_0x27d95a[_0xa741('0x50')]},'raw':!![]})['then'](function(_0x4db7bf){if(_0x4db7bf&&_0x4db7bf[_0xa741('0x51')]===0x0){return db[_0xa741('0x27')][_0xa741('0x4b')]({'name':_0x4ca868[_0xa741('0x2a')],'resourceId':_0x4ca868['id'],'type':_0x4db7bf[_0xa741('0x2a')],'sectionId':_0x4db7bf['id']},{})[_0xa741('0x24')](function(){return _0xbe14df;});}else{return _0xbe14df;}})[_0xa741('0x45')](function(_0x2e7bb2){logger[_0xa741('0x52')](_0xa741('0x53'),_0x2e7bb2);throw _0x2e7bb2;});}return _0xbe14df;})[_0xa741('0x24')](respondWithResult(_0x29741f,0xc9))[_0xa741('0x45')](handleError(_0x29741f,null));};exports[_0xa741('0x23')]=function(_0x507075,_0x191319){if(_0x507075[_0xa741('0x4c')]['id']){delete _0x507075[_0xa741('0x4c')]['id'];}return db['Disposition'][_0xa741('0x4f')]({'where':{'id':_0x507075[_0xa741('0x47')]['id']}})[_0xa741('0x24')](handleEntityNotFound(_0x191319,null))[_0xa741('0x24')](saveUpdates(_0x507075[_0xa741('0x4c')],null))['then'](respondWithResult(_0x191319,null))['catch'](handleError(_0x191319,null));};exports[_0xa741('0x28')]=function(_0x407da1,_0x4277ad){return db[_0xa741('0x2e')]['find']({'where':{'id':_0x407da1['params']['id']}})[_0xa741('0x24')](handleEntityNotFound(_0x4277ad,null))[_0xa741('0x24')](removeEntity(_0x4277ad,null))[_0xa741('0x45')](handleError(_0x4277ad,null));};
\ No newline at end of file
+var _0x92f4=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','UserProfileResource','end','error','name','index','map','Disposition','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','catch','params','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x423f5b,_0x14717b){var _0x12ddc5=function(_0x5d0ed9){while(--_0x5d0ed9){_0x423f5b['push'](_0x423f5b['shift']());}};_0x12ddc5(++_0x14717b);}(_0x92f4,0x10f));var _0x492f=function(_0x1e744a,_0xa8fdb1){_0x1e744a=_0x1e744a-0x0;var _0x1ac4d0=_0x92f4[_0x1e744a];return _0x1ac4d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x492f('0x0'));var zipdir=require(_0x492f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x492f('0x2'));var moment=require(_0x492f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x492f('0x4'));var util=require('util');var path=require(_0x492f('0x5'));var sox=require(_0x492f('0x6'));var csv=require(_0x492f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x492f('0x8'));var squel=require(_0x492f('0x9'));var crypto=require(_0x492f('0xa'));var jsforce=require(_0x492f('0xb'));var deskjs=require(_0x492f('0xc'));var toCsv=require(_0x492f('0x7'));var querystring=require(_0x492f('0xd'));var Papa=require(_0x492f('0xe'));var Redis=require('ioredis');var authService=require(_0x492f('0xf'));var qs=require(_0x492f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x492f('0x11'))(_0x492f('0x12'));var utils=require('../../config/utils');var config=require(_0x492f('0x13'));var licenseUtil=require(_0x492f('0x14'));var db=require(_0x492f('0x15'))['db'];function respondWithStatusCode(_0x3ef643,_0x40390d){_0x40390d=_0x40390d||0xcc;return function(_0x17f9a5){if(_0x17f9a5){return _0x3ef643[_0x492f('0x16')](_0x40390d);}return _0x3ef643[_0x492f('0x17')](_0x40390d)['end']();};}function respondWithResult(_0x5beeac,_0x183521){_0x183521=_0x183521||0xc8;return function(_0x5464db){if(_0x5464db){return _0x5beeac[_0x492f('0x17')](_0x183521)['json'](_0x5464db);}};}function respondWithFilteredResult(_0x2e4981,_0x5c13b9){return function(_0x11edc7){if(_0x11edc7){var _0xa52f71=typeof _0x5c13b9[_0x492f('0x18')]===_0x492f('0x19')&&typeof _0x5c13b9[_0x492f('0x1a')]===_0x492f('0x19');var _0x2a067e=_0x11edc7[_0x492f('0x1b')];var _0x185457=_0xa52f71?0x0:_0x5c13b9[_0x492f('0x18')];var _0x19804d=_0xa52f71?_0x11edc7[_0x492f('0x1b')]:_0x5c13b9[_0x492f('0x18')]+_0x5c13b9[_0x492f('0x1a')];var _0x21b8fa;if(_0x19804d>=_0x2a067e){_0x19804d=_0x2a067e;_0x21b8fa=0xc8;}else{_0x21b8fa=0xce;}_0x2e4981[_0x492f('0x17')](_0x21b8fa);return _0x2e4981[_0x492f('0x1c')](_0x492f('0x1d'),_0x185457+'-'+_0x19804d+'/'+_0x2a067e)[_0x492f('0x1e')](_0x11edc7);}return null;};}function patchUpdates(_0x1cc6cf){return function(_0x1e78b4){try{jsonpatch[_0x492f('0x1f')](_0x1e78b4,_0x1cc6cf,!![]);}catch(_0x214367){return BPromise[_0x492f('0x20')](_0x214367);}return _0x1e78b4['save']();};}function saveUpdates(_0xdd5579,_0x3f505e){return function(_0x1a1b87){if(_0x1a1b87){return _0x1a1b87[_0x492f('0x21')](_0xdd5579)[_0x492f('0x22')](function(_0xfb5c6e){return _0xfb5c6e;});}return null;};}function removeEntity(_0x467a00,_0x3d7f80){return function(_0x19fbf3){if(_0x19fbf3){return _0x19fbf3[_0x492f('0x23')]()[_0x492f('0x22')](function(){var _0x181763=_0x19fbf3[_0x492f('0x24')]({'plain':!![]});var _0x42af7a='Dispositions';return db[_0x492f('0x25')]['destroy']({'where':{'type':_0x42af7a,'resourceId':_0x181763['id']}})[_0x492f('0x22')](function(){return _0x19fbf3;});})['then'](function(){_0x467a00[_0x492f('0x17')](0xcc)[_0x492f('0x26')]();});}};}function handleEntityNotFound(_0x2a4f07,_0x2dcef5){return function(_0x1539fa){if(!_0x1539fa){_0x2a4f07['sendStatus'](0x194);}return _0x1539fa;};}function handleError(_0xc51d6d,_0x3b0abb){_0x3b0abb=_0x3b0abb||0x1f4;return function(_0x269842){logger[_0x492f('0x27')](_0x269842['stack']);if(_0x269842[_0x492f('0x28')]){delete _0x269842[_0x492f('0x28')];}_0xc51d6d['status'](_0x3b0abb)['send'](_0x269842);};}exports[_0x492f('0x29')]=function(_0x53856c,_0x5bd1bc){var _0x2ec2be={},_0x66f0a0={},_0x58872a={'count':0x0,'rows':[]};var _0x199753=_[_0x492f('0x2a')](db[_0x492f('0x2b')][_0x492f('0x2c')],function(_0xba5bb2){return{'name':_0xba5bb2['fieldName'],'type':_0xba5bb2[_0x492f('0x2d')]['key']};});_0x66f0a0[_0x492f('0x2e')]=_[_0x492f('0x2a')](_0x199753,_0x492f('0x28'));_0x66f0a0[_0x492f('0x2f')]=_[_0x492f('0x30')](_0x53856c[_0x492f('0x2f')]);_0x66f0a0[_0x492f('0x31')]=_[_0x492f('0x32')](_0x66f0a0[_0x492f('0x2e')],_0x66f0a0[_0x492f('0x2f')]);_0x2ec2be[_0x492f('0x33')]=_[_0x492f('0x32')](_0x66f0a0['model'],qs[_0x492f('0x34')](_0x53856c['query'][_0x492f('0x34')]));_0x2ec2be[_0x492f('0x33')]=_0x2ec2be['attributes']['length']?_0x2ec2be[_0x492f('0x33')]:_0x66f0a0[_0x492f('0x2e')];if(!_0x53856c['query'][_0x492f('0x35')](_0x492f('0x36'))){_0x2ec2be[_0x492f('0x1a')]=qs['limit'](_0x53856c[_0x492f('0x2f')][_0x492f('0x1a')]);_0x2ec2be[_0x492f('0x18')]=qs['offset'](_0x53856c[_0x492f('0x2f')][_0x492f('0x18')]);}_0x2ec2be['order']=qs[_0x492f('0x37')](_0x53856c['query'][_0x492f('0x37')]);_0x2ec2be[_0x492f('0x38')]=qs['filters'](_[_0x492f('0x39')](_0x53856c[_0x492f('0x2f')],_0x66f0a0[_0x492f('0x31')]),_0x199753);if(_0x53856c[_0x492f('0x2f')][_0x492f('0x3a')]){_0x2ec2be[_0x492f('0x38')]=_[_0x492f('0x3b')](_0x2ec2be[_0x492f('0x38')],{'$or':_[_0x492f('0x2a')](_0x199753,function(_0x5989ab){if(_0x5989ab[_0x492f('0x2d')]!=='VIRTUAL'){var _0x3e0bab={};_0x3e0bab[_0x5989ab[_0x492f('0x28')]]={'$like':'%'+_0x53856c[_0x492f('0x2f')][_0x492f('0x3a')]+'%'};return _0x3e0bab;}})});}_0x2ec2be=_[_0x492f('0x3b')]({},_0x2ec2be,_0x53856c[_0x492f('0x3c')]);var _0x86dc9e={'where':_0x2ec2be['where']};return db[_0x492f('0x2b')]['count'](_0x86dc9e)[_0x492f('0x22')](function(_0x4632d3){_0x58872a['count']=_0x4632d3;if(_0x53856c[_0x492f('0x2f')]['includeAll']){_0x2ec2be['include']=[{'all':!![]}];}return db[_0x492f('0x2b')]['findAll'](_0x2ec2be);})[_0x492f('0x22')](function(_0x5d8418){_0x58872a['rows']=_0x5d8418;return _0x58872a;})['then'](respondWithFilteredResult(_0x5bd1bc,_0x2ec2be))['catch'](handleError(_0x5bd1bc,null));};exports['show']=function(_0x54e597,_0xdf8c7b){var _0xc030ea={'raw':!![],'where':{'id':_0x54e597['params']['id']}},_0x4acdd2={};_0x4acdd2[_0x492f('0x2e')]=_[_0x492f('0x30')](db[_0x492f('0x2b')][_0x492f('0x2c')]);_0x4acdd2[_0x492f('0x2f')]=_[_0x492f('0x30')](_0x54e597[_0x492f('0x2f')]);_0x4acdd2[_0x492f('0x31')]=_[_0x492f('0x32')](_0x4acdd2['model'],_0x4acdd2[_0x492f('0x2f')]);_0xc030ea[_0x492f('0x33')]=_[_0x492f('0x32')](_0x4acdd2['model'],qs[_0x492f('0x34')](_0x54e597['query']['fields']));_0xc030ea[_0x492f('0x33')]=_0xc030ea[_0x492f('0x33')]['length']?_0xc030ea[_0x492f('0x33')]:_0x4acdd2[_0x492f('0x2e')];if(_0x54e597[_0x492f('0x2f')][_0x492f('0x3d')]){_0xc030ea[_0x492f('0x3e')]=[{'all':!![]}];}_0xc030ea=_['merge']({},_0xc030ea,_0x54e597['options']);return db['Disposition'][_0x492f('0x3f')](_0xc030ea)['then'](handleEntityNotFound(_0xdf8c7b,null))[_0x492f('0x22')](respondWithResult(_0xdf8c7b,null))['catch'](handleError(_0xdf8c7b,null));};exports['create']=function(_0x5a90ad,_0x1bb9ed){return db[_0x492f('0x2b')][_0x492f('0x40')](_0x5a90ad[_0x492f('0x41')],{})[_0x492f('0x22')](function(_0x45ffaa){var _0x119a3c=_0x5a90ad[_0x492f('0x42')][_0x492f('0x24')]({'plain':!![]});if(!_0x119a3c)throw new Error(_0x492f('0x43'));if(_0x119a3c[_0x492f('0x44')]==='user'){var _0x571b28=_0x45ffaa[_0x492f('0x24')]({'plain':!![]});var _0x428d4e='Dispositions';return db['UserProfileSection'][_0x492f('0x3f')]({'where':{'name':_0x428d4e,'userProfileId':_0x119a3c[_0x492f('0x45')]},'raw':!![]})[_0x492f('0x22')](function(_0x3e073d){if(_0x3e073d&&_0x3e073d['autoAssociation']===0x0){return db[_0x492f('0x25')][_0x492f('0x40')]({'name':_0x571b28[_0x492f('0x28')],'resourceId':_0x571b28['id'],'type':_0x3e073d[_0x492f('0x28')],'sectionId':_0x3e073d['id']},{})[_0x492f('0x22')](function(){return _0x45ffaa;});}else{return _0x45ffaa;}})[_0x492f('0x46')](function(_0x373c9e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x373c9e);throw _0x373c9e;});}return _0x45ffaa;})[_0x492f('0x22')](respondWithResult(_0x1bb9ed,0xc9))['catch'](handleError(_0x1bb9ed,null));};exports[_0x492f('0x21')]=function(_0x23e863,_0xdd38b2){if(_0x23e863[_0x492f('0x41')]['id']){delete _0x23e863[_0x492f('0x41')]['id'];}return db[_0x492f('0x2b')][_0x492f('0x3f')]({'where':{'id':_0x23e863[_0x492f('0x47')]['id']}})['then'](handleEntityNotFound(_0xdd38b2,null))[_0x492f('0x22')](saveUpdates(_0x23e863[_0x492f('0x41')],null))[_0x492f('0x22')](respondWithResult(_0xdd38b2,null))[_0x492f('0x46')](handleError(_0xdd38b2,null));};exports[_0x492f('0x23')]=function(_0x1c39f0,_0x4613c9){return db[_0x492f('0x2b')][_0x492f('0x3f')]({'where':{'id':_0x1c39f0[_0x492f('0x47')]['id']}})[_0x492f('0x22')](handleEntityNotFound(_0x4613c9,null))[_0x492f('0x22')](removeEntity(_0x4613c9,null))[_0x492f('0x46')](handleError(_0x4613c9,null));};
\ No newline at end of file