Built motion from commit c49361c37b5f784889c8087ac6e0e91b7e6b561a. Version 3.0.0...
[motion-next.git] / server / api / squareOdbc / squareOdbc.controller.js
index 36d80c8..b0ad7b2 100644 (file)
@@ -1 +1 @@
-const a593_0x5bb7=['user','filters','undefined','dsn','userProfileId','json','lodash','offset','findOne','UserProfileSection','includeAll','findAll','SquareOdbc','autoAssociation','status','fields','model','test','sendStatus','show','stack','name','attributes','order','catch','get','destroy','merge','sort','limit','rawAttributes','filter','UserProfileResource','role','intersection','Content-Range','query','ODBC','fieldName','create','then','update','error','keys','length','include','Unable\x20to\x20retrieve\x20the\x20current\x20user','map','sequelize','where','set','body','index','pick','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','type','options','like','count','params','VIRTUAL'];(function(_0x5c9999,_0x5bb7c2){const _0x240e76=function(_0x1a30e4){while(--_0x1a30e4){_0x5c9999['push'](_0x5c9999['shift']());}};_0x240e76(++_0x5bb7c2);}(a593_0x5bb7,0x109));const a593_0x240e=function(_0x5c9999,_0x5bb7c2){_0x5c9999=_0x5c9999-0x0;let _0x240e76=a593_0x5bb7[_0x5c9999];return _0x240e76;};const _0x41f7cc=a593_0x240e;'use strict';const _=require(_0x41f7cc('0x33')),qs=require('../../components/parsers/qs'),logger=require('../../config/logger')('api'),db=require('../../mysqldb')['db'],{Op}=require(_0x41f7cc('0x1f'));function respondWithResult(_0x1a30e4,_0x329b71){return _0x329b71=_0x329b71||0xc8,function(_0x5ce122){const _0x232e1d=a593_0x240e;if(_0x5ce122)return _0x1a30e4[_0x232e1d('0x3b')](_0x329b71)[_0x232e1d('0x32')](_0x5ce122);};}function respondWithFilteredResult(_0x18a7a3,_0x3c568d){return function(_0x2633b0){const _0x430acf=a593_0x240e;if(_0x2633b0){const _0xb5c908=_0x2633b0[_0x430acf('0x2a')],_0x33bcb5=_0x3c568d[_0x430acf('0x34')];let _0x583fb5=_0x3c568d[_0x430acf('0x34')]+_0x3c568d[_0x430acf('0xc')],_0x439ab4;return _0x583fb5>=_0xb5c908?(_0x583fb5=_0xb5c908,_0x439ab4=0xc8):_0x439ab4=0xce,_0x18a7a3[_0x430acf('0x3b')](_0x439ab4),_0x18a7a3[_0x430acf('0x21')](_0x430acf('0x12'),_0x33bcb5+'-'+_0x583fb5+'/'+_0xb5c908)['json'](_0x2633b0);}return null;};}function saveUpdates(_0xa71d9f){return function(_0x48588e){const _0x387d91=a593_0x240e;if(_0x48588e)return _0x48588e[_0x387d91('0x18')](_0xa71d9f)[_0x387d91('0x17')](function(_0x3905d1){return _0x3905d1;});return null;};}function removeEntity(_0x3f39cf){return function(_0x54d6a1){const _0x38fb06=a593_0x240e;if(_0x54d6a1)return _0x54d6a1[_0x38fb06('0x9')]()[_0x38fb06('0x17')](function(){const _0x36a4c6=_0x38fb06,_0x172c75=_0x54d6a1[_0x36a4c6('0x8')]({'plain':!![]}),_0x1134ea=_0x36a4c6('0x14');return db[_0x36a4c6('0xf')]['destroy']({'where':{'type':_0x1134ea,'resourceId':_0x172c75['id']}})[_0x36a4c6('0x17')](function(){return _0x54d6a1;});})[_0x38fb06('0x17')](function(){const _0x237814=_0x38fb06;_0x3f39cf[_0x237814('0x3b')](0xcc)['end']();});};}function handleEntityNotFound(_0x5ac086){return function(_0x5efec4){const _0x141c10=a593_0x240e;return!_0x5efec4&&_0x5ac086[_0x141c10('0x1')](0x194),_0x5efec4;};}function handleError(_0x7fb285,_0x85f7a4){return _0x85f7a4=_0x85f7a4||0x1f4,function(_0x427ed6){const _0x17dbff=a593_0x240e;logger[_0x17dbff('0x19')](_0x427ed6[_0x17dbff('0x3')]),_0x427ed6[_0x17dbff('0x4')]&&delete _0x427ed6['name'],_0x7fb285['status'](_0x85f7a4)[_0x17dbff('0x26')](_0x427ed6);};}exports[_0x41f7cc('0x23')]=function(_0x4e25d7,_0x4d7e85){const _0x161b0a=_0x41f7cc;let _0x4656c8={};const _0x546bfb={},_0x2ec389={'count':0x0,'rows':[]},_0x4188b8=_[_0x161b0a('0x1e')](db[_0x161b0a('0x39')][_0x161b0a('0xd')],function(_0x461d3b){const _0x20bdf9=_0x161b0a;return{'name':_0x461d3b[_0x20bdf9('0x15')],'type':_0x461d3b[_0x20bdf9('0x27')]['key']};});_0x546bfb[_0x161b0a('0x3d')]=_[_0x161b0a('0x1e')](_0x4188b8,'name'),_0x546bfb[_0x161b0a('0x13')]=_[_0x161b0a('0x1a')](_0x4e25d7[_0x161b0a('0x13')]),_0x546bfb[_0x161b0a('0x2e')]=_[_0x161b0a('0x11')](_0x546bfb['model'],_0x546bfb[_0x161b0a('0x13')]),_0x4656c8[_0x161b0a('0x5')]=_[_0x161b0a('0x11')](_0x546bfb[_0x161b0a('0x3d')],qs[_0x161b0a('0x3c')](_0x4e25d7['query'][_0x161b0a('0x3c')])),_0x4656c8[_0x161b0a('0x5')]=_0x4656c8[_0x161b0a('0x5')][_0x161b0a('0x1b')]?_0x4656c8[_0x161b0a('0x5')]:_0x546bfb[_0x161b0a('0x3d')];typeof _0x4e25d7[_0x161b0a('0x13')]['nolimit']===_0x161b0a('0x2f')&&(_0x4656c8[_0x161b0a('0xc')]=qs[_0x161b0a('0xc')](_0x4e25d7[_0x161b0a('0x13')]['limit']),_0x4656c8['offset']=qs[_0x161b0a('0x34')](_0x4e25d7[_0x161b0a('0x13')][_0x161b0a('0x34')]));_0x4656c8[_0x161b0a('0x6')]=qs[_0x161b0a('0xb')](_0x4e25d7['query'][_0x161b0a('0xb')]),_0x4656c8[_0x161b0a('0x20')]=qs[_0x161b0a('0x2e')](_[_0x161b0a('0x24')](_0x4e25d7[_0x161b0a('0x13')],_0x546bfb[_0x161b0a('0x2e')]),_0x4188b8);_0x4e25d7[_0x161b0a('0x13')]['filter']&&(_0x4656c8[_0x161b0a('0x20')]=_[_0x161b0a('0xa')](_0x4656c8['where'],{[Op['or']]:_[_0x161b0a('0x1e')](_0x4188b8,function(_0x44d411){const _0xf8f936=_0x161b0a;if(_0x44d411[_0xf8f936('0x27')]!==_0xf8f936('0x2c')){const _0x1f8361={};return _0x1f8361[_0x44d411[_0xf8f936('0x4')]]={[Op[_0xf8f936('0x29')]]:'%'+_0x4e25d7[_0xf8f936('0x13')][_0xf8f936('0xe')]+'%'},_0x1f8361;}})}));_0x4656c8=_['merge']({},_0x4656c8,_0x4e25d7['options']);const _0x271a75={'where':_0x4656c8[_0x161b0a('0x20')]};return db[_0x161b0a('0x39')][_0x161b0a('0x2a')](_0x271a75)['then'](function(_0x4a8f18){const _0x3ef3c3=_0x161b0a;return _0x2ec389[_0x3ef3c3('0x2a')]=_0x4a8f18,_0x4e25d7['query'][_0x3ef3c3('0x37')]&&(_0x4656c8[_0x3ef3c3('0x1c')]=[{'all':!![]}]),db['SquareOdbc'][_0x3ef3c3('0x38')](_0x4656c8);})[_0x161b0a('0x17')](function(_0x2e25e8){return _0x2ec389['rows']=_0x2e25e8,_0x2ec389;})[_0x161b0a('0x17')](respondWithFilteredResult(_0x4d7e85,_0x4656c8))['catch'](handleError(_0x4d7e85,null));},exports[_0x41f7cc('0x2')]=function(_0x475acf,_0x11ba1d){const _0x598a35=_0x41f7cc;let _0x17d1da={'raw':!![],'where':{'id':_0x475acf[_0x598a35('0x2b')]['id']}};const _0x47a3bb={};return _0x47a3bb['model']=_[_0x598a35('0x1a')](db[_0x598a35('0x39')]['rawAttributes']),_0x47a3bb['query']=_[_0x598a35('0x1a')](_0x475acf['query']),_0x47a3bb[_0x598a35('0x2e')]=_[_0x598a35('0x11')](_0x47a3bb[_0x598a35('0x3d')],_0x47a3bb[_0x598a35('0x13')]),_0x17d1da['attributes']=_['intersection'](_0x47a3bb[_0x598a35('0x3d')],qs[_0x598a35('0x3c')](_0x475acf[_0x598a35('0x13')][_0x598a35('0x3c')])),_0x17d1da['attributes']=_0x17d1da[_0x598a35('0x5')][_0x598a35('0x1b')]?_0x17d1da[_0x598a35('0x5')]:_0x47a3bb['model'],_0x475acf[_0x598a35('0x13')][_0x598a35('0x37')]&&(_0x17d1da[_0x598a35('0x1c')]=[{'all':!![]}]),_0x17d1da=_[_0x598a35('0xa')]({},_0x17d1da,_0x475acf[_0x598a35('0x28')]),db[_0x598a35('0x39')][_0x598a35('0x35')](_0x17d1da)['then'](handleEntityNotFound(_0x11ba1d,null))[_0x598a35('0x17')](respondWithResult(_0x11ba1d,null))[_0x598a35('0x7')](handleError(_0x11ba1d,null));},exports[_0x41f7cc('0x16')]=function(_0x1fde2f,_0x1743ed){const _0x32d22b=_0x41f7cc;return db[_0x32d22b('0x39')][_0x32d22b('0x16')](_0x1fde2f['body'],{})[_0x32d22b('0x17')](function(_0x362dff){const _0x4352f2=_0x32d22b,_0x54dcc4=_0x1fde2f[_0x4352f2('0x2d')]['get']({'plain':!![]});if(!_0x54dcc4)throw new Error(_0x4352f2('0x1d'));if(_0x54dcc4[_0x4352f2('0x10')]===_0x4352f2('0x2d')){const _0x5656d1=_0x362dff['get']({'plain':!![]}),_0x5b59db=_0x4352f2('0x14');return db[_0x4352f2('0x36')][_0x4352f2('0x35')]({'where':{'name':_0x5b59db,'userProfileId':_0x54dcc4[_0x4352f2('0x31')]},'raw':!![]})[_0x4352f2('0x17')](function(_0x5d0932){const _0x308904=_0x4352f2;return _0x5d0932&&_0x5d0932[_0x308904('0x3a')]===0x0?db[_0x308904('0xf')]['create']({'name':_0x5656d1['name'],'resourceId':_0x5656d1['id'],'type':_0x5d0932[_0x308904('0x4')],'sectionId':_0x5d0932['id']},{})[_0x308904('0x17')](function(){return _0x362dff;}):_0x362dff;})[_0x4352f2('0x7')](function(_0x3c87b2){const _0x25f54d=_0x4352f2;logger['error'](_0x25f54d('0x25'),_0x3c87b2);throw _0x3c87b2;});}return _0x362dff;})[_0x32d22b('0x17')](respondWithResult(_0x1743ed,0xc9))[_0x32d22b('0x7')](handleError(_0x1743ed,null));},exports[_0x41f7cc('0x18')]=function(_0x2c84f7,_0x282043){const _0x2dc990=_0x41f7cc;return _0x2c84f7[_0x2dc990('0x22')]['id']&&delete _0x2c84f7[_0x2dc990('0x22')]['id'],db['SquareOdbc'][_0x2dc990('0x35')]({'where':{'id':_0x2c84f7[_0x2dc990('0x2b')]['id']}})[_0x2dc990('0x17')](handleEntityNotFound(_0x282043,null))[_0x2dc990('0x17')](saveUpdates(_0x2c84f7[_0x2dc990('0x22')],null))[_0x2dc990('0x17')](respondWithResult(_0x282043,null))[_0x2dc990('0x7')](handleError(_0x282043,null));},exports[_0x41f7cc('0x9')]=function(_0x450b7a,_0x446655){const _0x3d0cad=_0x41f7cc;return db[_0x3d0cad('0x39')][_0x3d0cad('0x35')]({'where':{'id':_0x450b7a[_0x3d0cad('0x2b')]['id']}})[_0x3d0cad('0x17')](handleEntityNotFound(_0x446655,null))[_0x3d0cad('0x17')](removeEntity(_0x446655,null))[_0x3d0cad('0x7')](handleError(_0x446655,null));},exports[_0x41f7cc('0x0')]=function(_0x543d6d,_0x4a2667){const _0x4c060e=_0x41f7cc;return db[_0x4c060e('0x39')][_0x4c060e('0x35')]({'where':{'id':_0x543d6d['params']['id']},'attributes':['id','dsn']})[_0x4c060e('0x17')](handleEntityNotFound(_0x4a2667,null))[_0x4c060e('0x17')](function(_0x211f8f){const _0x479c88=_0x4c060e;if(_0x211f8f){const _0x27db42=require('odbc')();return _0x27db42['openSync'](_0x211f8f[_0x479c88('0x30')]),_0x27db42['closeSync'](),_0x211f8f;}})[_0x4c060e('0x17')](respondWithResult(_0x4a2667,null))[_0x4c060e('0x7')](handleError(_0x4a2667,null));};
\ No newline at end of file
+const a593_0x30f4=['filter','rows','create','userProfileId','ODBC','findAll','includeAll','limit','include','length','key','closeSync','destroy','like','api','role','stack','name','show','fields','map','count','type','nolimit','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rawAttributes','get','SquareOdbc','merge','end','UserProfileResource','sort','offset','findOne','params','model','undefined','sequelize','index','query','attributes','sendStatus','autoAssociation','UserProfileSection','json','odbc','error','status','filters','intersection','body','keys','catch','then','../../mysqldb','send','openSync','user','dsn','update','where'];(function(_0x491ddb,_0x30f458){const _0x1b4df9=function(_0x4b1f97){while(--_0x4b1f97){_0x491ddb['push'](_0x491ddb['shift']());}};_0x1b4df9(++_0x30f458);}(a593_0x30f4,0xcd));const a593_0x1b4d=function(_0x491ddb,_0x30f458){_0x491ddb=_0x491ddb-0x0;let _0x1b4df9=a593_0x30f4[_0x491ddb];return _0x1b4df9;};const _0x2e908d=a593_0x1b4d;'use strict';const _=require('lodash'),qs=require('../../components/parsers/qs'),logger=require('../../config/logger')(_0x2e908d('0x35')),db=require(_0x2e908d('0x20'))['db'],{Op}=require(_0x2e908d('0xf'));function respondWithResult(_0x4b1f97,_0x267e9d){return _0x267e9d=_0x267e9d||0xc8,function(_0x5b2e99){const _0x1b9fa0=a593_0x1b4d;if(_0x5b2e99)return _0x4b1f97['status'](_0x267e9d)[_0x1b9fa0('0x16')](_0x5b2e99);};}function respondWithFilteredResult(_0x2522e4,_0x211fc1){return function(_0x33a683){const _0x14ef49=a593_0x1b4d;if(_0x33a683){const _0x30c5cf=_0x33a683[_0x14ef49('0x3c')],_0x4848e0=_0x211fc1[_0x14ef49('0xa')];let _0x1c8439=_0x211fc1[_0x14ef49('0xa')]+_0x211fc1['limit'],_0x5dc4da;return _0x1c8439>=_0x30c5cf?(_0x1c8439=_0x30c5cf,_0x5dc4da=0xc8):_0x5dc4da=0xce,_0x2522e4[_0x14ef49('0x19')](_0x5dc4da),_0x2522e4['set']('Content-Range',_0x4848e0+'-'+_0x1c8439+'/'+_0x30c5cf)[_0x14ef49('0x16')](_0x33a683);}return null;};}function saveUpdates(_0x5ee1d9){return function(_0x305c00){const _0x25e4af=a593_0x1b4d;if(_0x305c00)return _0x305c00[_0x25e4af('0x25')](_0x5ee1d9)[_0x25e4af('0x1f')](function(_0x7020ab){return _0x7020ab;});return null;};}function removeEntity(_0x2441cf){return function(_0x3b5f70){const _0x5495a3=a593_0x1b4d;if(_0x3b5f70)return _0x3b5f70[_0x5495a3('0x33')]()[_0x5495a3('0x1f')](function(){const _0x1382f2=_0x5495a3,_0x34bdae=_0x3b5f70['get']({'plain':!![]}),_0x4a74f8=_0x1382f2('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x4a74f8,'resourceId':_0x34bdae['id']}})[_0x1382f2('0x1f')](function(){return _0x3b5f70;});})[_0x5495a3('0x1f')](function(){const _0x197bd9=_0x5495a3;_0x2441cf[_0x197bd9('0x19')](0xcc)[_0x197bd9('0x7')]();});};}function handleEntityNotFound(_0x44ac98){return function(_0xcde4ff){const _0x3b7dc4=a593_0x1b4d;return!_0xcde4ff&&_0x44ac98[_0x3b7dc4('0x13')](0x194),_0xcde4ff;};}function handleError(_0x35f7b2,_0x5a8af9){return _0x5a8af9=_0x5a8af9||0x1f4,function(_0x1d3b15){const _0x5e46f1=a593_0x1b4d;logger[_0x5e46f1('0x18')](_0x1d3b15[_0x5e46f1('0x37')]),_0x1d3b15[_0x5e46f1('0x38')]&&delete _0x1d3b15[_0x5e46f1('0x38')],_0x35f7b2[_0x5e46f1('0x19')](_0x5a8af9)[_0x5e46f1('0x21')](_0x1d3b15);};}exports[_0x2e908d('0x10')]=function(_0x284066,_0x20acd1){const _0x3f19ca=_0x2e908d;let _0x1fe647={};const _0x559e87={},_0x1621ad={'count':0x0,'rows':[]},_0x4e2cce=_[_0x3f19ca('0x3b')](db[_0x3f19ca('0x5')][_0x3f19ca('0x3')],function(_0x240fdc){const _0x1f5c68=_0x3f19ca;return{'name':_0x240fdc['fieldName'],'type':_0x240fdc[_0x1f5c68('0x0')][_0x1f5c68('0x31')]};});_0x559e87[_0x3f19ca('0xd')]=_['map'](_0x4e2cce,_0x3f19ca('0x38')),_0x559e87['query']=_['keys'](_0x284066[_0x3f19ca('0x11')]),_0x559e87[_0x3f19ca('0x1a')]=_[_0x3f19ca('0x1b')](_0x559e87['model'],_0x559e87[_0x3f19ca('0x11')]),_0x1fe647[_0x3f19ca('0x12')]=_[_0x3f19ca('0x1b')](_0x559e87[_0x3f19ca('0xd')],qs['fields'](_0x284066[_0x3f19ca('0x11')][_0x3f19ca('0x3a')])),_0x1fe647['attributes']=_0x1fe647[_0x3f19ca('0x12')][_0x3f19ca('0x30')]?_0x1fe647['attributes']:_0x559e87['model'];typeof _0x284066[_0x3f19ca('0x11')][_0x3f19ca('0x1')]===_0x3f19ca('0xe')&&(_0x1fe647['limit']=qs[_0x3f19ca('0x2e')](_0x284066[_0x3f19ca('0x11')]['limit']),_0x1fe647[_0x3f19ca('0xa')]=qs[_0x3f19ca('0xa')](_0x284066['query'][_0x3f19ca('0xa')]));_0x1fe647['order']=qs[_0x3f19ca('0x9')](_0x284066[_0x3f19ca('0x11')][_0x3f19ca('0x9')]),_0x1fe647[_0x3f19ca('0x26')]=qs[_0x3f19ca('0x1a')](_['pick'](_0x284066[_0x3f19ca('0x11')],_0x559e87[_0x3f19ca('0x1a')]),_0x4e2cce);_0x284066[_0x3f19ca('0x11')]['filter']&&(_0x1fe647[_0x3f19ca('0x26')]=_[_0x3f19ca('0x6')](_0x1fe647[_0x3f19ca('0x26')],{[Op['or']]:_[_0x3f19ca('0x3b')](_0x4e2cce,function(_0x188cc2){const _0x5b2f2d=_0x3f19ca;if(_0x188cc2[_0x5b2f2d('0x0')]!=='VIRTUAL'){const _0x4f82d5={};return _0x4f82d5[_0x188cc2[_0x5b2f2d('0x38')]]={[Op[_0x5b2f2d('0x34')]]:'%'+_0x284066[_0x5b2f2d('0x11')][_0x5b2f2d('0x27')]+'%'},_0x4f82d5;}})}));_0x1fe647=_[_0x3f19ca('0x6')]({},_0x1fe647,_0x284066['options']);const _0x5b7688={'where':_0x1fe647[_0x3f19ca('0x26')]};return db['SquareOdbc']['count'](_0x5b7688)[_0x3f19ca('0x1f')](function(_0x56b243){const _0x4921b5=_0x3f19ca;return _0x1621ad[_0x4921b5('0x3c')]=_0x56b243,_0x284066[_0x4921b5('0x11')][_0x4921b5('0x2d')]&&(_0x1fe647[_0x4921b5('0x2f')]=[{'all':!![]}]),db['SquareOdbc'][_0x4921b5('0x2c')](_0x1fe647);})['then'](function(_0x3299ec){const _0x1f87c5=_0x3f19ca;return _0x1621ad[_0x1f87c5('0x28')]=_0x3299ec,_0x1621ad;})['then'](respondWithFilteredResult(_0x20acd1,_0x1fe647))[_0x3f19ca('0x1e')](handleError(_0x20acd1,null));},exports[_0x2e908d('0x39')]=function(_0x293bee,_0x188d5c){const _0x490539=_0x2e908d;let _0x3be064={'raw':!![],'where':{'id':_0x293bee[_0x490539('0xc')]['id']}};const _0x1cda54={};return _0x1cda54['model']=_[_0x490539('0x1d')](db[_0x490539('0x5')][_0x490539('0x3')]),_0x1cda54[_0x490539('0x11')]=_[_0x490539('0x1d')](_0x293bee[_0x490539('0x11')]),_0x1cda54['filters']=_[_0x490539('0x1b')](_0x1cda54[_0x490539('0xd')],_0x1cda54['query']),_0x3be064[_0x490539('0x12')]=_['intersection'](_0x1cda54[_0x490539('0xd')],qs['fields'](_0x293bee[_0x490539('0x11')]['fields'])),_0x3be064[_0x490539('0x12')]=_0x3be064[_0x490539('0x12')][_0x490539('0x30')]?_0x3be064['attributes']:_0x1cda54[_0x490539('0xd')],_0x293bee[_0x490539('0x11')][_0x490539('0x2d')]&&(_0x3be064[_0x490539('0x2f')]=[{'all':!![]}]),_0x3be064=_[_0x490539('0x6')]({},_0x3be064,_0x293bee['options']),db[_0x490539('0x5')]['findOne'](_0x3be064)[_0x490539('0x1f')](handleEntityNotFound(_0x188d5c,null))['then'](respondWithResult(_0x188d5c,null))[_0x490539('0x1e')](handleError(_0x188d5c,null));},exports[_0x2e908d('0x29')]=function(_0x40c8fd,_0x174c86){const _0x18dfaa=_0x2e908d;return db[_0x18dfaa('0x5')][_0x18dfaa('0x29')](_0x40c8fd[_0x18dfaa('0x1c')],{})[_0x18dfaa('0x1f')](function(_0x5c5a3d){const _0x2da373=_0x18dfaa,_0x5b121a=_0x40c8fd[_0x2da373('0x23')][_0x2da373('0x4')]({'plain':!![]});if(!_0x5b121a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b121a[_0x2da373('0x36')]==='user'){const _0x739489=_0x5c5a3d['get']({'plain':!![]}),_0x595bcd='ODBC';return db[_0x2da373('0x15')]['findOne']({'where':{'name':_0x595bcd,'userProfileId':_0x5b121a[_0x2da373('0x2a')]},'raw':!![]})[_0x2da373('0x1f')](function(_0x3e2270){const _0x297439=_0x2da373;return _0x3e2270&&_0x3e2270[_0x297439('0x14')]===0x0?db[_0x297439('0x8')]['create']({'name':_0x739489['name'],'resourceId':_0x739489['id'],'type':_0x3e2270[_0x297439('0x38')],'sectionId':_0x3e2270['id']},{})[_0x297439('0x1f')](function(){return _0x5c5a3d;}):_0x5c5a3d;})['catch'](function(_0x277063){const _0x3cd8b6=_0x2da373;logger['error'](_0x3cd8b6('0x2'),_0x277063);throw _0x277063;});}return _0x5c5a3d;})[_0x18dfaa('0x1f')](respondWithResult(_0x174c86,0xc9))[_0x18dfaa('0x1e')](handleError(_0x174c86,null));},exports[_0x2e908d('0x25')]=function(_0x5966f1,_0x31cb90){const _0xd8764d=_0x2e908d;return _0x5966f1[_0xd8764d('0x1c')]['id']&&delete _0x5966f1[_0xd8764d('0x1c')]['id'],db[_0xd8764d('0x5')]['findOne']({'where':{'id':_0x5966f1[_0xd8764d('0xc')]['id']}})[_0xd8764d('0x1f')](handleEntityNotFound(_0x31cb90,null))[_0xd8764d('0x1f')](saveUpdates(_0x5966f1[_0xd8764d('0x1c')],null))[_0xd8764d('0x1f')](respondWithResult(_0x31cb90,null))[_0xd8764d('0x1e')](handleError(_0x31cb90,null));},exports[_0x2e908d('0x33')]=function(_0x3ad20e,_0x74654e){const _0x30a73a=_0x2e908d;return db[_0x30a73a('0x5')][_0x30a73a('0xb')]({'where':{'id':_0x3ad20e[_0x30a73a('0xc')]['id']}})['then'](handleEntityNotFound(_0x74654e,null))[_0x30a73a('0x1f')](removeEntity(_0x74654e,null))[_0x30a73a('0x1e')](handleError(_0x74654e,null));},exports['test']=function(_0x15f204,_0x1ba50a){const _0x1a0c87=_0x2e908d;return db[_0x1a0c87('0x5')][_0x1a0c87('0xb')]({'where':{'id':_0x15f204[_0x1a0c87('0xc')]['id']},'attributes':['id',_0x1a0c87('0x24')]})['then'](handleEntityNotFound(_0x1ba50a,null))[_0x1a0c87('0x1f')](function(_0x45b9c8){const _0x301202=_0x1a0c87;if(_0x45b9c8){const _0x3779de=require(_0x301202('0x17'))();return _0x3779de[_0x301202('0x22')](_0x45b9c8[_0x301202('0x24')]),_0x3779de[_0x301202('0x32')](),_0x45b9c8;}})[_0x1a0c87('0x1f')](respondWithResult(_0x1ba50a,null))[_0x1a0c87('0x1e')](handleError(_0x1ba50a,null));};
\ No newline at end of file