Built motion from commit df3e9871f6bcc3432fec345b2f4facbd4dba8b5c. Version 3.0.0...
[motion-next.git] / server / api / squareOdbc / squareOdbc.controller.js
index b8297b4..3177a10 100644 (file)
@@ -1 +1 @@
-const a593_0x151a=['dsn','send','filters','UserProfileResource','closeSync','SquareOdbc','merge','../../config/logger','name','attributes','create','options','openSync','intersection','offset','keys','query','update','nolimit','key','includeAll','catch','rawAttributes','odbc','where','autoAssociation','stack','userProfileId','undefined','VIRTUAL','status','Unable\x20to\x20retrieve\x20the\x20current\x20user','body','ODBC','test','filter','findOne','params','lodash','map','api','../../components/parsers/qs','sort','findAll','destroy','then','UserProfileSection','json','include','rows','model','sequelize','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','length','type','limit','count','fields','set','order','pick'];(function(_0x3f9a7c,_0x151a82){const _0x404633=function(_0x1f7dbe){while(--_0x1f7dbe){_0x3f9a7c['push'](_0x3f9a7c['shift']());}};_0x404633(++_0x151a82);}(a593_0x151a,0x1dd));const a593_0x4046=function(_0x3f9a7c,_0x151a82){_0x3f9a7c=_0x3f9a7c-0x0;let _0x404633=a593_0x151a[_0x3f9a7c];return _0x404633;};const _0x2cc774=a593_0x4046;'use strict';const _=require(_0x2cc774('0x31')),qs=require(_0x2cc774('0x34')),logger=require(_0x2cc774('0x12'))(_0x2cc774('0x33')),db=require('../../mysqldb')['db'],{Op}=require(_0x2cc774('0x1'));function respondWithResult(_0x1f7dbe,_0x35043a){return _0x35043a=_0x35043a||0xc8,function(_0x4162e2){const _0x480bb7=a593_0x4046;if(_0x4162e2)return _0x1f7dbe[_0x480bb7('0x29')](_0x35043a)[_0x480bb7('0x3a')](_0x4162e2);};}function respondWithFilteredResult(_0x4ef6f2,_0x22e2d7){return function(_0x8ff62e){const _0x385d18=a593_0x4046;if(_0x8ff62e){const _0x1d069e=_0x8ff62e[_0x385d18('0x6')],_0x508647=_0x22e2d7[_0x385d18('0x19')];let _0x11c380=_0x22e2d7[_0x385d18('0x19')]+_0x22e2d7[_0x385d18('0x5')],_0x49c5f7;return _0x11c380>=_0x1d069e?(_0x11c380=_0x1d069e,_0x49c5f7=0xc8):_0x49c5f7=0xce,_0x4ef6f2[_0x385d18('0x29')](_0x49c5f7),_0x4ef6f2[_0x385d18('0x8')]('Content-Range',_0x508647+'-'+_0x11c380+'/'+_0x1d069e)[_0x385d18('0x3a')](_0x8ff62e);}return null;};}function saveUpdates(_0x396238){return function(_0x5d0168){const _0x55dd16=a593_0x4046;if(_0x5d0168)return _0x5d0168[_0x55dd16('0x1c')](_0x396238)[_0x55dd16('0x38')](function(_0x318704){return _0x318704;});return null;};}function removeEntity(_0x13c371){return function(_0x3e951e){const _0x34fda2=a593_0x4046;if(_0x3e951e)return _0x3e951e[_0x34fda2('0x37')]()[_0x34fda2('0x38')](function(){const _0x4d4484=_0x34fda2,_0x3018dc=_0x3e951e['get']({'plain':!![]}),_0x2b4391=_0x4d4484('0x2c');return db[_0x4d4484('0xe')][_0x4d4484('0x37')]({'where':{'type':_0x2b4391,'resourceId':_0x3018dc['id']}})[_0x4d4484('0x38')](function(){return _0x3e951e;});})[_0x34fda2('0x38')](function(){const _0x326e40=_0x34fda2;_0x13c371[_0x326e40('0x29')](0xcc)['end']();});};}function handleEntityNotFound(_0xd1674d){return function(_0x140cb8){return!_0x140cb8&&_0xd1674d['sendStatus'](0x194),_0x140cb8;};}function handleError(_0x1f897,_0x3e5787){return _0x3e5787=_0x3e5787||0x1f4,function(_0x2a999f){const _0x56aee5=a593_0x4046;logger['error'](_0x2a999f[_0x56aee5('0x25')]),_0x2a999f['name']&&delete _0x2a999f['name'],_0x1f897['status'](_0x3e5787)[_0x56aee5('0xc')](_0x2a999f);};}exports['index']=function(_0x28e79e,_0x22dbde){const _0x10df12=_0x2cc774;let _0x539b1c={};const _0x5b567e={},_0x5551eb={'count':0x0,'rows':[]},_0x2093d6=_['map'](db[_0x10df12('0x10')][_0x10df12('0x21')],function(_0x3900c3){const _0x1c0069=_0x10df12;return{'name':_0x3900c3['fieldName'],'type':_0x3900c3['type'][_0x1c0069('0x1e')]};});_0x5b567e[_0x10df12('0x0')]=_[_0x10df12('0x32')](_0x2093d6,_0x10df12('0x13')),_0x5b567e['query']=_[_0x10df12('0x1a')](_0x28e79e[_0x10df12('0x1b')]),_0x5b567e['filters']=_[_0x10df12('0x18')](_0x5b567e['model'],_0x5b567e[_0x10df12('0x1b')]),_0x539b1c['attributes']=_[_0x10df12('0x18')](_0x5b567e[_0x10df12('0x0')],qs[_0x10df12('0x7')](_0x28e79e[_0x10df12('0x1b')][_0x10df12('0x7')])),_0x539b1c[_0x10df12('0x14')]=_0x539b1c['attributes'][_0x10df12('0x3')]?_0x539b1c['attributes']:_0x5b567e[_0x10df12('0x0')];typeof _0x28e79e['query'][_0x10df12('0x1d')]===_0x10df12('0x27')&&(_0x539b1c['limit']=qs[_0x10df12('0x5')](_0x28e79e[_0x10df12('0x1b')][_0x10df12('0x5')]),_0x539b1c[_0x10df12('0x19')]=qs[_0x10df12('0x19')](_0x28e79e[_0x10df12('0x1b')]['offset']));_0x539b1c[_0x10df12('0x9')]=qs[_0x10df12('0x35')](_0x28e79e[_0x10df12('0x1b')][_0x10df12('0x35')]),_0x539b1c['where']=qs[_0x10df12('0xd')](_[_0x10df12('0xa')](_0x28e79e[_0x10df12('0x1b')],_0x5b567e[_0x10df12('0xd')]),_0x2093d6);_0x28e79e[_0x10df12('0x1b')]['filter']&&(_0x539b1c[_0x10df12('0x23')]=_['merge'](_0x539b1c[_0x10df12('0x23')],{[Op['or']]:_[_0x10df12('0x32')](_0x2093d6,function(_0xa5d66e){const _0x8ebdd3=_0x10df12;if(_0xa5d66e[_0x8ebdd3('0x4')]!==_0x8ebdd3('0x28')){const _0x3fc969={};return _0x3fc969[_0xa5d66e[_0x8ebdd3('0x13')]]={[Op['like']]:'%'+_0x28e79e[_0x8ebdd3('0x1b')][_0x8ebdd3('0x2e')]+'%'},_0x3fc969;}})}));_0x539b1c=_[_0x10df12('0x11')]({},_0x539b1c,_0x28e79e[_0x10df12('0x16')]);const _0x38b3bd={'where':_0x539b1c[_0x10df12('0x23')]};return db['SquareOdbc'][_0x10df12('0x6')](_0x38b3bd)[_0x10df12('0x38')](function(_0xcb60c7){const _0x28f0c7=_0x10df12;return _0x5551eb[_0x28f0c7('0x6')]=_0xcb60c7,_0x28e79e[_0x28f0c7('0x1b')]['includeAll']&&(_0x539b1c[_0x28f0c7('0x3b')]=[{'all':!![]}]),db[_0x28f0c7('0x10')][_0x28f0c7('0x36')](_0x539b1c);})[_0x10df12('0x38')](function(_0x3ea20a){const _0x17b1fc=_0x10df12;return _0x5551eb[_0x17b1fc('0x3c')]=_0x3ea20a,_0x5551eb;})['then'](respondWithFilteredResult(_0x22dbde,_0x539b1c))[_0x10df12('0x20')](handleError(_0x22dbde,null));},exports['show']=function(_0x21615e,_0x2cc9f7){const _0x36d6d3=_0x2cc774;let _0x2c1099={'raw':!![],'where':{'id':_0x21615e[_0x36d6d3('0x30')]['id']}};const _0x599752={};return _0x599752[_0x36d6d3('0x0')]=_[_0x36d6d3('0x1a')](db['SquareOdbc'][_0x36d6d3('0x21')]),_0x599752['query']=_['keys'](_0x21615e[_0x36d6d3('0x1b')]),_0x599752[_0x36d6d3('0xd')]=_[_0x36d6d3('0x18')](_0x599752[_0x36d6d3('0x0')],_0x599752[_0x36d6d3('0x1b')]),_0x2c1099['attributes']=_[_0x36d6d3('0x18')](_0x599752['model'],qs[_0x36d6d3('0x7')](_0x21615e[_0x36d6d3('0x1b')]['fields'])),_0x2c1099['attributes']=_0x2c1099[_0x36d6d3('0x14')][_0x36d6d3('0x3')]?_0x2c1099[_0x36d6d3('0x14')]:_0x599752[_0x36d6d3('0x0')],_0x21615e[_0x36d6d3('0x1b')][_0x36d6d3('0x1f')]&&(_0x2c1099[_0x36d6d3('0x3b')]=[{'all':!![]}]),_0x2c1099=_['merge']({},_0x2c1099,_0x21615e[_0x36d6d3('0x16')]),db[_0x36d6d3('0x10')][_0x36d6d3('0x2f')](_0x2c1099)[_0x36d6d3('0x38')](handleEntityNotFound(_0x2cc9f7,null))[_0x36d6d3('0x38')](respondWithResult(_0x2cc9f7,null))[_0x36d6d3('0x20')](handleError(_0x2cc9f7,null));},exports[_0x2cc774('0x15')]=function(_0x40d13b,_0x147392){const _0x414d4f=_0x2cc774;return db[_0x414d4f('0x10')][_0x414d4f('0x15')](_0x40d13b['body'],{})[_0x414d4f('0x38')](function(_0x94c1d6){const _0x2e65f4=_0x414d4f,_0x2ca351=_0x40d13b['user']['get']({'plain':!![]});if(!_0x2ca351)throw new Error(_0x2e65f4('0x2a'));if(_0x2ca351['role']==='user'){const _0x3ec01f=_0x94c1d6['get']({'plain':!![]}),_0x2b477a=_0x2e65f4('0x2c');return db[_0x2e65f4('0x39')][_0x2e65f4('0x2f')]({'where':{'name':_0x2b477a,'userProfileId':_0x2ca351[_0x2e65f4('0x26')]},'raw':!![]})[_0x2e65f4('0x38')](function(_0x16f53d){const _0x57859e=_0x2e65f4;return _0x16f53d&&_0x16f53d[_0x57859e('0x24')]===0x0?db['UserProfileResource']['create']({'name':_0x3ec01f['name'],'resourceId':_0x3ec01f['id'],'type':_0x16f53d[_0x57859e('0x13')],'sectionId':_0x16f53d['id']},{})[_0x57859e('0x38')](function(){return _0x94c1d6;}):_0x94c1d6;})['catch'](function(_0x28679b){const _0x5335b4=_0x2e65f4;logger['error'](_0x5335b4('0x2'),_0x28679b);throw _0x28679b;});}return _0x94c1d6;})['then'](respondWithResult(_0x147392,0xc9))['catch'](handleError(_0x147392,null));},exports[_0x2cc774('0x1c')]=function(_0x10862f,_0x1626a5){const _0x3f46cd=_0x2cc774;return _0x10862f[_0x3f46cd('0x2b')]['id']&&delete _0x10862f['body']['id'],db[_0x3f46cd('0x10')][_0x3f46cd('0x2f')]({'where':{'id':_0x10862f['params']['id']}})[_0x3f46cd('0x38')](handleEntityNotFound(_0x1626a5,null))[_0x3f46cd('0x38')](saveUpdates(_0x10862f[_0x3f46cd('0x2b')],null))[_0x3f46cd('0x38')](respondWithResult(_0x1626a5,null))[_0x3f46cd('0x20')](handleError(_0x1626a5,null));},exports[_0x2cc774('0x37')]=function(_0x5a58fb,_0x14be91){const _0x30de64=_0x2cc774;return db[_0x30de64('0x10')][_0x30de64('0x2f')]({'where':{'id':_0x5a58fb[_0x30de64('0x30')]['id']}})['then'](handleEntityNotFound(_0x14be91,null))[_0x30de64('0x38')](removeEntity(_0x14be91,null))[_0x30de64('0x20')](handleError(_0x14be91,null));},exports[_0x2cc774('0x2d')]=function(_0x911c16,_0xfa8ce3){const _0x357916=_0x2cc774;return db['SquareOdbc'][_0x357916('0x2f')]({'where':{'id':_0x911c16[_0x357916('0x30')]['id']},'attributes':['id',_0x357916('0xb')]})[_0x357916('0x38')](handleEntityNotFound(_0xfa8ce3,null))[_0x357916('0x38')](function(_0x6ced0a){const _0x4a667c=_0x357916;if(_0x6ced0a){const _0x461855=require(_0x4a667c('0x22'))();return _0x461855[_0x4a667c('0x17')](_0x6ced0a[_0x4a667c('0xb')]),_0x461855[_0x4a667c('0xf')](),_0x6ced0a;}})[_0x357916('0x38')](respondWithResult(_0xfa8ce3,null))[_0x357916('0x20')](handleError(_0xfa8ce3,null));};
\ No newline at end of file
+const a593_0x3811=['key','test','UserProfileResource','intersection','userProfileId','create','like','send','json','then','where','Unable\x20to\x20retrieve\x20the\x20current\x20user','merge','role','body','filters','../../config/logger','SquareOdbc','model','autoAssociation','get','filter','rawAttributes','api','offset','undefined','sendStatus','user','keys','query','fieldName','findOne','stack','name','sort','error','destroy','limit','options','length','count','ODBC','params','dsn','sequelize','update','../../components/parsers/qs','order','type','catch','set','includeAll','attributes','show','findAll','odbc','pick','status','fields','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','end','include','map','rows'];(function(_0x288c09,_0x38111f){const _0x3bbdfe=function(_0x427571){while(--_0x427571){_0x288c09['push'](_0x288c09['shift']());}};_0x3bbdfe(++_0x38111f);}(a593_0x3811,0x149));const a593_0x3bbd=function(_0x288c09,_0x38111f){_0x288c09=_0x288c09-0x0;let _0x3bbdfe=a593_0x3811[_0x288c09];return _0x3bbdfe;};const _0x4deaf8=a593_0x3bbd;'use strict';const _=require('lodash'),qs=require(_0x4deaf8('0x25')),logger=require(_0x4deaf8('0x7'))(_0x4deaf8('0xe')),db=require('../../mysqldb')['db'],{Op}=require(_0x4deaf8('0x23'));function respondWithResult(_0x427571,_0x4f0779){return _0x4f0779=_0x4f0779||0xc8,function(_0x178b5e){const _0x5dac0c=a593_0x3bbd;if(_0x178b5e)return _0x427571[_0x5dac0c('0x30')](_0x4f0779)['json'](_0x178b5e);};}function respondWithFilteredResult(_0x4052b2,_0x440bff){return function(_0x286aba){const _0x4c8395=a593_0x3bbd;if(_0x286aba){const _0x1354a5=_0x286aba['count'],_0x491596=_0x440bff[_0x4c8395('0xf')];let _0x57b053=_0x440bff[_0x4c8395('0xf')]+_0x440bff[_0x4c8395('0x1c')],_0x2a40ac;return _0x57b053>=_0x1354a5?(_0x57b053=_0x1354a5,_0x2a40ac=0xc8):_0x2a40ac=0xce,_0x4052b2[_0x4c8395('0x30')](_0x2a40ac),_0x4052b2[_0x4c8395('0x29')]('Content-Range',_0x491596+'-'+_0x57b053+'/'+_0x1354a5)[_0x4c8395('0x3f')](_0x286aba);}return null;};}function saveUpdates(_0x2154e4){return function(_0x1b872f){const _0x330310=a593_0x3bbd;if(_0x1b872f)return _0x1b872f['update'](_0x2154e4)[_0x330310('0x0')](function(_0x2c5bb4){return _0x2c5bb4;});return null;};}function removeEntity(_0x537c2b){return function(_0x220aa2){if(_0x220aa2)return _0x220aa2['destroy']()['then'](function(){const _0x3d87fd=a593_0x3bbd,_0x3d78ac=_0x220aa2[_0x3d87fd('0xb')]({'plain':!![]}),_0x366a28=_0x3d87fd('0x20');return db[_0x3d87fd('0x39')][_0x3d87fd('0x1b')]({'where':{'type':_0x366a28,'resourceId':_0x3d78ac['id']}})[_0x3d87fd('0x0')](function(){return _0x220aa2;});})['then'](function(){const _0x18f388=a593_0x3bbd;_0x537c2b[_0x18f388('0x30')](0xcc)[_0x18f388('0x33')]();});};}function handleEntityNotFound(_0x1538f9){return function(_0x296ab5){const _0x19331e=a593_0x3bbd;return!_0x296ab5&&_0x1538f9[_0x19331e('0x11')](0x194),_0x296ab5;};}function handleError(_0x4589dc,_0x467271){return _0x467271=_0x467271||0x1f4,function(_0x32d102){const _0x2e710b=a593_0x3bbd;logger[_0x2e710b('0x1a')](_0x32d102[_0x2e710b('0x17')]),_0x32d102['name']&&delete _0x32d102[_0x2e710b('0x18')],_0x4589dc['status'](_0x467271)[_0x2e710b('0x3e')](_0x32d102);};}exports['index']=function(_0x571254,_0x4f8276){const _0x47aaff=_0x4deaf8;let _0x119ff0={};const _0x1b957f={},_0x15720e={'count':0x0,'rows':[]},_0x4599ad=_['map'](db['SquareOdbc'][_0x47aaff('0xd')],function(_0x293bae){const _0x3ff50a=_0x47aaff;return{'name':_0x293bae[_0x3ff50a('0x15')],'type':_0x293bae[_0x3ff50a('0x27')][_0x3ff50a('0x37')]};});_0x1b957f[_0x47aaff('0x9')]=_[_0x47aaff('0x35')](_0x4599ad,'name'),_0x1b957f[_0x47aaff('0x14')]=_[_0x47aaff('0x13')](_0x571254[_0x47aaff('0x14')]),_0x1b957f['filters']=_['intersection'](_0x1b957f[_0x47aaff('0x9')],_0x1b957f[_0x47aaff('0x14')]),_0x119ff0['attributes']=_[_0x47aaff('0x3a')](_0x1b957f[_0x47aaff('0x9')],qs['fields'](_0x571254[_0x47aaff('0x14')]['fields'])),_0x119ff0[_0x47aaff('0x2b')]=_0x119ff0[_0x47aaff('0x2b')][_0x47aaff('0x1e')]?_0x119ff0[_0x47aaff('0x2b')]:_0x1b957f[_0x47aaff('0x9')];typeof _0x571254[_0x47aaff('0x14')]['nolimit']===_0x47aaff('0x10')&&(_0x119ff0[_0x47aaff('0x1c')]=qs[_0x47aaff('0x1c')](_0x571254[_0x47aaff('0x14')][_0x47aaff('0x1c')]),_0x119ff0['offset']=qs['offset'](_0x571254[_0x47aaff('0x14')]['offset']));_0x119ff0[_0x47aaff('0x26')]=qs[_0x47aaff('0x19')](_0x571254['query']['sort']),_0x119ff0['where']=qs[_0x47aaff('0x6')](_[_0x47aaff('0x2f')](_0x571254[_0x47aaff('0x14')],_0x1b957f['filters']),_0x4599ad);_0x571254[_0x47aaff('0x14')][_0x47aaff('0xc')]&&(_0x119ff0[_0x47aaff('0x1')]=_[_0x47aaff('0x3')](_0x119ff0[_0x47aaff('0x1')],{[Op['or']]:_[_0x47aaff('0x35')](_0x4599ad,function(_0x2d7180){const _0x2861af=_0x47aaff;if(_0x2d7180[_0x2861af('0x27')]!=='VIRTUAL'){const _0x11c100={};return _0x11c100[_0x2d7180[_0x2861af('0x18')]]={[Op[_0x2861af('0x3d')]]:'%'+_0x571254[_0x2861af('0x14')][_0x2861af('0xc')]+'%'},_0x11c100;}})}));_0x119ff0=_[_0x47aaff('0x3')]({},_0x119ff0,_0x571254[_0x47aaff('0x1d')]);const _0x1c997f={'where':_0x119ff0[_0x47aaff('0x1')]};return db[_0x47aaff('0x8')][_0x47aaff('0x1f')](_0x1c997f)[_0x47aaff('0x0')](function(_0x262d31){const _0x4eb6a9=_0x47aaff;return _0x15720e['count']=_0x262d31,_0x571254[_0x4eb6a9('0x14')][_0x4eb6a9('0x2a')]&&(_0x119ff0[_0x4eb6a9('0x34')]=[{'all':!![]}]),db[_0x4eb6a9('0x8')][_0x4eb6a9('0x2d')](_0x119ff0);})['then'](function(_0x4d12eb){const _0x2c1e7a=_0x47aaff;return _0x15720e[_0x2c1e7a('0x36')]=_0x4d12eb,_0x15720e;})[_0x47aaff('0x0')](respondWithFilteredResult(_0x4f8276,_0x119ff0))[_0x47aaff('0x28')](handleError(_0x4f8276,null));},exports[_0x4deaf8('0x2c')]=function(_0x52318b,_0x52bab9){const _0x9e1c92=_0x4deaf8;let _0x3251db={'raw':!![],'where':{'id':_0x52318b['params']['id']}};const _0x50f746={};return _0x50f746[_0x9e1c92('0x9')]=_[_0x9e1c92('0x13')](db[_0x9e1c92('0x8')][_0x9e1c92('0xd')]),_0x50f746['query']=_[_0x9e1c92('0x13')](_0x52318b['query']),_0x50f746['filters']=_[_0x9e1c92('0x3a')](_0x50f746[_0x9e1c92('0x9')],_0x50f746[_0x9e1c92('0x14')]),_0x3251db[_0x9e1c92('0x2b')]=_[_0x9e1c92('0x3a')](_0x50f746[_0x9e1c92('0x9')],qs[_0x9e1c92('0x31')](_0x52318b[_0x9e1c92('0x14')][_0x9e1c92('0x31')])),_0x3251db['attributes']=_0x3251db[_0x9e1c92('0x2b')][_0x9e1c92('0x1e')]?_0x3251db[_0x9e1c92('0x2b')]:_0x50f746[_0x9e1c92('0x9')],_0x52318b['query'][_0x9e1c92('0x2a')]&&(_0x3251db[_0x9e1c92('0x34')]=[{'all':!![]}]),_0x3251db=_[_0x9e1c92('0x3')]({},_0x3251db,_0x52318b[_0x9e1c92('0x1d')]),db[_0x9e1c92('0x8')][_0x9e1c92('0x16')](_0x3251db)['then'](handleEntityNotFound(_0x52bab9,null))[_0x9e1c92('0x0')](respondWithResult(_0x52bab9,null))[_0x9e1c92('0x28')](handleError(_0x52bab9,null));},exports[_0x4deaf8('0x3c')]=function(_0x11287e,_0x4badc3){const _0x9eb7a9=_0x4deaf8;return db['SquareOdbc']['create'](_0x11287e[_0x9eb7a9('0x5')],{})['then'](function(_0x5503cc){const _0x5708e8=_0x9eb7a9,_0x1c9413=_0x11287e[_0x5708e8('0x12')]['get']({'plain':!![]});if(!_0x1c9413)throw new Error(_0x5708e8('0x2'));if(_0x1c9413[_0x5708e8('0x4')]===_0x5708e8('0x12')){const _0x9c24ff=_0x5503cc[_0x5708e8('0xb')]({'plain':!![]}),_0x26e1d0=_0x5708e8('0x20');return db['UserProfileSection'][_0x5708e8('0x16')]({'where':{'name':_0x26e1d0,'userProfileId':_0x1c9413[_0x5708e8('0x3b')]},'raw':!![]})[_0x5708e8('0x0')](function(_0x2f6ada){const _0x152d52=_0x5708e8;return _0x2f6ada&&_0x2f6ada[_0x152d52('0xa')]===0x0?db[_0x152d52('0x39')][_0x152d52('0x3c')]({'name':_0x9c24ff[_0x152d52('0x18')],'resourceId':_0x9c24ff['id'],'type':_0x2f6ada[_0x152d52('0x18')],'sectionId':_0x2f6ada['id']},{})['then'](function(){return _0x5503cc;}):_0x5503cc;})[_0x5708e8('0x28')](function(_0x25ccfc){const _0xfb50eb=_0x5708e8;logger[_0xfb50eb('0x1a')](_0xfb50eb('0x32'),_0x25ccfc);throw _0x25ccfc;});}return _0x5503cc;})[_0x9eb7a9('0x0')](respondWithResult(_0x4badc3,0xc9))['catch'](handleError(_0x4badc3,null));},exports[_0x4deaf8('0x24')]=function(_0x1559ee,_0x32b71a){const _0x336ab4=_0x4deaf8;return _0x1559ee['body']['id']&&delete _0x1559ee[_0x336ab4('0x5')]['id'],db[_0x336ab4('0x8')][_0x336ab4('0x16')]({'where':{'id':_0x1559ee[_0x336ab4('0x21')]['id']}})[_0x336ab4('0x0')](handleEntityNotFound(_0x32b71a,null))[_0x336ab4('0x0')](saveUpdates(_0x1559ee['body'],null))[_0x336ab4('0x0')](respondWithResult(_0x32b71a,null))[_0x336ab4('0x28')](handleError(_0x32b71a,null));},exports['destroy']=function(_0x76d17b,_0x18b36a){const _0x468b1a=_0x4deaf8;return db[_0x468b1a('0x8')][_0x468b1a('0x16')]({'where':{'id':_0x76d17b[_0x468b1a('0x21')]['id']}})[_0x468b1a('0x0')](handleEntityNotFound(_0x18b36a,null))[_0x468b1a('0x0')](removeEntity(_0x18b36a,null))[_0x468b1a('0x28')](handleError(_0x18b36a,null));},exports[_0x4deaf8('0x38')]=function(_0xacee43,_0x3a6797){const _0x4a9353=_0x4deaf8;return db['SquareOdbc'][_0x4a9353('0x16')]({'where':{'id':_0xacee43['params']['id']},'attributes':['id','dsn']})[_0x4a9353('0x0')](handleEntityNotFound(_0x3a6797,null))[_0x4a9353('0x0')](function(_0x11bd94){const _0x325c9a=_0x4a9353;if(_0x11bd94){const _0x1e1431=require(_0x325c9a('0x2e'))();return _0x1e1431['openSync'](_0x11bd94[_0x325c9a('0x22')]),_0x1e1431['closeSync'](),_0x11bd94;}})[_0x4a9353('0x0')](respondWithResult(_0x3a6797,null))[_0x4a9353('0x28')](handleError(_0x3a6797,null));};
\ No newline at end of file