Built motion from commit 753c950e.|2.5.42
[motion2.git] / server / api / disposition / disposition.controller.js
index b18c41f..2008c03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e2e=['body','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Disposition','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','includeAll','findAll','rows','catch','params','rawAttributes','include','merge','options','create','user','role','Dispositions','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x1505e5,_0x5cc291){var _0x5b1dcd=function(_0x18bfe5){while(--_0x18bfe5){_0x1505e5['push'](_0x1505e5['shift']());}};_0x5b1dcd(++_0x5cc291);}(_0x9e2e,0x1db));var _0xe9e2=function(_0x2c17aa,_0x34c6de){_0x2c17aa=_0x2c17aa-0x0;var _0x15e203=_0x9e2e[_0x2c17aa];return _0x15e203;};'use strict';var pdf=require(_0xe9e2('0x0'));var emlformat=require(_0xe9e2('0x1'));var rimraf=require(_0xe9e2('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe9e2('0x3'));var moment=require(_0xe9e2('0x4'));var BPromise=require(_0xe9e2('0x5'));var Mustache=require(_0xe9e2('0x6'));var util=require(_0xe9e2('0x7'));var path=require(_0xe9e2('0x8'));var sox=require(_0xe9e2('0x9'));var csv=require(_0xe9e2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xe9e2('0xb'));var crypto=require('crypto');var jsforce=require(_0xe9e2('0xc'));var deskjs=require(_0xe9e2('0xd'));var toCsv=require(_0xe9e2('0xa'));var querystring=require(_0xe9e2('0xe'));var Papa=require('papaparse');var Redis=require(_0xe9e2('0xf'));var authService=require(_0xe9e2('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe9e2('0x11'));var hardwareService=require(_0xe9e2('0x12'));var logger=require(_0xe9e2('0x13'))('api');var utils=require(_0xe9e2('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe9e2('0x15'));var db=require(_0xe9e2('0x16'))['db'];function respondWithStatusCode(_0x2cdd07,_0x6cd206){_0x6cd206=_0x6cd206||0xcc;return function(_0x30da3d){if(_0x30da3d){return _0x2cdd07['sendStatus'](_0x6cd206);}return _0x2cdd07[_0xe9e2('0x17')](_0x6cd206)[_0xe9e2('0x18')]();};}function respondWithResult(_0x34f87c,_0x24f60b){_0x24f60b=_0x24f60b||0xc8;return function(_0x21c89b){if(_0x21c89b){return _0x34f87c['status'](_0x24f60b)[_0xe9e2('0x19')](_0x21c89b);}};}function respondWithFilteredResult(_0xfae283,_0x42a5c8){return function(_0x14eb2b){if(_0x14eb2b){var _0x355bde=_0x14eb2b[_0xe9e2('0x1a')],_0x5c11d8=_0x42a5c8[_0xe9e2('0x1b')],_0x430180=_0x42a5c8[_0xe9e2('0x1b')]+_0x42a5c8[_0xe9e2('0x1c')],_0x299d4b;if(_0x430180>=_0x355bde){_0x430180=_0x355bde;_0x299d4b=0xc8;}else{_0x299d4b=0xce;}_0xfae283[_0xe9e2('0x17')](_0x299d4b);return _0xfae283[_0xe9e2('0x1d')]('Content-Range',_0x5c11d8+'-'+_0x430180+'/'+_0x355bde)['json'](_0x14eb2b);}return null;};}function patchUpdates(_0x5a17e0){return function(_0x14186f){try{jsonpatch[_0xe9e2('0x1e')](_0x14186f,_0x5a17e0,!![]);}catch(_0xaa1f63){return BPromise[_0xe9e2('0x1f')](_0xaa1f63);}return _0x14186f['save']();};}function saveUpdates(_0x52aec2,_0x146720){return function(_0x4b79d6){if(_0x4b79d6){return _0x4b79d6[_0xe9e2('0x20')](_0x52aec2)[_0xe9e2('0x21')](function(_0x51aecd){return _0x51aecd;});}return null;};}function removeEntity(_0xb37bbb,_0x33707b){return function(_0x4508e5){if(_0x4508e5){return _0x4508e5[_0xe9e2('0x22')]()[_0xe9e2('0x21')](function(){var _0x381f6f=_0x4508e5[_0xe9e2('0x23')]({'plain':!![]});var _0x4d785e='Dispositions';return db[_0xe9e2('0x24')]['destroy']({'where':{'type':_0x4d785e,'resourceId':_0x381f6f['id']}})[_0xe9e2('0x21')](function(){return _0x4508e5;});})['then'](function(){_0xb37bbb[_0xe9e2('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d0a30,_0x5015bc){return function(_0x5c800e){if(!_0x5c800e){_0x2d0a30['sendStatus'](0x194);}return _0x5c800e;};}function handleError(_0x457907,_0x37fe75){_0x37fe75=_0x37fe75||0x1f4;return function(_0x2486a2){logger[_0xe9e2('0x25')](_0x2486a2[_0xe9e2('0x26')]);if(_0x2486a2[_0xe9e2('0x27')]){delete _0x2486a2[_0xe9e2('0x27')];}_0x457907[_0xe9e2('0x17')](_0x37fe75)[_0xe9e2('0x28')](_0x2486a2);};}exports[_0xe9e2('0x29')]=function(_0x1ea834,_0x5c9a70){var _0x5e254b={},_0x299356={},_0x2a2dd4={'count':0x0,'rows':[]};var _0x44299e=_[_0xe9e2('0x2a')](db[_0xe9e2('0x2b')]['rawAttributes'],function(_0xbdc22d){return{'name':_0xbdc22d[_0xe9e2('0x2c')],'type':_0xbdc22d[_0xe9e2('0x2d')]['key']};});_0x299356[_0xe9e2('0x2e')]=_[_0xe9e2('0x2a')](_0x44299e,_0xe9e2('0x27'));_0x299356[_0xe9e2('0x2f')]=_[_0xe9e2('0x30')](_0x1ea834[_0xe9e2('0x2f')]);_0x299356[_0xe9e2('0x31')]=_[_0xe9e2('0x32')](_0x299356[_0xe9e2('0x2e')],_0x299356[_0xe9e2('0x2f')]);_0x5e254b['attributes']=_[_0xe9e2('0x32')](_0x299356[_0xe9e2('0x2e')],qs['fields'](_0x1ea834['query'][_0xe9e2('0x33')]));_0x5e254b['attributes']=_0x5e254b[_0xe9e2('0x34')][_0xe9e2('0x35')]?_0x5e254b[_0xe9e2('0x34')]:_0x299356[_0xe9e2('0x2e')];if(!_0x1ea834[_0xe9e2('0x2f')][_0xe9e2('0x36')](_0xe9e2('0x37'))){_0x5e254b[_0xe9e2('0x1c')]=qs[_0xe9e2('0x1c')](_0x1ea834[_0xe9e2('0x2f')][_0xe9e2('0x1c')]);_0x5e254b[_0xe9e2('0x1b')]=qs['offset'](_0x1ea834[_0xe9e2('0x2f')][_0xe9e2('0x1b')]);}_0x5e254b['order']=qs[_0xe9e2('0x38')](_0x1ea834['query'][_0xe9e2('0x38')]);_0x5e254b[_0xe9e2('0x39')]=qs[_0xe9e2('0x31')](_[_0xe9e2('0x3a')](_0x1ea834[_0xe9e2('0x2f')],_0x299356['filters']),_0x44299e);if(_0x1ea834[_0xe9e2('0x2f')][_0xe9e2('0x3b')]){_0x5e254b['where']=_['merge'](_0x5e254b['where'],{'$or':_[_0xe9e2('0x2a')](_0x44299e,function(_0x520778){if(_0x520778[_0xe9e2('0x2d')]!==_0xe9e2('0x3c')){var _0x28deb9={};_0x28deb9[_0x520778[_0xe9e2('0x27')]]={'$like':'%'+_0x1ea834['query'][_0xe9e2('0x3b')]+'%'};return _0x28deb9;}})});}_0x5e254b=_['merge']({},_0x5e254b,_0x1ea834['options']);var _0x3b91e8={'where':_0x5e254b[_0xe9e2('0x39')]};return db[_0xe9e2('0x2b')][_0xe9e2('0x1a')](_0x3b91e8)['then'](function(_0x4d4c93){_0x2a2dd4['count']=_0x4d4c93;if(_0x1ea834[_0xe9e2('0x2f')][_0xe9e2('0x3d')]){_0x5e254b['include']=[{'all':!![]}];}return db['Disposition'][_0xe9e2('0x3e')](_0x5e254b);})[_0xe9e2('0x21')](function(_0x3d3f6f){_0x2a2dd4[_0xe9e2('0x3f')]=_0x3d3f6f;return _0x2a2dd4;})[_0xe9e2('0x21')](respondWithFilteredResult(_0x5c9a70,_0x5e254b))[_0xe9e2('0x40')](handleError(_0x5c9a70,null));};exports['show']=function(_0xc8275d,_0x66fef3){var _0x9ac648={'raw':!![],'where':{'id':_0xc8275d[_0xe9e2('0x41')]['id']}},_0x22c3c4={};_0x22c3c4[_0xe9e2('0x2e')]=_[_0xe9e2('0x30')](db['Disposition'][_0xe9e2('0x42')]);_0x22c3c4[_0xe9e2('0x2f')]=_[_0xe9e2('0x30')](_0xc8275d['query']);_0x22c3c4[_0xe9e2('0x31')]=_[_0xe9e2('0x32')](_0x22c3c4['model'],_0x22c3c4[_0xe9e2('0x2f')]);_0x9ac648[_0xe9e2('0x34')]=_[_0xe9e2('0x32')](_0x22c3c4[_0xe9e2('0x2e')],qs['fields'](_0xc8275d[_0xe9e2('0x2f')][_0xe9e2('0x33')]));_0x9ac648[_0xe9e2('0x34')]=_0x9ac648[_0xe9e2('0x34')][_0xe9e2('0x35')]?_0x9ac648['attributes']:_0x22c3c4[_0xe9e2('0x2e')];if(_0xc8275d[_0xe9e2('0x2f')][_0xe9e2('0x3d')]){_0x9ac648[_0xe9e2('0x43')]=[{'all':!![]}];}_0x9ac648=_[_0xe9e2('0x44')]({},_0x9ac648,_0xc8275d[_0xe9e2('0x45')]);return db[_0xe9e2('0x2b')]['find'](_0x9ac648)[_0xe9e2('0x21')](handleEntityNotFound(_0x66fef3,null))[_0xe9e2('0x21')](respondWithResult(_0x66fef3,null))[_0xe9e2('0x40')](handleError(_0x66fef3,null));};exports[_0xe9e2('0x46')]=function(_0x257ce3,_0x48506e){return db['Disposition'][_0xe9e2('0x46')](_0x257ce3['body'],{})[_0xe9e2('0x21')](function(_0x4272e6){var _0x1e2b5c=_0x257ce3[_0xe9e2('0x47')][_0xe9e2('0x23')]({'plain':!![]});if(!_0x1e2b5c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e2b5c[_0xe9e2('0x48')]===_0xe9e2('0x47')){var _0x41c5b4=_0x4272e6[_0xe9e2('0x23')]({'plain':!![]});var _0x4ce722=_0xe9e2('0x49');return db[_0xe9e2('0x4a')][_0xe9e2('0x4b')]({'where':{'name':_0x4ce722,'userProfileId':_0x1e2b5c['userProfileId']},'raw':!![]})['then'](function(_0x2a6d2b){if(_0x2a6d2b&&_0x2a6d2b[_0xe9e2('0x4c')]===0x0){return db[_0xe9e2('0x24')]['create']({'name':_0x41c5b4[_0xe9e2('0x27')],'resourceId':_0x41c5b4['id'],'type':_0x2a6d2b['name'],'sectionId':_0x2a6d2b['id']},{})[_0xe9e2('0x21')](function(){return _0x4272e6;});}else{return _0x4272e6;}})[_0xe9e2('0x40')](function(_0x40cd5b){logger[_0xe9e2('0x25')](_0xe9e2('0x4d'),_0x40cd5b);throw _0x40cd5b;});}return _0x4272e6;})[_0xe9e2('0x21')](respondWithResult(_0x48506e,0xc9))[_0xe9e2('0x40')](handleError(_0x48506e,null));};exports[_0xe9e2('0x20')]=function(_0x31586f,_0x16512f){if(_0x31586f[_0xe9e2('0x4e')]['id']){delete _0x31586f[_0xe9e2('0x4e')]['id'];}return db[_0xe9e2('0x2b')]['find']({'where':{'id':_0x31586f[_0xe9e2('0x41')]['id']}})[_0xe9e2('0x21')](handleEntityNotFound(_0x16512f,null))[_0xe9e2('0x21')](saveUpdates(_0x31586f[_0xe9e2('0x4e')],null))['then'](respondWithResult(_0x16512f,null))[_0xe9e2('0x40')](handleError(_0x16512f,null));};exports[_0xe9e2('0x22')]=function(_0x4b968d,_0xe550e0){return db[_0xe9e2('0x2b')][_0xe9e2('0x4b')]({'where':{'id':_0x4b968d[_0xe9e2('0x41')]['id']}})[_0xe9e2('0x21')](handleEntityNotFound(_0xe550e0,null))[_0xe9e2('0x21')](removeEntity(_0xe550e0,null))[_0xe9e2('0x40')](handleError(_0xe550e0,null));};
\ No newline at end of file
+var _0xe290=['papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','Dispositions','UserProfileResource','name','map','Disposition','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','catch','show','params','fields','includeAll','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0xe290,0x1d6));var _0x0e29=function(_0x56dda5,_0x40d426){_0x56dda5=_0x56dda5-0x0;var _0x12574f=_0xe290[_0x56dda5];return _0x12574f;};'use strict';var emlformat=require(_0x0e29('0x0'));var rimraf=require(_0x0e29('0x1'));var zipdir=require(_0x0e29('0x2'));var jsonpatch=require(_0x0e29('0x3'));var rp=require('request-promise');var moment=require(_0x0e29('0x4'));var BPromise=require(_0x0e29('0x5'));var Mustache=require(_0x0e29('0x6'));var util=require('util');var path=require(_0x0e29('0x7'));var sox=require(_0x0e29('0x8'));var csv=require(_0x0e29('0x9'));var ejs=require(_0x0e29('0xa'));var fs=require('fs');var fs_extra=require(_0x0e29('0xb'));var _=require(_0x0e29('0xc'));var squel=require(_0x0e29('0xd'));var crypto=require(_0x0e29('0xe'));var jsforce=require(_0x0e29('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0e29('0x9'));var querystring=require('querystring');var Papa=require(_0x0e29('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0e29('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e29('0x12'));var logger=require('../../config/logger')(_0x0e29('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0e29('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26f297,_0x56a18c){_0x56a18c=_0x56a18c||0xcc;return function(_0x3f81f4){if(_0x3f81f4){return _0x26f297[_0x0e29('0x15')](_0x56a18c);}return _0x26f297['status'](_0x56a18c)[_0x0e29('0x16')]();};}function respondWithResult(_0x3741d9,_0x56cf0c){_0x56cf0c=_0x56cf0c||0xc8;return function(_0x12302d){if(_0x12302d){return _0x3741d9[_0x0e29('0x17')](_0x56cf0c)[_0x0e29('0x18')](_0x12302d);}};}function respondWithFilteredResult(_0x43dea,_0x1f0886){return function(_0x1953f2){if(_0x1953f2){var _0x2a7f0a=typeof _0x1f0886['offset']===_0x0e29('0x19')&&typeof _0x1f0886[_0x0e29('0x1a')]===_0x0e29('0x19');var _0x25998a=_0x1953f2[_0x0e29('0x1b')];var _0xa3e999=_0x2a7f0a?0x0:_0x1f0886[_0x0e29('0x1c')];var _0x64bb26=_0x2a7f0a?_0x1953f2[_0x0e29('0x1b')]:_0x1f0886[_0x0e29('0x1c')]+_0x1f0886[_0x0e29('0x1a')];var _0x3a1aed;if(_0x64bb26>=_0x25998a){_0x64bb26=_0x25998a;_0x3a1aed=0xc8;}else{_0x3a1aed=0xce;}_0x43dea['status'](_0x3a1aed);return _0x43dea[_0x0e29('0x1d')](_0x0e29('0x1e'),_0xa3e999+'-'+_0x64bb26+'/'+_0x25998a)[_0x0e29('0x18')](_0x1953f2);}return null;};}function patchUpdates(_0x2e9820){return function(_0x337f35){try{jsonpatch[_0x0e29('0x1f')](_0x337f35,_0x2e9820,!![]);}catch(_0x518bc0){return BPromise[_0x0e29('0x20')](_0x518bc0);}return _0x337f35[_0x0e29('0x21')]();};}function saveUpdates(_0x2858a1,_0xbf3b4a){return function(_0x44b262){if(_0x44b262){return _0x44b262[_0x0e29('0x22')](_0x2858a1)[_0x0e29('0x23')](function(_0x36955d){return _0x36955d;});}return null;};}function removeEntity(_0x2275bd,_0x9d1e01){return function(_0x4b157c){if(_0x4b157c){return _0x4b157c[_0x0e29('0x24')]()[_0x0e29('0x23')](function(){var _0x1e1773=_0x4b157c['get']({'plain':!![]});var _0x5e64ad=_0x0e29('0x25');return db[_0x0e29('0x26')][_0x0e29('0x24')]({'where':{'type':_0x5e64ad,'resourceId':_0x1e1773['id']}})[_0x0e29('0x23')](function(){return _0x4b157c;});})['then'](function(){_0x2275bd[_0x0e29('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38358c,_0x2203a0){return function(_0x472c45){if(!_0x472c45){_0x38358c[_0x0e29('0x15')](0x194);}return _0x472c45;};}function handleError(_0x1de9bf,_0x3bd544){_0x3bd544=_0x3bd544||0x1f4;return function(_0x1223a1){logger['error'](_0x1223a1['stack']);if(_0x1223a1['name']){delete _0x1223a1[_0x0e29('0x27')];}_0x1de9bf[_0x0e29('0x17')](_0x3bd544)['send'](_0x1223a1);};}exports['index']=function(_0x29e456,_0x2ceaba){var _0x5ae74c={},_0x56f9d3={},_0xab9565={'count':0x0,'rows':[]};var _0x3cfc1b=_[_0x0e29('0x28')](db[_0x0e29('0x29')][_0x0e29('0x2a')],function(_0x1106c0){return{'name':_0x1106c0[_0x0e29('0x2b')],'type':_0x1106c0['type'][_0x0e29('0x2c')]};});_0x56f9d3[_0x0e29('0x2d')]=_[_0x0e29('0x28')](_0x3cfc1b,_0x0e29('0x27'));_0x56f9d3[_0x0e29('0x2e')]=_[_0x0e29('0x2f')](_0x29e456[_0x0e29('0x2e')]);_0x56f9d3[_0x0e29('0x30')]=_[_0x0e29('0x31')](_0x56f9d3[_0x0e29('0x2d')],_0x56f9d3[_0x0e29('0x2e')]);_0x5ae74c[_0x0e29('0x32')]=_[_0x0e29('0x31')](_0x56f9d3[_0x0e29('0x2d')],qs['fields'](_0x29e456[_0x0e29('0x2e')]['fields']));_0x5ae74c[_0x0e29('0x32')]=_0x5ae74c['attributes'][_0x0e29('0x33')]?_0x5ae74c[_0x0e29('0x32')]:_0x56f9d3[_0x0e29('0x2d')];if(!_0x29e456['query'][_0x0e29('0x34')](_0x0e29('0x35'))){_0x5ae74c[_0x0e29('0x1a')]=qs['limit'](_0x29e456[_0x0e29('0x2e')]['limit']);_0x5ae74c[_0x0e29('0x1c')]=qs[_0x0e29('0x1c')](_0x29e456['query']['offset']);}_0x5ae74c[_0x0e29('0x36')]=qs[_0x0e29('0x37')](_0x29e456[_0x0e29('0x2e')][_0x0e29('0x37')]);_0x5ae74c['where']=qs['filters'](_[_0x0e29('0x38')](_0x29e456[_0x0e29('0x2e')],_0x56f9d3[_0x0e29('0x30')]),_0x3cfc1b);if(_0x29e456[_0x0e29('0x2e')][_0x0e29('0x39')]){_0x5ae74c[_0x0e29('0x3a')]=_[_0x0e29('0x3b')](_0x5ae74c['where'],{'$or':_['map'](_0x3cfc1b,function(_0x208372){if(_0x208372[_0x0e29('0x3c')]!==_0x0e29('0x3d')){var _0x574e9c={};_0x574e9c[_0x208372[_0x0e29('0x27')]]={'$like':'%'+_0x29e456[_0x0e29('0x2e')][_0x0e29('0x39')]+'%'};return _0x574e9c;}})});}_0x5ae74c=_[_0x0e29('0x3b')]({},_0x5ae74c,_0x29e456[_0x0e29('0x3e')]);var _0xfe3dfd={'where':_0x5ae74c[_0x0e29('0x3a')]};return db[_0x0e29('0x29')][_0x0e29('0x1b')](_0xfe3dfd)['then'](function(_0x241a7e){_0xab9565[_0x0e29('0x1b')]=_0x241a7e;if(_0x29e456['query']['includeAll']){_0x5ae74c[_0x0e29('0x3f')]=[{'all':!![]}];}return db[_0x0e29('0x29')][_0x0e29('0x40')](_0x5ae74c);})['then'](function(_0x415806){_0xab9565['rows']=_0x415806;return _0xab9565;})[_0x0e29('0x23')](respondWithFilteredResult(_0x2ceaba,_0x5ae74c))[_0x0e29('0x41')](handleError(_0x2ceaba,null));};exports[_0x0e29('0x42')]=function(_0x167189,_0x10428c){var _0x34351a={'raw':!![],'where':{'id':_0x167189[_0x0e29('0x43')]['id']}},_0x229dc1={};_0x229dc1[_0x0e29('0x2d')]=_[_0x0e29('0x2f')](db['Disposition'][_0x0e29('0x2a')]);_0x229dc1['query']=_['keys'](_0x167189[_0x0e29('0x2e')]);_0x229dc1[_0x0e29('0x30')]=_[_0x0e29('0x31')](_0x229dc1['model'],_0x229dc1[_0x0e29('0x2e')]);_0x34351a[_0x0e29('0x32')]=_[_0x0e29('0x31')](_0x229dc1[_0x0e29('0x2d')],qs[_0x0e29('0x44')](_0x167189['query'][_0x0e29('0x44')]));_0x34351a[_0x0e29('0x32')]=_0x34351a['attributes'][_0x0e29('0x33')]?_0x34351a[_0x0e29('0x32')]:_0x229dc1[_0x0e29('0x2d')];if(_0x167189[_0x0e29('0x2e')][_0x0e29('0x45')]){_0x34351a[_0x0e29('0x3f')]=[{'all':!![]}];}_0x34351a=_['merge']({},_0x34351a,_0x167189[_0x0e29('0x3e')]);return db['Disposition'][_0x0e29('0x46')](_0x34351a)[_0x0e29('0x23')](handleEntityNotFound(_0x10428c,null))['then'](respondWithResult(_0x10428c,null))[_0x0e29('0x41')](handleError(_0x10428c,null));};exports[_0x0e29('0x47')]=function(_0x4547f4,_0x4eff60){return db['Disposition']['create'](_0x4547f4[_0x0e29('0x48')],{})['then'](function(_0x5d0e63){var _0x2eec8a=_0x4547f4[_0x0e29('0x49')][_0x0e29('0x4a')]({'plain':!![]});if(!_0x2eec8a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2eec8a[_0x0e29('0x4b')]===_0x0e29('0x49')){var _0x24b0ad=_0x5d0e63[_0x0e29('0x4a')]({'plain':!![]});var _0x497775='Dispositions';return db[_0x0e29('0x4c')][_0x0e29('0x46')]({'where':{'name':_0x497775,'userProfileId':_0x2eec8a[_0x0e29('0x4d')]},'raw':!![]})[_0x0e29('0x23')](function(_0x4e8348){if(_0x4e8348&&_0x4e8348[_0x0e29('0x4e')]===0x0){return db[_0x0e29('0x26')][_0x0e29('0x47')]({'name':_0x24b0ad['name'],'resourceId':_0x24b0ad['id'],'type':_0x4e8348['name'],'sectionId':_0x4e8348['id']},{})[_0x0e29('0x23')](function(){return _0x5d0e63;});}else{return _0x5d0e63;}})['catch'](function(_0x253070){logger[_0x0e29('0x4f')](_0x0e29('0x50'),_0x253070);throw _0x253070;});}return _0x5d0e63;})[_0x0e29('0x23')](respondWithResult(_0x4eff60,0xc9))['catch'](handleError(_0x4eff60,null));};exports[_0x0e29('0x22')]=function(_0x345c1f,_0x555e1f){if(_0x345c1f[_0x0e29('0x48')]['id']){delete _0x345c1f['body']['id'];}return db['Disposition'][_0x0e29('0x46')]({'where':{'id':_0x345c1f[_0x0e29('0x43')]['id']}})[_0x0e29('0x23')](handleEntityNotFound(_0x555e1f,null))[_0x0e29('0x23')](saveUpdates(_0x345c1f[_0x0e29('0x48')],null))['then'](respondWithResult(_0x555e1f,null))[_0x0e29('0x41')](handleError(_0x555e1f,null));};exports[_0x0e29('0x24')]=function(_0x4c1e49,_0x1b1a0d){return db[_0x0e29('0x29')][_0x0e29('0x46')]({'where':{'id':_0x4c1e49[_0x0e29('0x43')]['id']}})[_0x0e29('0x23')](handleEntityNotFound(_0x1b1a0d,null))[_0x0e29('0x23')](removeEntity(_0x1b1a0d,null))['catch'](handleError(_0x1b1a0d,null));};
\ No newline at end of file