Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / api / disposition / disposition.controller.js
index c77c022..8a02396 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f37=['destroy','then','get','Dispositions','UserProfileResource','error','name','send','merge','body','contact','message','interaction','account','index','Disposition','rawAttributes','fieldName','type','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','options','include','show','params','keys','includeAll','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save'];(function(_0x4a65fd,_0x2c1d4f){var _0x5e4e0a=function(_0x369e54){while(--_0x369e54){_0x4a65fd['push'](_0x4a65fd['shift']());}};_0x5e4e0a(++_0x2c1d4f);}(_0x0f37,0x19a));var _0x70f3=function(_0x57d100,_0x3559c7){_0x57d100=_0x57d100-0x0;var _0x170781=_0x0f37[_0x57d100];return _0x170781;};'use strict';var emlformat=require(_0x70f3('0x0'));var rimraf=require(_0x70f3('0x1'));var zipdir=require(_0x70f3('0x2'));var jsonpatch=require(_0x70f3('0x3'));var rp=require(_0x70f3('0x4'));var moment=require(_0x70f3('0x5'));var BPromise=require(_0x70f3('0x6'));var Mustache=require(_0x70f3('0x7'));var util=require(_0x70f3('0x8'));var path=require(_0x70f3('0x9'));var sox=require(_0x70f3('0xa'));var csv=require(_0x70f3('0xb'));var ejs=require(_0x70f3('0xc'));var fs=require('fs');var fs_extra=require(_0x70f3('0xd'));var _=require(_0x70f3('0xe'));var squel=require(_0x70f3('0xf'));var crypto=require(_0x70f3('0x10'));var jsforce=require(_0x70f3('0x11'));var deskjs=require(_0x70f3('0x12'));var toCsv=require(_0x70f3('0xb'));var querystring=require(_0x70f3('0x13'));var Papa=require(_0x70f3('0x14'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x70f3('0x15'));var as=require(_0x70f3('0x16'));var hardwareService=require(_0x70f3('0x17'));var logger=require(_0x70f3('0x18'))(_0x70f3('0x19'));var utils=require('../../config/utils');var config=require(_0x70f3('0x1a'));var licenseUtil=require(_0x70f3('0x1b'));var db=require(_0x70f3('0x1c'))['db'];function respondWithStatusCode(_0x3ec422,_0x541f3d){_0x541f3d=_0x541f3d||0xcc;return function(_0x56232a){if(_0x56232a){return _0x3ec422[_0x70f3('0x1d')](_0x541f3d);}return _0x3ec422[_0x70f3('0x1e')](_0x541f3d)[_0x70f3('0x1f')]();};}function respondWithResult(_0x5b0bd2,_0x45a9d5){_0x45a9d5=_0x45a9d5||0xc8;return function(_0x2023ee){if(_0x2023ee){return _0x5b0bd2[_0x70f3('0x1e')](_0x45a9d5)[_0x70f3('0x20')](_0x2023ee);}};}function respondWithFilteredResult(_0x2243e7,_0x245cba){return function(_0x91a9c4){if(_0x91a9c4){var _0x297a71=typeof _0x245cba[_0x70f3('0x21')]==='undefined'&&typeof _0x245cba[_0x70f3('0x22')]===_0x70f3('0x23');var _0x5e8181=_0x91a9c4['count'];var _0xd9fcf1=_0x297a71?0x0:_0x245cba['offset'];var _0x2aae43=_0x297a71?_0x91a9c4[_0x70f3('0x24')]:_0x245cba['offset']+_0x245cba[_0x70f3('0x22')];var _0x6dc6f6;if(_0x2aae43>=_0x5e8181){_0x2aae43=_0x5e8181;_0x6dc6f6=0xc8;}else{_0x6dc6f6=0xce;}_0x2243e7[_0x70f3('0x1e')](_0x6dc6f6);return _0x2243e7[_0x70f3('0x25')]('Content-Range',_0xd9fcf1+'-'+_0x2aae43+'/'+_0x5e8181)[_0x70f3('0x20')](_0x91a9c4);}return null;};}function patchUpdates(_0x67f56f){return function(_0x25bebb){try{jsonpatch['apply'](_0x25bebb,_0x67f56f,!![]);}catch(_0x2cc6c9){return BPromise[_0x70f3('0x26')](_0x2cc6c9);}return _0x25bebb[_0x70f3('0x27')]();};}function saveUpdates(_0xf419e1,_0x2d8b0b){return function(_0x4003e6){if(_0x4003e6){return _0x4003e6['update'](_0xf419e1)['then'](function(_0x54bda2){return _0x54bda2;});}return null;};}function removeEntity(_0x4da026,_0x2e7416){return function(_0xd083a3){if(_0xd083a3){return _0xd083a3[_0x70f3('0x28')]()[_0x70f3('0x29')](function(){var _0x72cc44=_0xd083a3[_0x70f3('0x2a')]({'plain':!![]});var _0xc65e03=_0x70f3('0x2b');return db[_0x70f3('0x2c')][_0x70f3('0x28')]({'where':{'type':_0xc65e03,'resourceId':_0x72cc44['id']}})['then'](function(){return _0xd083a3;});})['then'](function(){_0x4da026[_0x70f3('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d729d,_0x341894){return function(_0x155668){if(!_0x155668){_0x4d729d[_0x70f3('0x1d')](0x194);}return _0x155668;};}function handleError(_0x1b85b8,_0x18e253){_0x18e253=_0x18e253||0x1f4;return function(_0x4d8f0f){logger[_0x70f3('0x2d')](_0x4d8f0f['stack']);if(_0x4d8f0f[_0x70f3('0x2e')]){delete _0x4d8f0f[_0x70f3('0x2e')];}_0x1b85b8[_0x70f3('0x1e')](_0x18e253)[_0x70f3('0x2f')](_0x4d8f0f);};}function getMustacheRender(_0x29db3c,_0x5975b7){return Mustache['render'](_0x29db3c,_[_0x70f3('0x30')](_0x5975b7[_0x70f3('0x31')],{'contact':_0x5975b7[_0x70f3('0x32')],'message':_0x5975b7[_0x70f3('0x33')],'agent':_0x5975b7['agent'],'interaction':_0x5975b7[_0x70f3('0x34')],'account':_0x5975b7[_0x70f3('0x35')]}))||'';}exports[_0x70f3('0x36')]=function(_0xa8a773,_0x565f99){var _0x24f90f={},_0x19185b={},_0x390788={'count':0x0,'rows':[]};var _0x27f2bd=_['map'](db[_0x70f3('0x37')][_0x70f3('0x38')],function(_0x24a600){return{'name':_0x24a600[_0x70f3('0x39')],'type':_0x24a600[_0x70f3('0x3a')]['key']};});_0x19185b[_0x70f3('0x3b')]=_[_0x70f3('0x3c')](_0x27f2bd,_0x70f3('0x2e'));_0x19185b[_0x70f3('0x3d')]=_['keys'](_0xa8a773[_0x70f3('0x3d')]);_0x19185b[_0x70f3('0x3e')]=_[_0x70f3('0x3f')](_0x19185b['model'],_0x19185b[_0x70f3('0x3d')]);_0x24f90f['attributes']=_[_0x70f3('0x3f')](_0x19185b['model'],qs[_0x70f3('0x40')](_0xa8a773[_0x70f3('0x3d')][_0x70f3('0x40')]));_0x24f90f[_0x70f3('0x41')]=_0x24f90f[_0x70f3('0x41')][_0x70f3('0x42')]?_0x24f90f['attributes']:_0x19185b[_0x70f3('0x3b')];if(!_0xa8a773[_0x70f3('0x3d')][_0x70f3('0x43')]('nolimit')){_0x24f90f[_0x70f3('0x22')]=qs[_0x70f3('0x22')](_0xa8a773['query']['limit']);_0x24f90f[_0x70f3('0x21')]=qs[_0x70f3('0x21')](_0xa8a773[_0x70f3('0x3d')]['offset']);}_0x24f90f['order']=qs[_0x70f3('0x44')](_0xa8a773[_0x70f3('0x3d')][_0x70f3('0x44')]);_0x24f90f['where']=qs[_0x70f3('0x3e')](_[_0x70f3('0x45')](_0xa8a773[_0x70f3('0x3d')],_0x19185b[_0x70f3('0x3e')]),_0x27f2bd);if(_0xa8a773['query'][_0x70f3('0x46')]){_0x24f90f[_0x70f3('0x47')]=_[_0x70f3('0x30')](_0x24f90f[_0x70f3('0x47')],{'$or':_['map'](_0x27f2bd,function(_0x52340c){if(_0x52340c['type']!==_0x70f3('0x48')){var _0x23eef4={};_0x23eef4[_0x52340c[_0x70f3('0x2e')]]={'$like':'%'+_0xa8a773[_0x70f3('0x3d')][_0x70f3('0x46')]+'%'};return _0x23eef4;}})});}_0x24f90f=_[_0x70f3('0x30')]({},_0x24f90f,_0xa8a773[_0x70f3('0x49')]);var _0x3ad1d4={'where':_0x24f90f[_0x70f3('0x47')]};return db['Disposition'][_0x70f3('0x24')](_0x3ad1d4)[_0x70f3('0x29')](function(_0xbbfffb){_0x390788['count']=_0xbbfffb;if(_0xa8a773[_0x70f3('0x3d')]['includeAll']){_0x24f90f[_0x70f3('0x4a')]=[{'all':!![]}];}return db[_0x70f3('0x37')]['findAll'](_0x24f90f);})['then'](function(_0x42f361){_0x390788['rows']=_0x42f361;return _0x390788;})['then'](respondWithFilteredResult(_0x565f99,_0x24f90f))['catch'](handleError(_0x565f99,null));};exports[_0x70f3('0x4b')]=function(_0x4b1851,_0x4c6206){var _0x2109d7={'raw':!![],'where':{'id':_0x4b1851[_0x70f3('0x4c')]['id']}},_0x78bfd={};_0x78bfd['model']=_['keys'](db[_0x70f3('0x37')]['rawAttributes']);_0x78bfd[_0x70f3('0x3d')]=_[_0x70f3('0x4d')](_0x4b1851[_0x70f3('0x3d')]);_0x78bfd[_0x70f3('0x3e')]=_[_0x70f3('0x3f')](_0x78bfd[_0x70f3('0x3b')],_0x78bfd['query']);_0x2109d7[_0x70f3('0x41')]=_[_0x70f3('0x3f')](_0x78bfd[_0x70f3('0x3b')],qs[_0x70f3('0x40')](_0x4b1851[_0x70f3('0x3d')][_0x70f3('0x40')]));_0x2109d7['attributes']=_0x2109d7['attributes'][_0x70f3('0x42')]?_0x2109d7['attributes']:_0x78bfd['model'];if(_0x4b1851[_0x70f3('0x3d')][_0x70f3('0x4e')]){_0x2109d7['include']=[{'all':!![]}];}_0x2109d7=_[_0x70f3('0x30')]({},_0x2109d7,_0x4b1851['options']);return db['Disposition'][_0x70f3('0x4f')](_0x2109d7)[_0x70f3('0x29')](handleEntityNotFound(_0x4c6206,null))[_0x70f3('0x29')](respondWithResult(_0x4c6206,null))[_0x70f3('0x50')](handleError(_0x4c6206,null));};exports[_0x70f3('0x51')]=function(_0x28597c,_0x55f5d1){return db[_0x70f3('0x37')]['create'](_0x28597c[_0x70f3('0x31')],{})[_0x70f3('0x29')](function(_0x287ff4){var _0x5d8ff4=_0x28597c['user']['get']({'plain':!![]});if(!_0x5d8ff4)throw new Error(_0x70f3('0x52'));if(_0x5d8ff4[_0x70f3('0x53')]===_0x70f3('0x54')){var _0x4f23e2=_0x287ff4[_0x70f3('0x2a')]({'plain':!![]});var _0x3283e3=_0x70f3('0x2b');return db[_0x70f3('0x55')]['find']({'where':{'name':_0x3283e3,'userProfileId':_0x5d8ff4[_0x70f3('0x56')]},'raw':!![]})['then'](function(_0x378a17){if(_0x378a17&&_0x378a17[_0x70f3('0x57')]===0x0){return db['UserProfileResource'][_0x70f3('0x51')]({'name':_0x4f23e2[_0x70f3('0x2e')],'resourceId':_0x4f23e2['id'],'type':_0x378a17[_0x70f3('0x2e')],'sectionId':_0x378a17['id']},{})[_0x70f3('0x29')](function(){return _0x287ff4;});}else{return _0x287ff4;}})[_0x70f3('0x50')](function(_0x5b0588){logger[_0x70f3('0x2d')](_0x70f3('0x58'),_0x5b0588);throw _0x5b0588;});}return _0x287ff4;})['then'](respondWithResult(_0x55f5d1,0xc9))[_0x70f3('0x50')](handleError(_0x55f5d1,null));};exports[_0x70f3('0x59')]=function(_0xd1df89,_0x5b11c7){if(_0xd1df89[_0x70f3('0x31')]['id']){delete _0xd1df89['body']['id'];}return db['Disposition']['find']({'where':{'id':_0xd1df89[_0x70f3('0x4c')]['id']}})[_0x70f3('0x29')](handleEntityNotFound(_0x5b11c7,null))['then'](saveUpdates(_0xd1df89[_0x70f3('0x31')],null))['then'](respondWithResult(_0x5b11c7,null))['catch'](handleError(_0x5b11c7,null));};exports[_0x70f3('0x28')]=function(_0x5551fb,_0x173fca){return db[_0x70f3('0x37')][_0x70f3('0x4f')]({'where':{'id':_0x5551fb['params']['id']}})[_0x70f3('0x29')](handleEntityNotFound(_0x173fca,null))['then'](removeEntity(_0x173fca,null))[_0x70f3('0x50')](handleError(_0x173fca,null));};
\ No newline at end of file
+var _0xb590=['bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','get','sendStatus','name','render','message','agent','interaction','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','include','Disposition','findAll','includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','zip-dir','request-promise'];(function(_0x643369,_0x487db4){var _0x191f9f=function(_0x3b632b){while(--_0x3b632b){_0x643369['push'](_0x643369['shift']());}};_0x191f9f(++_0x487db4);}(_0xb590,0x1b5));var _0x0b59=function(_0x414812,_0x528523){_0x414812=_0x414812-0x0;var _0x3dcedd=_0xb590[_0x414812];return _0x3dcedd;};'use strict';var emlformat=require(_0x0b59('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0b59('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0b59('0x2'));var moment=require('moment');var BPromise=require(_0x0b59('0x3'));var Mustache=require(_0x0b59('0x4'));var util=require('util');var path=require(_0x0b59('0x5'));var sox=require('sox');var csv=require(_0x0b59('0x6'));var ejs=require(_0x0b59('0x7'));var fs=require('fs');var fs_extra=require(_0x0b59('0x8'));var _=require(_0x0b59('0x9'));var squel=require(_0x0b59('0xa'));var crypto=require(_0x0b59('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0b59('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0b59('0xd'));var Papa=require(_0x0b59('0xe'));var Redis=require(_0x0b59('0xf'));var authService=require(_0x0b59('0x10'));var qs=require(_0x0b59('0x11'));var as=require(_0x0b59('0x12'));var hardwareService=require(_0x0b59('0x13'));var logger=require(_0x0b59('0x14'))(_0x0b59('0x15'));var utils=require(_0x0b59('0x16'));var config=require(_0x0b59('0x17'));var licenseUtil=require(_0x0b59('0x18'));var db=require(_0x0b59('0x19'))['db'];function respondWithStatusCode(_0x33eef4,_0x1508b7){_0x1508b7=_0x1508b7||0xcc;return function(_0x2f4204){if(_0x2f4204){return _0x33eef4['sendStatus'](_0x1508b7);}return _0x33eef4['status'](_0x1508b7)[_0x0b59('0x1a')]();};}function respondWithResult(_0x58bf4a,_0x362347){_0x362347=_0x362347||0xc8;return function(_0x5d59e0){if(_0x5d59e0){return _0x58bf4a[_0x0b59('0x1b')](_0x362347)[_0x0b59('0x1c')](_0x5d59e0);}};}function respondWithFilteredResult(_0x175c1d,_0x30a23b){return function(_0x2b9a99){if(_0x2b9a99){var _0x31afb3=typeof _0x30a23b[_0x0b59('0x1d')]===_0x0b59('0x1e')&&typeof _0x30a23b[_0x0b59('0x1f')]===_0x0b59('0x1e');var _0x2bde0a=_0x2b9a99['count'];var _0x2a3fa0=_0x31afb3?0x0:_0x30a23b[_0x0b59('0x1d')];var _0x4d44d6=_0x31afb3?_0x2b9a99['count']:_0x30a23b[_0x0b59('0x1d')]+_0x30a23b[_0x0b59('0x1f')];var _0x1704fa;if(_0x4d44d6>=_0x2bde0a){_0x4d44d6=_0x2bde0a;_0x1704fa=0xc8;}else{_0x1704fa=0xce;}_0x175c1d[_0x0b59('0x1b')](_0x1704fa);return _0x175c1d[_0x0b59('0x20')](_0x0b59('0x21'),_0x2a3fa0+'-'+_0x4d44d6+'/'+_0x2bde0a)[_0x0b59('0x1c')](_0x2b9a99);}return null;};}function patchUpdates(_0x283634){return function(_0x5c46e8){try{jsonpatch[_0x0b59('0x22')](_0x5c46e8,_0x283634,!![]);}catch(_0x411a95){return BPromise[_0x0b59('0x23')](_0x411a95);}return _0x5c46e8[_0x0b59('0x24')]();};}function saveUpdates(_0x4a4510,_0x500fbc){return function(_0x51d267){if(_0x51d267){return _0x51d267['update'](_0x4a4510)[_0x0b59('0x25')](function(_0x5dacb5){return _0x5dacb5;});}return null;};}function removeEntity(_0x441ae1,_0xf8a733){return function(_0x59469d){if(_0x59469d){return _0x59469d[_0x0b59('0x26')]()[_0x0b59('0x25')](function(){var _0x4bc131=_0x59469d[_0x0b59('0x27')]({'plain':!![]});var _0x5312aa='Dispositions';return db['UserProfileResource'][_0x0b59('0x26')]({'where':{'type':_0x5312aa,'resourceId':_0x4bc131['id']}})[_0x0b59('0x25')](function(){return _0x59469d;});})['then'](function(){_0x441ae1[_0x0b59('0x1b')](0xcc)[_0x0b59('0x1a')]();});}};}function handleEntityNotFound(_0x38d090,_0x47765f){return function(_0x5e771d){if(!_0x5e771d){_0x38d090[_0x0b59('0x28')](0x194);}return _0x5e771d;};}function handleError(_0x2d56ea,_0x3268a8){_0x3268a8=_0x3268a8||0x1f4;return function(_0x5ee22d){logger['error'](_0x5ee22d['stack']);if(_0x5ee22d[_0x0b59('0x29')]){delete _0x5ee22d[_0x0b59('0x29')];}_0x2d56ea[_0x0b59('0x1b')](_0x3268a8)['send'](_0x5ee22d);};}function getMustacheRender(_0xaa1d2f,_0x4b504e){return Mustache[_0x0b59('0x2a')](_0xaa1d2f,_['merge'](_0x4b504e['body'],{'contact':_0x4b504e['contact'],'message':_0x4b504e[_0x0b59('0x2b')],'agent':_0x4b504e[_0x0b59('0x2c')],'interaction':_0x4b504e[_0x0b59('0x2d')],'account':_0x4b504e['account']}))||'';}exports[_0x0b59('0x2e')]=function(_0x327a33,_0x56bdd8){var _0x233cf6={},_0x542b94={},_0x12f72d={'count':0x0,'rows':[]};var _0x3e7595=_[_0x0b59('0x2f')](db['Disposition']['rawAttributes'],function(_0x50dcd){return{'name':_0x50dcd[_0x0b59('0x30')],'type':_0x50dcd[_0x0b59('0x31')][_0x0b59('0x32')]};});_0x542b94[_0x0b59('0x33')]=_['map'](_0x3e7595,'name');_0x542b94[_0x0b59('0x34')]=_[_0x0b59('0x35')](_0x327a33[_0x0b59('0x34')]);_0x542b94[_0x0b59('0x36')]=_[_0x0b59('0x37')](_0x542b94[_0x0b59('0x33')],_0x542b94['query']);_0x233cf6['attributes']=_[_0x0b59('0x37')](_0x542b94[_0x0b59('0x33')],qs[_0x0b59('0x38')](_0x327a33['query'][_0x0b59('0x38')]));_0x233cf6['attributes']=_0x233cf6[_0x0b59('0x39')][_0x0b59('0x3a')]?_0x233cf6[_0x0b59('0x39')]:_0x542b94[_0x0b59('0x33')];if(!_0x327a33['query'][_0x0b59('0x3b')](_0x0b59('0x3c'))){_0x233cf6[_0x0b59('0x1f')]=qs[_0x0b59('0x1f')](_0x327a33['query'][_0x0b59('0x1f')]);_0x233cf6[_0x0b59('0x1d')]=qs[_0x0b59('0x1d')](_0x327a33[_0x0b59('0x34')][_0x0b59('0x1d')]);}_0x233cf6[_0x0b59('0x3d')]=qs['sort'](_0x327a33[_0x0b59('0x34')][_0x0b59('0x3e')]);_0x233cf6[_0x0b59('0x3f')]=qs[_0x0b59('0x36')](_[_0x0b59('0x40')](_0x327a33[_0x0b59('0x34')],_0x542b94['filters']),_0x3e7595);if(_0x327a33['query'][_0x0b59('0x41')]){_0x233cf6[_0x0b59('0x3f')]=_['merge'](_0x233cf6[_0x0b59('0x3f')],{'$or':_[_0x0b59('0x2f')](_0x3e7595,function(_0x1f6e10){if(_0x1f6e10[_0x0b59('0x31')]!==_0x0b59('0x42')){var _0x2bcaaf={};_0x2bcaaf[_0x1f6e10['name']]={'$like':'%'+_0x327a33[_0x0b59('0x34')][_0x0b59('0x41')]+'%'};return _0x2bcaaf;}})});}_0x233cf6=_[_0x0b59('0x43')]({},_0x233cf6,_0x327a33[_0x0b59('0x44')]);var _0x1f712c={'where':_0x233cf6['where']};return db['Disposition'][_0x0b59('0x45')](_0x1f712c)[_0x0b59('0x25')](function(_0x2747fd){_0x12f72d['count']=_0x2747fd;if(_0x327a33['query']['includeAll']){_0x233cf6[_0x0b59('0x46')]=[{'all':!![]}];}return db[_0x0b59('0x47')][_0x0b59('0x48')](_0x233cf6);})[_0x0b59('0x25')](function(_0x3ac22a){_0x12f72d['rows']=_0x3ac22a;return _0x12f72d;})[_0x0b59('0x25')](respondWithFilteredResult(_0x56bdd8,_0x233cf6))['catch'](handleError(_0x56bdd8,null));};exports['show']=function(_0x58d73c,_0x517c44){var _0x184b5f={'raw':!![],'where':{'id':_0x58d73c['params']['id']}},_0x15acb8={};_0x15acb8['model']=_['keys'](db[_0x0b59('0x47')]['rawAttributes']);_0x15acb8[_0x0b59('0x34')]=_[_0x0b59('0x35')](_0x58d73c[_0x0b59('0x34')]);_0x15acb8[_0x0b59('0x36')]=_['intersection'](_0x15acb8[_0x0b59('0x33')],_0x15acb8['query']);_0x184b5f[_0x0b59('0x39')]=_[_0x0b59('0x37')](_0x15acb8['model'],qs['fields'](_0x58d73c[_0x0b59('0x34')][_0x0b59('0x38')]));_0x184b5f[_0x0b59('0x39')]=_0x184b5f[_0x0b59('0x39')][_0x0b59('0x3a')]?_0x184b5f[_0x0b59('0x39')]:_0x15acb8['model'];if(_0x58d73c[_0x0b59('0x34')][_0x0b59('0x49')]){_0x184b5f['include']=[{'all':!![]}];}_0x184b5f=_[_0x0b59('0x43')]({},_0x184b5f,_0x58d73c[_0x0b59('0x44')]);return db[_0x0b59('0x47')]['find'](_0x184b5f)[_0x0b59('0x25')](handleEntityNotFound(_0x517c44,null))['then'](respondWithResult(_0x517c44,null))[_0x0b59('0x4a')](handleError(_0x517c44,null));};exports[_0x0b59('0x4b')]=function(_0x4d4797,_0x55857d){return db[_0x0b59('0x47')][_0x0b59('0x4b')](_0x4d4797[_0x0b59('0x4c')],{})[_0x0b59('0x25')](function(_0xbacc22){var _0x1f8aa2=_0x4d4797[_0x0b59('0x4d')][_0x0b59('0x27')]({'plain':!![]});if(!_0x1f8aa2)throw new Error(_0x0b59('0x4e'));if(_0x1f8aa2[_0x0b59('0x4f')]===_0x0b59('0x4d')){var _0x4df153=_0xbacc22[_0x0b59('0x27')]({'plain':!![]});var _0x1ca98f='Dispositions';return db[_0x0b59('0x50')][_0x0b59('0x51')]({'where':{'name':_0x1ca98f,'userProfileId':_0x1f8aa2['userProfileId']},'raw':!![]})['then'](function(_0x562e29){if(_0x562e29&&_0x562e29[_0x0b59('0x52')]===0x0){return db[_0x0b59('0x53')][_0x0b59('0x4b')]({'name':_0x4df153[_0x0b59('0x29')],'resourceId':_0x4df153['id'],'type':_0x562e29['name'],'sectionId':_0x562e29['id']},{})[_0x0b59('0x25')](function(){return _0xbacc22;});}else{return _0xbacc22;}})[_0x0b59('0x4a')](function(_0x41f6bc){logger[_0x0b59('0x54')](_0x0b59('0x55'),_0x41f6bc);throw _0x41f6bc;});}return _0xbacc22;})[_0x0b59('0x25')](respondWithResult(_0x55857d,0xc9))[_0x0b59('0x4a')](handleError(_0x55857d,null));};exports[_0x0b59('0x56')]=function(_0x2bc37b,_0x4d4c26){if(_0x2bc37b['body']['id']){delete _0x2bc37b[_0x0b59('0x4c')]['id'];}return db['Disposition']['find']({'where':{'id':_0x2bc37b['params']['id']}})[_0x0b59('0x25')](handleEntityNotFound(_0x4d4c26,null))[_0x0b59('0x25')](saveUpdates(_0x2bc37b[_0x0b59('0x4c')],null))[_0x0b59('0x25')](respondWithResult(_0x4d4c26,null))[_0x0b59('0x4a')](handleError(_0x4d4c26,null));};exports[_0x0b59('0x26')]=function(_0x2f9262,_0x5a0cce){return db[_0x0b59('0x47')][_0x0b59('0x51')]({'where':{'id':_0x2f9262[_0x0b59('0x57')]['id']}})[_0x0b59('0x25')](handleEntityNotFound(_0x5a0cce,null))['then'](removeEntity(_0x5a0cce,null))[_0x0b59('0x4a')](handleError(_0x5a0cce,null));};
\ No newline at end of file