Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / api / disposition / disposition.controller.js
index 4ac739a..b4e0e46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x448a=['include','findAll','catch','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','Dispositions','UserProfileResource','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','includeAll'];(function(_0x390ba7,_0x445eea){var _0xb1dc2f=function(_0xc29788){while(--_0xc29788){_0x390ba7['push'](_0x390ba7['shift']());}};_0xb1dc2f(++_0x445eea);}(_0x448a,0x1ef));var _0xa448=function(_0x2b7533,_0x194c99){_0x2b7533=_0x2b7533-0x0;var _0x28b3ad=_0x448a[_0x2b7533];return _0x28b3ad;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa448('0x0'));var zipdir=require(_0xa448('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa448('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa448('0x3'));var util=require(_0xa448('0x4'));var path=require('path');var sox=require(_0xa448('0x5'));var csv=require(_0xa448('0x6'));var ejs=require(_0xa448('0x7'));var fs=require('fs');var fs_extra=require(_0xa448('0x8'));var _=require(_0xa448('0x9'));var squel=require(_0xa448('0xa'));var crypto=require(_0xa448('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa448('0x6'));var querystring=require(_0xa448('0xc'));var Papa=require(_0xa448('0xd'));var Redis=require(_0xa448('0xe'));var authService=require(_0xa448('0xf'));var qs=require(_0xa448('0x10'));var as=require(_0xa448('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa448('0x12'));var utils=require(_0xa448('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa448('0x14'));var db=require(_0xa448('0x15'))['db'];function respondWithStatusCode(_0x31a87f,_0x18b707){_0x18b707=_0x18b707||0xcc;return function(_0x6a4be9){if(_0x6a4be9){return _0x31a87f[_0xa448('0x16')](_0x18b707);}return _0x31a87f[_0xa448('0x17')](_0x18b707)[_0xa448('0x18')]();};}function respondWithResult(_0x2d41b6,_0x5da954){_0x5da954=_0x5da954||0xc8;return function(_0x5d90aa){if(_0x5d90aa){return _0x2d41b6[_0xa448('0x17')](_0x5da954)[_0xa448('0x19')](_0x5d90aa);}};}function respondWithFilteredResult(_0x13eb88,_0x1fb799){return function(_0x335a28){if(_0x335a28){var _0x398cff=typeof _0x1fb799['offset']==='undefined'&&typeof _0x1fb799['limit']==='undefined';var _0x1ee422=_0x335a28[_0xa448('0x1a')];var _0x5d76c2=_0x398cff?0x0:_0x1fb799[_0xa448('0x1b')];var _0x3a5f44=_0x398cff?_0x335a28[_0xa448('0x1a')]:_0x1fb799[_0xa448('0x1b')]+_0x1fb799[_0xa448('0x1c')];var _0x579b77;if(_0x3a5f44>=_0x1ee422){_0x3a5f44=_0x1ee422;_0x579b77=0xc8;}else{_0x579b77=0xce;}_0x13eb88[_0xa448('0x17')](_0x579b77);return _0x13eb88[_0xa448('0x1d')](_0xa448('0x1e'),_0x5d76c2+'-'+_0x3a5f44+'/'+_0x1ee422)[_0xa448('0x19')](_0x335a28);}return null;};}function patchUpdates(_0x1b6370){return function(_0x5a3f87){try{jsonpatch[_0xa448('0x1f')](_0x5a3f87,_0x1b6370,!![]);}catch(_0x1060f1){return BPromise[_0xa448('0x20')](_0x1060f1);}return _0x5a3f87[_0xa448('0x21')]();};}function saveUpdates(_0x22c415,_0x1a7dd4){return function(_0x2afa93){if(_0x2afa93){return _0x2afa93[_0xa448('0x22')](_0x22c415)[_0xa448('0x23')](function(_0x18ae39){return _0x18ae39;});}return null;};}function removeEntity(_0x405edd,_0x4aee1e){return function(_0x347f87){if(_0x347f87){return _0x347f87[_0xa448('0x24')]()[_0xa448('0x23')](function(){var _0x1c919c=_0x347f87['get']({'plain':!![]});var _0x2ccc29=_0xa448('0x25');return db[_0xa448('0x26')][_0xa448('0x24')]({'where':{'type':_0x2ccc29,'resourceId':_0x1c919c['id']}})['then'](function(){return _0x347f87;});})[_0xa448('0x23')](function(){_0x405edd['status'](0xcc)[_0xa448('0x18')]();});}};}function handleEntityNotFound(_0x3e6679,_0x2aee99){return function(_0x1f045c){if(!_0x1f045c){_0x3e6679[_0xa448('0x16')](0x194);}return _0x1f045c;};}function handleError(_0x50cfb1,_0x18e6a5){_0x18e6a5=_0x18e6a5||0x1f4;return function(_0x1d1c43){logger[_0xa448('0x27')](_0x1d1c43[_0xa448('0x28')]);if(_0x1d1c43[_0xa448('0x29')]){delete _0x1d1c43[_0xa448('0x29')];}_0x50cfb1[_0xa448('0x17')](_0x18e6a5)[_0xa448('0x2a')](_0x1d1c43);};}exports[_0xa448('0x2b')]=function(_0x424695,_0x32bfa4){var _0x2c84c4={},_0xe0461c={},_0x7a2715={'count':0x0,'rows':[]};var _0x597a99=_[_0xa448('0x2c')](db[_0xa448('0x2d')][_0xa448('0x2e')],function(_0x2136b5){return{'name':_0x2136b5[_0xa448('0x2f')],'type':_0x2136b5[_0xa448('0x30')][_0xa448('0x31')]};});_0xe0461c['model']=_[_0xa448('0x2c')](_0x597a99,'name');_0xe0461c['query']=_[_0xa448('0x32')](_0x424695[_0xa448('0x33')]);_0xe0461c[_0xa448('0x34')]=_[_0xa448('0x35')](_0xe0461c[_0xa448('0x36')],_0xe0461c['query']);_0x2c84c4['attributes']=_[_0xa448('0x35')](_0xe0461c[_0xa448('0x36')],qs[_0xa448('0x37')](_0x424695['query'][_0xa448('0x37')]));_0x2c84c4[_0xa448('0x38')]=_0x2c84c4['attributes'][_0xa448('0x39')]?_0x2c84c4[_0xa448('0x38')]:_0xe0461c[_0xa448('0x36')];if(!_0x424695[_0xa448('0x33')][_0xa448('0x3a')]('nolimit')){_0x2c84c4[_0xa448('0x1c')]=qs[_0xa448('0x1c')](_0x424695[_0xa448('0x33')][_0xa448('0x1c')]);_0x2c84c4['offset']=qs[_0xa448('0x1b')](_0x424695[_0xa448('0x33')][_0xa448('0x1b')]);}_0x2c84c4[_0xa448('0x3b')]=qs[_0xa448('0x3c')](_0x424695['query'][_0xa448('0x3c')]);_0x2c84c4[_0xa448('0x3d')]=qs[_0xa448('0x34')](_[_0xa448('0x3e')](_0x424695[_0xa448('0x33')],_0xe0461c[_0xa448('0x34')]),_0x597a99);if(_0x424695[_0xa448('0x33')]['filter']){_0x2c84c4[_0xa448('0x3d')]=_['merge'](_0x2c84c4['where'],{'$or':_[_0xa448('0x2c')](_0x597a99,function(_0x2030cb){if(_0x2030cb[_0xa448('0x30')]!=='VIRTUAL'){var _0x3f52d1={};_0x3f52d1[_0x2030cb[_0xa448('0x29')]]={'$like':'%'+_0x424695[_0xa448('0x33')][_0xa448('0x3f')]+'%'};return _0x3f52d1;}})});}_0x2c84c4=_['merge']({},_0x2c84c4,_0x424695['options']);var _0x1ac13a={'where':_0x2c84c4['where']};return db[_0xa448('0x2d')][_0xa448('0x1a')](_0x1ac13a)[_0xa448('0x23')](function(_0x4ee7cc){_0x7a2715[_0xa448('0x1a')]=_0x4ee7cc;if(_0x424695[_0xa448('0x33')][_0xa448('0x40')]){_0x2c84c4[_0xa448('0x41')]=[{'all':!![]}];}return db[_0xa448('0x2d')][_0xa448('0x42')](_0x2c84c4);})[_0xa448('0x23')](function(_0x47c3cd){_0x7a2715['rows']=_0x47c3cd;return _0x7a2715;})[_0xa448('0x23')](respondWithFilteredResult(_0x32bfa4,_0x2c84c4))[_0xa448('0x43')](handleError(_0x32bfa4,null));};exports['show']=function(_0x23b81f,_0x2d4a12){var _0x34a27d={'raw':!![],'where':{'id':_0x23b81f[_0xa448('0x44')]['id']}},_0x382a07={};_0x382a07[_0xa448('0x36')]=_[_0xa448('0x32')](db[_0xa448('0x2d')][_0xa448('0x2e')]);_0x382a07['query']=_['keys'](_0x23b81f['query']);_0x382a07[_0xa448('0x34')]=_[_0xa448('0x35')](_0x382a07[_0xa448('0x36')],_0x382a07[_0xa448('0x33')]);_0x34a27d['attributes']=_[_0xa448('0x35')](_0x382a07['model'],qs['fields'](_0x23b81f[_0xa448('0x33')][_0xa448('0x37')]));_0x34a27d['attributes']=_0x34a27d['attributes']['length']?_0x34a27d['attributes']:_0x382a07['model'];if(_0x23b81f[_0xa448('0x33')][_0xa448('0x40')]){_0x34a27d[_0xa448('0x41')]=[{'all':!![]}];}_0x34a27d=_['merge']({},_0x34a27d,_0x23b81f[_0xa448('0x45')]);return db[_0xa448('0x2d')][_0xa448('0x46')](_0x34a27d)[_0xa448('0x23')](handleEntityNotFound(_0x2d4a12,null))[_0xa448('0x23')](respondWithResult(_0x2d4a12,null))['catch'](handleError(_0x2d4a12,null));};exports[_0xa448('0x47')]=function(_0x2cb8fa,_0x4ad20b){return db['Disposition'][_0xa448('0x47')](_0x2cb8fa[_0xa448('0x48')],{})[_0xa448('0x23')](function(_0x345222){var _0x5c00ed=_0x2cb8fa[_0xa448('0x49')][_0xa448('0x4a')]({'plain':!![]});if(!_0x5c00ed)throw new Error(_0xa448('0x4b'));if(_0x5c00ed[_0xa448('0x4c')]==='user'){var _0x783542=_0x345222[_0xa448('0x4a')]({'plain':!![]});var _0x43816e=_0xa448('0x25');return db[_0xa448('0x4d')]['find']({'where':{'name':_0x43816e,'userProfileId':_0x5c00ed[_0xa448('0x4e')]},'raw':!![]})[_0xa448('0x23')](function(_0x48ff91){if(_0x48ff91&&_0x48ff91['autoAssociation']===0x0){return db[_0xa448('0x26')][_0xa448('0x47')]({'name':_0x783542[_0xa448('0x29')],'resourceId':_0x783542['id'],'type':_0x48ff91[_0xa448('0x29')],'sectionId':_0x48ff91['id']},{})[_0xa448('0x23')](function(){return _0x345222;});}else{return _0x345222;}})[_0xa448('0x43')](function(_0x512f66){logger[_0xa448('0x27')](_0xa448('0x4f'),_0x512f66);throw _0x512f66;});}return _0x345222;})[_0xa448('0x23')](respondWithResult(_0x4ad20b,0xc9))[_0xa448('0x43')](handleError(_0x4ad20b,null));};exports[_0xa448('0x22')]=function(_0x543a60,_0x41ee41){if(_0x543a60[_0xa448('0x48')]['id']){delete _0x543a60['body']['id'];}return db['Disposition']['find']({'where':{'id':_0x543a60[_0xa448('0x44')]['id']}})[_0xa448('0x23')](handleEntityNotFound(_0x41ee41,null))[_0xa448('0x23')](saveUpdates(_0x543a60[_0xa448('0x48')],null))[_0xa448('0x23')](respondWithResult(_0x41ee41,null))['catch'](handleError(_0x41ee41,null));};exports['destroy']=function(_0x2563cf,_0x19c3f5){return db['Disposition'][_0xa448('0x46')]({'where':{'id':_0x2563cf[_0xa448('0x44')]['id']}})[_0xa448('0x23')](handleEntityNotFound(_0x19c3f5,null))[_0xa448('0x23')](removeEntity(_0x19c3f5,null))[_0xa448('0x43')](handleError(_0x19c3f5,null));};
\ No newline at end of file
+var _0xce1a=['Disposition','rawAttributes','fieldName','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','create','body','user','get','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','Dispositions','UserProfileResource','end','error','stack','send','index','map'];(function(_0x207811,_0x3420a6){var _0x170d56=function(_0x4340b7){while(--_0x4340b7){_0x207811['push'](_0x207811['shift']());}};_0x170d56(++_0x3420a6);}(_0xce1a,0xbf));var _0xace1=function(_0x12b73b,_0x1c8786){_0x12b73b=_0x12b73b-0x0;var _0x1c9cb6=_0xce1a[_0x12b73b];return _0x1c9cb6;};'use strict';var emlformat=require(_0xace1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xace1('0x1'));var moment=require(_0xace1('0x2'));var BPromise=require(_0xace1('0x3'));var Mustache=require(_0xace1('0x4'));var util=require(_0xace1('0x5'));var path=require('path');var sox=require(_0xace1('0x6'));var csv=require('to-csv');var ejs=require(_0xace1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xace1('0x8'));var squel=require(_0xace1('0x9'));var crypto=require(_0xace1('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xace1('0xb'));var querystring=require('querystring');var Papa=require(_0xace1('0xc'));var Redis=require(_0xace1('0xd'));var authService=require(_0xace1('0xe'));var qs=require(_0xace1('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xace1('0x10'));var logger=require(_0xace1('0x11'))('api');var utils=require(_0xace1('0x12'));var config=require(_0xace1('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56d771,_0x2e1d19){_0x2e1d19=_0x2e1d19||0xcc;return function(_0x2f59f3){if(_0x2f59f3){return _0x56d771[_0xace1('0x14')](_0x2e1d19);}return _0x56d771['status'](_0x2e1d19)['end']();};}function respondWithResult(_0x4e8389,_0x319d1a){_0x319d1a=_0x319d1a||0xc8;return function(_0x18d9ce){if(_0x18d9ce){return _0x4e8389[_0xace1('0x15')](_0x319d1a)[_0xace1('0x16')](_0x18d9ce);}};}function respondWithFilteredResult(_0x248193,_0x303080){return function(_0x25114d){if(_0x25114d){var _0x6cc04e=typeof _0x303080['offset']==='undefined'&&typeof _0x303080[_0xace1('0x17')]===_0xace1('0x18');var _0x49cb73=_0x25114d[_0xace1('0x19')];var _0x162a79=_0x6cc04e?0x0:_0x303080[_0xace1('0x1a')];var _0x45541e=_0x6cc04e?_0x25114d[_0xace1('0x19')]:_0x303080['offset']+_0x303080['limit'];var _0x1781aa;if(_0x45541e>=_0x49cb73){_0x45541e=_0x49cb73;_0x1781aa=0xc8;}else{_0x1781aa=0xce;}_0x248193['status'](_0x1781aa);return _0x248193[_0xace1('0x1b')](_0xace1('0x1c'),_0x162a79+'-'+_0x45541e+'/'+_0x49cb73)[_0xace1('0x16')](_0x25114d);}return null;};}function patchUpdates(_0x4fe2ba){return function(_0x183941){try{jsonpatch[_0xace1('0x1d')](_0x183941,_0x4fe2ba,!![]);}catch(_0x4fce58){return BPromise[_0xace1('0x1e')](_0x4fce58);}return _0x183941[_0xace1('0x1f')]();};}function saveUpdates(_0xe0bda8,_0x41ab2b){return function(_0x484ac1){if(_0x484ac1){return _0x484ac1[_0xace1('0x20')](_0xe0bda8)[_0xace1('0x21')](function(_0x15f2fb){return _0x15f2fb;});}return null;};}function removeEntity(_0x324b52,_0x120c33){return function(_0x9ff8a0){if(_0x9ff8a0){return _0x9ff8a0[_0xace1('0x22')]()[_0xace1('0x21')](function(){var _0x20706f=_0x9ff8a0['get']({'plain':!![]});var _0x5e99f5=_0xace1('0x23');return db[_0xace1('0x24')][_0xace1('0x22')]({'where':{'type':_0x5e99f5,'resourceId':_0x20706f['id']}})['then'](function(){return _0x9ff8a0;});})[_0xace1('0x21')](function(){_0x324b52['status'](0xcc)[_0xace1('0x25')]();});}};}function handleEntityNotFound(_0x13c596,_0x1d356b){return function(_0x15ca0d){if(!_0x15ca0d){_0x13c596['sendStatus'](0x194);}return _0x15ca0d;};}function handleError(_0x4d1889,_0x2794b2){_0x2794b2=_0x2794b2||0x1f4;return function(_0x455286){logger[_0xace1('0x26')](_0x455286[_0xace1('0x27')]);if(_0x455286['name']){delete _0x455286['name'];}_0x4d1889[_0xace1('0x15')](_0x2794b2)[_0xace1('0x28')](_0x455286);};}exports[_0xace1('0x29')]=function(_0x144426,_0x452423){var _0xca9f7d={},_0x356a8e={},_0x9b5560={'count':0x0,'rows':[]};var _0xf78389=_[_0xace1('0x2a')](db[_0xace1('0x2b')][_0xace1('0x2c')],function(_0x135330){return{'name':_0x135330[_0xace1('0x2d')],'type':_0x135330['type']['key']};});_0x356a8e[_0xace1('0x2e')]=_['map'](_0xf78389,_0xace1('0x2f'));_0x356a8e[_0xace1('0x30')]=_[_0xace1('0x31')](_0x144426[_0xace1('0x30')]);_0x356a8e[_0xace1('0x32')]=_[_0xace1('0x33')](_0x356a8e['model'],_0x356a8e[_0xace1('0x30')]);_0xca9f7d[_0xace1('0x34')]=_[_0xace1('0x33')](_0x356a8e['model'],qs['fields'](_0x144426[_0xace1('0x30')][_0xace1('0x35')]));_0xca9f7d[_0xace1('0x34')]=_0xca9f7d[_0xace1('0x34')][_0xace1('0x36')]?_0xca9f7d[_0xace1('0x34')]:_0x356a8e[_0xace1('0x2e')];if(!_0x144426[_0xace1('0x30')][_0xace1('0x37')](_0xace1('0x38'))){_0xca9f7d[_0xace1('0x17')]=qs[_0xace1('0x17')](_0x144426[_0xace1('0x30')]['limit']);_0xca9f7d['offset']=qs['offset'](_0x144426[_0xace1('0x30')][_0xace1('0x1a')]);}_0xca9f7d['order']=qs[_0xace1('0x39')](_0x144426[_0xace1('0x30')][_0xace1('0x39')]);_0xca9f7d[_0xace1('0x3a')]=qs[_0xace1('0x32')](_['pick'](_0x144426['query'],_0x356a8e['filters']),_0xf78389);if(_0x144426[_0xace1('0x30')][_0xace1('0x3b')]){_0xca9f7d[_0xace1('0x3a')]=_[_0xace1('0x3c')](_0xca9f7d['where'],{'$or':_[_0xace1('0x2a')](_0xf78389,function(_0x39a9f3){if(_0x39a9f3[_0xace1('0x3d')]!==_0xace1('0x3e')){var _0x3c6a35={};_0x3c6a35[_0x39a9f3[_0xace1('0x2f')]]={'$like':'%'+_0x144426[_0xace1('0x30')][_0xace1('0x3b')]+'%'};return _0x3c6a35;}})});}_0xca9f7d=_[_0xace1('0x3c')]({},_0xca9f7d,_0x144426[_0xace1('0x3f')]);var _0x2282ad={'where':_0xca9f7d[_0xace1('0x3a')]};return db[_0xace1('0x2b')]['count'](_0x2282ad)[_0xace1('0x21')](function(_0x1fbf83){_0x9b5560[_0xace1('0x19')]=_0x1fbf83;if(_0x144426[_0xace1('0x30')][_0xace1('0x40')]){_0xca9f7d[_0xace1('0x41')]=[{'all':!![]}];}return db[_0xace1('0x2b')][_0xace1('0x42')](_0xca9f7d);})['then'](function(_0xd1f7f4){_0x9b5560['rows']=_0xd1f7f4;return _0x9b5560;})[_0xace1('0x21')](respondWithFilteredResult(_0x452423,_0xca9f7d))[_0xace1('0x43')](handleError(_0x452423,null));};exports['show']=function(_0x5c1efe,_0x5df9f8){var _0x55d3ba={'raw':!![],'where':{'id':_0x5c1efe[_0xace1('0x44')]['id']}},_0x3227bf={};_0x3227bf[_0xace1('0x2e')]=_['keys'](db[_0xace1('0x2b')][_0xace1('0x2c')]);_0x3227bf[_0xace1('0x30')]=_[_0xace1('0x31')](_0x5c1efe[_0xace1('0x30')]);_0x3227bf[_0xace1('0x32')]=_[_0xace1('0x33')](_0x3227bf['model'],_0x3227bf['query']);_0x55d3ba[_0xace1('0x34')]=_[_0xace1('0x33')](_0x3227bf[_0xace1('0x2e')],qs['fields'](_0x5c1efe['query'][_0xace1('0x35')]));_0x55d3ba[_0xace1('0x34')]=_0x55d3ba[_0xace1('0x34')][_0xace1('0x36')]?_0x55d3ba[_0xace1('0x34')]:_0x3227bf[_0xace1('0x2e')];if(_0x5c1efe['query'][_0xace1('0x40')]){_0x55d3ba[_0xace1('0x41')]=[{'all':!![]}];}_0x55d3ba=_[_0xace1('0x3c')]({},_0x55d3ba,_0x5c1efe[_0xace1('0x3f')]);return db[_0xace1('0x2b')]['find'](_0x55d3ba)['then'](handleEntityNotFound(_0x5df9f8,null))[_0xace1('0x21')](respondWithResult(_0x5df9f8,null))[_0xace1('0x43')](handleError(_0x5df9f8,null));};exports[_0xace1('0x45')]=function(_0x101919,_0x5cb72d){return db['Disposition']['create'](_0x101919[_0xace1('0x46')],{})['then'](function(_0x1f9f33){var _0x56a05a=_0x101919[_0xace1('0x47')][_0xace1('0x48')]({'plain':!![]});if(!_0x56a05a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56a05a[_0xace1('0x49')]===_0xace1('0x47')){var _0x477df3=_0x1f9f33['get']({'plain':!![]});var _0x396227=_0xace1('0x23');return db[_0xace1('0x4a')][_0xace1('0x4b')]({'where':{'name':_0x396227,'userProfileId':_0x56a05a['userProfileId']},'raw':!![]})[_0xace1('0x21')](function(_0x37adf8){if(_0x37adf8&&_0x37adf8[_0xace1('0x4c')]===0x0){return db['UserProfileResource'][_0xace1('0x45')]({'name':_0x477df3['name'],'resourceId':_0x477df3['id'],'type':_0x37adf8[_0xace1('0x2f')],'sectionId':_0x37adf8['id']},{})['then'](function(){return _0x1f9f33;});}else{return _0x1f9f33;}})[_0xace1('0x43')](function(_0xfdaeed){logger['error'](_0xace1('0x4d'),_0xfdaeed);throw _0xfdaeed;});}return _0x1f9f33;})['then'](respondWithResult(_0x5cb72d,0xc9))['catch'](handleError(_0x5cb72d,null));};exports[_0xace1('0x20')]=function(_0x3b7d1b,_0x1af974){if(_0x3b7d1b[_0xace1('0x46')]['id']){delete _0x3b7d1b['body']['id'];}return db[_0xace1('0x2b')]['find']({'where':{'id':_0x3b7d1b[_0xace1('0x44')]['id']}})['then'](handleEntityNotFound(_0x1af974,null))['then'](saveUpdates(_0x3b7d1b[_0xace1('0x46')],null))[_0xace1('0x21')](respondWithResult(_0x1af974,null))[_0xace1('0x43')](handleError(_0x1af974,null));};exports[_0xace1('0x22')]=function(_0x161fed,_0x494785){return db[_0xace1('0x2b')]['find']({'where':{'id':_0x161fed[_0xace1('0x44')]['id']}})[_0xace1('0x21')](handleEntityNotFound(_0x494785,null))['then'](removeEntity(_0x494785,null))[_0xace1('0x43')](handleError(_0x494785,null));};
\ No newline at end of file