Built motion from commit 709aa6fb5ed03aa61bc373fcdbf622215d37d30b. Version 3.0.0...
[motion-next.git] / server / api / intSalesforceConfiguration / intSalesforceConfiguration.controller.js
index 02a7d7e..ce82d37 100644 (file)
@@ -1 +1 @@
-const a286_0x3416=['stack','show','../../config/logger','getFields','keys','fieldName','offset','filters','create','findOne','sequelize','set','model','merge','include','name','status','SalesforceField','SalesforceConfiguration','send','attributes','fields','pick','findAll','order','includeAll','rawAttributes','length','then','getDescriptions','filter','query','rows','lodash','limit','catch','json','error','nolimit','getSubjects','intersection','../../components/parsers/qs','undefined','Content-Range','count','like','destroy','body','options','update','api','sort','type','sendStatus','params','end','map','where'];(function(_0x3d55cb,_0x3416dc){const _0x593fd6=function(_0x48ea66){while(--_0x48ea66){_0x3d55cb['push'](_0x3d55cb['shift']());}};_0x593fd6(++_0x3416dc);}(a286_0x3416,0x76));const a286_0x593f=function(_0x3d55cb,_0x3416dc){_0x3d55cb=_0x3d55cb-0x0;let _0x593fd6=a286_0x3416[_0x3d55cb];return _0x593fd6;};const _0x57b5ec=a286_0x593f;'use strict';const _=require(_0x57b5ec('0x1f')),qs=require(_0x57b5ec('0x27')),logger=require(_0x57b5ec('0x0'))(_0x57b5ec('0x30')),db=require('../../mysqldb')['db'],{Op}=require(_0x57b5ec('0x8'));function respondWithResult(_0x48ea66,_0x49c584){return _0x49c584=_0x49c584||0xc8,function(_0x52be4e){const _0x208ada=a286_0x593f;if(_0x52be4e)return _0x48ea66[_0x208ada('0xe')](_0x49c584)[_0x208ada('0x22')](_0x52be4e);};}function respondWithFilteredResult(_0x452c86,_0x166cfb){return function(_0x19c1f4){const _0x189926=a286_0x593f;if(_0x19c1f4){const _0x3c5b9f=_0x19c1f4['count'],_0xdaa49f=_0x166cfb[_0x189926('0x4')];let _0x1b3d74=_0x166cfb[_0x189926('0x4')]+_0x166cfb[_0x189926('0x20')],_0xc17400;return _0x1b3d74>=_0x3c5b9f?(_0x1b3d74=_0x3c5b9f,_0xc17400=0xc8):_0xc17400=0xce,_0x452c86[_0x189926('0xe')](_0xc17400),_0x452c86[_0x189926('0x9')](_0x189926('0x29'),_0xdaa49f+'-'+_0x1b3d74+'/'+_0x3c5b9f)['json'](_0x19c1f4);}return null;};}function saveUpdates(_0x20c9fb){return function(_0x18b544){const _0x38447a=a286_0x593f;if(_0x18b544)return _0x18b544['update'](_0x20c9fb)[_0x38447a('0x1a')](function(_0x39f362){return _0x39f362;});return null;};}function removeEntity(_0xd29dfa){return function(_0x45930e){const _0x1d7f39=a286_0x593f;if(_0x45930e)return _0x45930e[_0x1d7f39('0x2c')]()[_0x1d7f39('0x1a')](function(){const _0xad7b4=_0x1d7f39;_0xd29dfa['status'](0xcc)[_0xad7b4('0x35')]();});};}function handleEntityNotFound(_0x3f0c57){return function(_0x516a7f){const _0x2359ce=a286_0x593f;return!_0x516a7f&&_0x3f0c57[_0x2359ce('0x33')](0x194),_0x516a7f;};}function handleError(_0x44e6b9,_0x28eb28){return _0x28eb28=_0x28eb28||0x1f4,function(_0x39d8c9){const _0x36da8b=a286_0x593f;logger[_0x36da8b('0x23')](_0x39d8c9[_0x36da8b('0x38')]),_0x39d8c9[_0x36da8b('0xd')]&&delete _0x39d8c9[_0x36da8b('0xd')],_0x44e6b9[_0x36da8b('0xe')](_0x28eb28)[_0x36da8b('0x11')](_0x39d8c9);};}exports['index']=function(_0x4ebad9,_0x4a91f3){const _0xa3b374=_0x57b5ec;let _0xb96abe={};const _0x258c99={},_0x2862ab={'count':0x0,'rows':[]},_0x3e8744=_[_0xa3b374('0x36')](db[_0xa3b374('0x10')][_0xa3b374('0x18')],function(_0x1aff8c){const _0x59b940=_0xa3b374;return{'name':_0x1aff8c[_0x59b940('0x3')],'type':_0x1aff8c[_0x59b940('0x32')]['key']};});_0x258c99[_0xa3b374('0xa')]=_['map'](_0x3e8744,_0xa3b374('0xd')),_0x258c99[_0xa3b374('0x1d')]=_[_0xa3b374('0x2')](_0x4ebad9[_0xa3b374('0x1d')]),_0x258c99[_0xa3b374('0x5')]=_[_0xa3b374('0x26')](_0x258c99[_0xa3b374('0xa')],_0x258c99['query']),_0xb96abe[_0xa3b374('0x12')]=_[_0xa3b374('0x26')](_0x258c99[_0xa3b374('0xa')],qs[_0xa3b374('0x13')](_0x4ebad9[_0xa3b374('0x1d')]['fields'])),_0xb96abe[_0xa3b374('0x12')]=_0xb96abe[_0xa3b374('0x12')]['length']?_0xb96abe['attributes']:_0x258c99[_0xa3b374('0xa')];typeof _0x4ebad9[_0xa3b374('0x1d')][_0xa3b374('0x24')]===_0xa3b374('0x28')&&(_0xb96abe[_0xa3b374('0x20')]=qs[_0xa3b374('0x20')](_0x4ebad9[_0xa3b374('0x1d')][_0xa3b374('0x20')]),_0xb96abe[_0xa3b374('0x4')]=qs[_0xa3b374('0x4')](_0x4ebad9[_0xa3b374('0x1d')][_0xa3b374('0x4')]));_0xb96abe['order']=qs[_0xa3b374('0x31')](_0x4ebad9['query'][_0xa3b374('0x31')]),_0xb96abe['where']=qs['filters'](_[_0xa3b374('0x14')](_0x4ebad9[_0xa3b374('0x1d')],_0x258c99[_0xa3b374('0x5')]),_0x3e8744);_0x4ebad9[_0xa3b374('0x1d')][_0xa3b374('0x1c')]&&(_0xb96abe[_0xa3b374('0x37')]=_[_0xa3b374('0xb')](_0xb96abe[_0xa3b374('0x37')],{[Op['or']]:_[_0xa3b374('0x36')](_0x3e8744,function(_0x6ff8af){const _0x2dbf3d=_0xa3b374;if(_0x6ff8af[_0x2dbf3d('0x32')]!=='VIRTUAL'){const _0x3a93fa={};return _0x3a93fa[_0x6ff8af[_0x2dbf3d('0xd')]]={[Op[_0x2dbf3d('0x2b')]]:'%'+_0x4ebad9[_0x2dbf3d('0x1d')]['filter']+'%'},_0x3a93fa;}})}));_0xb96abe=_[_0xa3b374('0xb')]({},_0xb96abe,_0x4ebad9[_0xa3b374('0x2e')]);const _0x26a043={'where':_0xb96abe[_0xa3b374('0x37')]};return db[_0xa3b374('0x10')][_0xa3b374('0x2a')](_0x26a043)[_0xa3b374('0x1a')](function(_0x28fce5){const _0x5dc402=_0xa3b374;return _0x2862ab['count']=_0x28fce5,_0x4ebad9['query']['includeAll']&&(_0xb96abe[_0x5dc402('0xc')]=[{'all':!![]}]),db['SalesforceConfiguration'][_0x5dc402('0x15')](_0xb96abe);})['then'](function(_0xa00b91){const _0x17de54=_0xa3b374;return _0x2862ab[_0x17de54('0x1e')]=_0xa00b91,_0x2862ab;})[_0xa3b374('0x1a')](respondWithFilteredResult(_0x4a91f3,_0xb96abe))[_0xa3b374('0x21')](handleError(_0x4a91f3,null));},exports[_0x57b5ec('0x39')]=function(_0x175ea0,_0x106d52){const _0x2a14df=_0x57b5ec;let _0x3e02f0={'raw':![],'where':{'id':_0x175ea0[_0x2a14df('0x34')]['id']}};const _0x4c97a4={};return _0x4c97a4['model']=_['keys'](db[_0x2a14df('0x10')][_0x2a14df('0x18')]),_0x4c97a4[_0x2a14df('0x1d')]=_[_0x2a14df('0x2')](_0x175ea0[_0x2a14df('0x1d')]),_0x4c97a4[_0x2a14df('0x5')]=_[_0x2a14df('0x26')](_0x4c97a4[_0x2a14df('0xa')],_0x4c97a4[_0x2a14df('0x1d')]),_0x3e02f0[_0x2a14df('0x12')]=_['intersection'](_0x4c97a4[_0x2a14df('0xa')],qs[_0x2a14df('0x13')](_0x175ea0['query']['fields'])),_0x3e02f0[_0x2a14df('0x12')]=_0x3e02f0['attributes'][_0x2a14df('0x19')]?_0x3e02f0[_0x2a14df('0x12')]:_0x4c97a4[_0x2a14df('0xa')],_0x175ea0['query'][_0x2a14df('0x17')]&&(_0x3e02f0[_0x2a14df('0xc')]=[{'all':!![]}]),_0x3e02f0=_[_0x2a14df('0xb')]({},_0x3e02f0,_0x175ea0[_0x2a14df('0x2e')]),db[_0x2a14df('0x10')][_0x2a14df('0x7')](_0x3e02f0)['then'](handleEntityNotFound(_0x106d52,null))[_0x2a14df('0x1a')](respondWithResult(_0x106d52,null))[_0x2a14df('0x21')](handleError(_0x106d52,null));},exports[_0x57b5ec('0x6')]=function(_0x37154b,_0xcee1ec){const _0x4bc456=_0x57b5ec;return db['SalesforceConfiguration'][_0x4bc456('0x6')](_0x37154b[_0x4bc456('0x2d')],{})[_0x4bc456('0x1a')](respondWithResult(_0xcee1ec,0xc9))[_0x4bc456('0x21')](handleError(_0xcee1ec,null));},exports[_0x57b5ec('0x2f')]=function(_0xb9fa1f,_0x16e49e){const _0x48f153=_0x57b5ec;return _0xb9fa1f[_0x48f153('0x2d')]['id']&&delete _0xb9fa1f[_0x48f153('0x2d')]['id'],db[_0x48f153('0x10')][_0x48f153('0x7')]({'where':{'id':_0xb9fa1f[_0x48f153('0x34')]['id']}})[_0x48f153('0x1a')](handleEntityNotFound(_0x16e49e,null))['then'](saveUpdates(_0xb9fa1f[_0x48f153('0x2d')],null))['then'](respondWithResult(_0x16e49e,null))[_0x48f153('0x21')](handleError(_0x16e49e,null));},exports[_0x57b5ec('0x2c')]=function(_0x5495c5,_0x208338){const _0x34629b=_0x57b5ec;return db['SalesforceConfiguration'][_0x34629b('0x7')]({'where':{'id':_0x5495c5['params']['id']}})[_0x34629b('0x1a')](handleEntityNotFound(_0x208338,null))[_0x34629b('0x1a')](removeEntity(_0x208338,null))[_0x34629b('0x21')](handleError(_0x208338,null));},exports['getFields']=function(_0x41dd13,_0x289a3e){const _0x296d8b=_0x57b5ec;let _0x4bd0ca={};const _0x4d6bab={};let _0x41ffee,_0x20c598;return db[_0x296d8b('0x10')][_0x296d8b('0x7')]({'where':{'id':_0x41dd13[_0x296d8b('0x34')]['id']}})[_0x296d8b('0x1a')](handleEntityNotFound(_0x289a3e,null))[_0x296d8b('0x1a')](function(_0x3f963b){const _0x421649=_0x296d8b;if(_0x3f963b)return _0x41ffee=_0x3f963b,_0x4d6bab['model']=_[_0x421649('0x2')](db[_0x421649('0xf')][_0x421649('0x18')]),_0x4d6bab[_0x421649('0x1d')]=_[_0x421649('0x2')](_0x41dd13[_0x421649('0x1d')]),_0x4d6bab[_0x421649('0x5')]=_[_0x421649('0x26')](_0x4d6bab[_0x421649('0xa')],_0x4d6bab[_0x421649('0x1d')]),_0x4bd0ca['attributes']=_[_0x421649('0x26')](_0x4d6bab['model'],qs[_0x421649('0x13')](_0x41dd13[_0x421649('0x1d')][_0x421649('0x13')])),_0x4bd0ca[_0x421649('0x12')]=_0x4bd0ca[_0x421649('0x12')][_0x421649('0x19')]?_0x4bd0ca[_0x421649('0x12')]:_0x4d6bab['model'],_0x4bd0ca[_0x421649('0x16')]=qs[_0x421649('0x31')](_0x41dd13[_0x421649('0x1d')]['sort']),_0x4bd0ca['where']=qs[_0x421649('0x5')](_['pick'](_0x41dd13['query'],_0x4d6bab['filters'])),_0x41dd13['query'][_0x421649('0x1c')]&&(_0x4bd0ca['where']=_[_0x421649('0xb')](_0x4bd0ca['where'],{[Op['or']]:_[_0x421649('0x36')](_0x4bd0ca[_0x421649('0x12')],function(_0x13f3dc){const _0x1833f2=_0x421649,_0x14c65f={};return _0x14c65f[_0x13f3dc]={[Op[_0x1833f2('0x2b')]]:'%'+_0x41dd13[_0x1833f2('0x1d')][_0x1833f2('0x1c')]+'%'},_0x14c65f;})})),_0x4bd0ca=_[_0x421649('0xb')]({},_0x4bd0ca,_0x41dd13[_0x421649('0x2e')]),_0x41ffee['getFields'](_0x4bd0ca);})[_0x296d8b('0x1a')](function(_0x521302){const _0x2db5c2=_0x296d8b;if(_0x521302)return _0x20c598=_0x521302[_0x2db5c2('0x19')],typeof _0x41dd13[_0x2db5c2('0x1d')][_0x2db5c2('0x24')]===_0x2db5c2('0x28')&&(_0x4bd0ca[_0x2db5c2('0x20')]=qs['limit'](_0x41dd13[_0x2db5c2('0x1d')][_0x2db5c2('0x20')]),_0x4bd0ca[_0x2db5c2('0x4')]=qs[_0x2db5c2('0x4')](_0x41dd13['query'][_0x2db5c2('0x4')])),_0x41ffee[_0x2db5c2('0x1')](_0x4bd0ca);})[_0x296d8b('0x1a')](function(_0x1b23f6){if(_0x1b23f6)return _0x1b23f6?{'count':_0x20c598,'rows':_0x1b23f6}:null;})['then'](respondWithResult(_0x289a3e,null))[_0x296d8b('0x21')](handleError(_0x289a3e,null));},exports[_0x57b5ec('0x25')]=function(_0x1baae0,_0x17c1ac){const _0x3df081=_0x57b5ec;let _0x2c8ebe={};const _0x45a090={};let _0x5751e0,_0x1c2765;return db[_0x3df081('0x10')][_0x3df081('0x7')]({'where':{'id':_0x1baae0['params']['id']}})[_0x3df081('0x1a')](handleEntityNotFound(_0x17c1ac,null))['then'](function(_0x5cc849){const _0x5a6c80=_0x3df081;if(_0x5cc849)return _0x5751e0=_0x5cc849,_0x45a090['model']=_[_0x5a6c80('0x2')](db[_0x5a6c80('0xf')][_0x5a6c80('0x18')]),_0x45a090[_0x5a6c80('0x1d')]=_[_0x5a6c80('0x2')](_0x1baae0[_0x5a6c80('0x1d')]),_0x45a090[_0x5a6c80('0x5')]=_[_0x5a6c80('0x26')](_0x45a090[_0x5a6c80('0xa')],_0x45a090[_0x5a6c80('0x1d')]),_0x2c8ebe[_0x5a6c80('0x12')]=_[_0x5a6c80('0x26')](_0x45a090[_0x5a6c80('0xa')],qs['fields'](_0x1baae0[_0x5a6c80('0x1d')]['fields'])),_0x2c8ebe['attributes']=_0x2c8ebe['attributes'][_0x5a6c80('0x19')]?_0x2c8ebe['attributes']:_0x45a090[_0x5a6c80('0xa')],_0x2c8ebe[_0x5a6c80('0x16')]=qs[_0x5a6c80('0x31')](_0x1baae0[_0x5a6c80('0x1d')][_0x5a6c80('0x31')]),_0x2c8ebe[_0x5a6c80('0x37')]=qs[_0x5a6c80('0x5')](_[_0x5a6c80('0x14')](_0x1baae0[_0x5a6c80('0x1d')],_0x45a090['filters'])),_0x1baae0[_0x5a6c80('0x1d')][_0x5a6c80('0x1c')]&&(_0x2c8ebe[_0x5a6c80('0x37')]=_[_0x5a6c80('0xb')](_0x2c8ebe[_0x5a6c80('0x37')],{[Op['or']]:_[_0x5a6c80('0x36')](_0x2c8ebe[_0x5a6c80('0x12')],function(_0x5584cc){const _0xaf9a67=_0x5a6c80,_0x1d7ae4={};return _0x1d7ae4[_0x5584cc]={[Op[_0xaf9a67('0x2b')]]:'%'+_0x1baae0['query'][_0xaf9a67('0x1c')]+'%'},_0x1d7ae4;})})),_0x2c8ebe=_[_0x5a6c80('0xb')]({},_0x2c8ebe,_0x1baae0[_0x5a6c80('0x2e')]),_0x5751e0['getSubjects'](_0x2c8ebe);})['then'](function(_0x3574a7){const _0x259c4e=_0x3df081;if(_0x3574a7)return _0x1c2765=_0x3574a7[_0x259c4e('0x19')],typeof _0x1baae0[_0x259c4e('0x1d')]['nolimit']===_0x259c4e('0x28')&&(_0x2c8ebe['limit']=qs[_0x259c4e('0x20')](_0x1baae0[_0x259c4e('0x1d')][_0x259c4e('0x20')]),_0x2c8ebe['offset']=qs['offset'](_0x1baae0[_0x259c4e('0x1d')][_0x259c4e('0x4')])),_0x5751e0[_0x259c4e('0x25')](_0x2c8ebe);})['then'](function(_0x76ec86){if(_0x76ec86)return _0x76ec86?{'count':_0x1c2765,'rows':_0x76ec86}:null;})['then'](respondWithResult(_0x17c1ac,null))['catch'](handleError(_0x17c1ac,null));},exports[_0x57b5ec('0x1b')]=function(_0x158eda,_0x2c10fe){const _0x1ce888=_0x57b5ec;let _0x216b36={};const _0x23d7ac={};let _0x2d7828,_0x5bc6a6;return db[_0x1ce888('0x10')][_0x1ce888('0x7')]({'where':{'id':_0x158eda[_0x1ce888('0x34')]['id']}})['then'](handleEntityNotFound(_0x2c10fe,null))['then'](function(_0x39db35){const _0x56664c=_0x1ce888;if(_0x39db35)return _0x2d7828=_0x39db35,_0x23d7ac[_0x56664c('0xa')]=_['keys'](db[_0x56664c('0xf')][_0x56664c('0x18')]),_0x23d7ac[_0x56664c('0x1d')]=_['keys'](_0x158eda['query']),_0x23d7ac[_0x56664c('0x5')]=_['intersection'](_0x23d7ac[_0x56664c('0xa')],_0x23d7ac[_0x56664c('0x1d')]),_0x216b36[_0x56664c('0x12')]=_[_0x56664c('0x26')](_0x23d7ac[_0x56664c('0xa')],qs[_0x56664c('0x13')](_0x158eda[_0x56664c('0x1d')]['fields'])),_0x216b36[_0x56664c('0x12')]=_0x216b36['attributes'][_0x56664c('0x19')]?_0x216b36[_0x56664c('0x12')]:_0x23d7ac[_0x56664c('0xa')],_0x216b36[_0x56664c('0x16')]=qs[_0x56664c('0x31')](_0x158eda['query']['sort']),_0x216b36[_0x56664c('0x37')]=qs[_0x56664c('0x5')](_[_0x56664c('0x14')](_0x158eda['query'],_0x23d7ac[_0x56664c('0x5')])),_0x158eda[_0x56664c('0x1d')]['filter']&&(_0x216b36[_0x56664c('0x37')]=_[_0x56664c('0xb')](_0x216b36[_0x56664c('0x37')],{[Op['or']]:_[_0x56664c('0x36')](_0x216b36['attributes'],function(_0x5d2efa){const _0x1a5289=_0x56664c,_0xab53d1={};return _0xab53d1[_0x5d2efa]={[Op[_0x1a5289('0x2b')]]:'%'+_0x158eda[_0x1a5289('0x1d')][_0x1a5289('0x1c')]+'%'},_0xab53d1;})})),_0x216b36=_['merge']({},_0x216b36,_0x158eda[_0x56664c('0x2e')]),_0x2d7828[_0x56664c('0x1b')](_0x216b36);})[_0x1ce888('0x1a')](function(_0x46cd8f){const _0x43c06b=_0x1ce888;if(_0x46cd8f)return _0x5bc6a6=_0x46cd8f['length'],typeof _0x158eda[_0x43c06b('0x1d')][_0x43c06b('0x24')]===_0x43c06b('0x28')&&(_0x216b36[_0x43c06b('0x20')]=qs[_0x43c06b('0x20')](_0x158eda['query']['limit']),_0x216b36[_0x43c06b('0x4')]=qs[_0x43c06b('0x4')](_0x158eda[_0x43c06b('0x1d')][_0x43c06b('0x4')])),_0x2d7828[_0x43c06b('0x1b')](_0x216b36);})[_0x1ce888('0x1a')](function(_0x42b2ee){if(_0x42b2ee)return _0x42b2ee?{'count':_0x5bc6a6,'rows':_0x42b2ee}:null;})[_0x1ce888('0x1a')](respondWithResult(_0x2c10fe,null))[_0x1ce888('0x21')](handleError(_0x2c10fe,null));};
\ No newline at end of file
+const a286_0x5082=['fields','json','include','body','send','getDescriptions','catch','rawAttributes','attributes','name','create','options','model','lodash','pick','../../components/parsers/qs','includeAll','count','map','rows','intersection','then','merge','../../mysqldb','end','offset','SalesforceConfiguration','type','show','stack','filters','nolimit','sort','../../config/logger','update','length','getFields','status','where','sequelize','filter','findOne','like','error','params','destroy','query','undefined','getSubjects','keys','SalesforceField','order','limit'];(function(_0x54f86d,_0x508204){const _0x3bb2e3=function(_0x44297c){while(--_0x44297c){_0x54f86d['push'](_0x54f86d['shift']());}};_0x3bb2e3(++_0x508204);}(a286_0x5082,0x154));const a286_0x3bb2=function(_0x54f86d,_0x508204){_0x54f86d=_0x54f86d-0x0;let _0x3bb2e3=a286_0x5082[_0x54f86d];return _0x3bb2e3;};const _0x396870=a286_0x3bb2;'use strict';const _=require(_0x396870('0x2c')),qs=require(_0x396870('0x2e')),logger=require(_0x396870('0xb'))('api'),db=require(_0x396870('0x1'))['db'],{Op}=require(_0x396870('0x11'));function respondWithResult(_0x44297c,_0xe38408){return _0xe38408=_0xe38408||0xc8,function(_0x5d3f66){const _0x1b49da=a286_0x3bb2;if(_0x5d3f66)return _0x44297c[_0x1b49da('0xf')](_0xe38408)[_0x1b49da('0x20')](_0x5d3f66);};}function respondWithFilteredResult(_0x56072e,_0x2f2034){return function(_0x18f9b0){const _0x1ae442=a286_0x3bb2;if(_0x18f9b0){const _0x3eea4c=_0x18f9b0['count'],_0x1f51fa=_0x2f2034['offset'];let _0x5b0c56=_0x2f2034[_0x1ae442('0x3')]+_0x2f2034['limit'],_0x148ec7;return _0x5b0c56>=_0x3eea4c?(_0x5b0c56=_0x3eea4c,_0x148ec7=0xc8):_0x148ec7=0xce,_0x56072e[_0x1ae442('0xf')](_0x148ec7),_0x56072e['set']('Content-Range',_0x1f51fa+'-'+_0x5b0c56+'/'+_0x3eea4c)[_0x1ae442('0x20')](_0x18f9b0);}return null;};}function saveUpdates(_0x4a44bb){return function(_0x3e24b4){const _0x523398=a286_0x3bb2;if(_0x3e24b4)return _0x3e24b4[_0x523398('0xc')](_0x4a44bb)[_0x523398('0x34')](function(_0x8ddf06){return _0x8ddf06;});return null;};}function removeEntity(_0x9b3223){return function(_0xa86712){const _0x1caf85=a286_0x3bb2;if(_0xa86712)return _0xa86712[_0x1caf85('0x17')]()[_0x1caf85('0x34')](function(){const _0x1a871f=_0x1caf85;_0x9b3223[_0x1a871f('0xf')](0xcc)[_0x1a871f('0x2')]();});};}function handleEntityNotFound(_0x454f73){return function(_0x1d7ca0){return!_0x1d7ca0&&_0x454f73['sendStatus'](0x194),_0x1d7ca0;};}function handleError(_0x284dc8,_0x157f4a){return _0x157f4a=_0x157f4a||0x1f4,function(_0x1e42a8){const _0x350046=a286_0x3bb2;logger[_0x350046('0x15')](_0x1e42a8[_0x350046('0x7')]),_0x1e42a8['name']&&delete _0x1e42a8[_0x350046('0x28')],_0x284dc8[_0x350046('0xf')](_0x157f4a)[_0x350046('0x23')](_0x1e42a8);};}exports['index']=function(_0x21ed97,_0xa9657){const _0x5004b0=_0x396870;let _0x13589b={};const _0x195de6={},_0x382814={'count':0x0,'rows':[]},_0x3c84c9=_[_0x5004b0('0x31')](db[_0x5004b0('0x4')][_0x5004b0('0x26')],function(_0x3a4f9d){const _0x1feb41=_0x5004b0;return{'name':_0x3a4f9d['fieldName'],'type':_0x3a4f9d[_0x1feb41('0x5')]['key']};});_0x195de6['model']=_['map'](_0x3c84c9,'name'),_0x195de6['query']=_[_0x5004b0('0x1b')](_0x21ed97[_0x5004b0('0x18')]),_0x195de6[_0x5004b0('0x8')]=_[_0x5004b0('0x33')](_0x195de6['model'],_0x195de6[_0x5004b0('0x18')]),_0x13589b[_0x5004b0('0x27')]=_[_0x5004b0('0x33')](_0x195de6['model'],qs[_0x5004b0('0x1f')](_0x21ed97[_0x5004b0('0x18')][_0x5004b0('0x1f')])),_0x13589b[_0x5004b0('0x27')]=_0x13589b[_0x5004b0('0x27')][_0x5004b0('0xd')]?_0x13589b[_0x5004b0('0x27')]:_0x195de6[_0x5004b0('0x2b')];typeof _0x21ed97[_0x5004b0('0x18')][_0x5004b0('0x9')]===_0x5004b0('0x19')&&(_0x13589b[_0x5004b0('0x1e')]=qs[_0x5004b0('0x1e')](_0x21ed97['query'][_0x5004b0('0x1e')]),_0x13589b[_0x5004b0('0x3')]=qs[_0x5004b0('0x3')](_0x21ed97[_0x5004b0('0x18')][_0x5004b0('0x3')]));_0x13589b['order']=qs[_0x5004b0('0xa')](_0x21ed97[_0x5004b0('0x18')][_0x5004b0('0xa')]),_0x13589b[_0x5004b0('0x10')]=qs[_0x5004b0('0x8')](_[_0x5004b0('0x2d')](_0x21ed97[_0x5004b0('0x18')],_0x195de6['filters']),_0x3c84c9);_0x21ed97[_0x5004b0('0x18')][_0x5004b0('0x12')]&&(_0x13589b[_0x5004b0('0x10')]=_[_0x5004b0('0x0')](_0x13589b[_0x5004b0('0x10')],{[Op['or']]:_[_0x5004b0('0x31')](_0x3c84c9,function(_0x17ff08){const _0x1df90d=_0x5004b0;if(_0x17ff08['type']!=='VIRTUAL'){const _0x3f1ef3={};return _0x3f1ef3[_0x17ff08['name']]={[Op[_0x1df90d('0x14')]]:'%'+_0x21ed97[_0x1df90d('0x18')][_0x1df90d('0x12')]+'%'},_0x3f1ef3;}})}));_0x13589b=_[_0x5004b0('0x0')]({},_0x13589b,_0x21ed97[_0x5004b0('0x2a')]);const _0x21617b={'where':_0x13589b[_0x5004b0('0x10')]};return db[_0x5004b0('0x4')][_0x5004b0('0x30')](_0x21617b)[_0x5004b0('0x34')](function(_0x188954){const _0x3c6d07=_0x5004b0;return _0x382814[_0x3c6d07('0x30')]=_0x188954,_0x21ed97[_0x3c6d07('0x18')][_0x3c6d07('0x2f')]&&(_0x13589b[_0x3c6d07('0x21')]=[{'all':!![]}]),db[_0x3c6d07('0x4')]['findAll'](_0x13589b);})[_0x5004b0('0x34')](function(_0x20c80a){const _0x20cd13=_0x5004b0;return _0x382814[_0x20cd13('0x32')]=_0x20c80a,_0x382814;})[_0x5004b0('0x34')](respondWithFilteredResult(_0xa9657,_0x13589b))[_0x5004b0('0x25')](handleError(_0xa9657,null));},exports[_0x396870('0x6')]=function(_0x2ac24b,_0x43c19a){const _0x1e2ca8=_0x396870;let _0x1956f4={'raw':![],'where':{'id':_0x2ac24b[_0x1e2ca8('0x16')]['id']}};const _0x1dd449={};return _0x1dd449[_0x1e2ca8('0x2b')]=_['keys'](db[_0x1e2ca8('0x4')][_0x1e2ca8('0x26')]),_0x1dd449[_0x1e2ca8('0x18')]=_[_0x1e2ca8('0x1b')](_0x2ac24b['query']),_0x1dd449[_0x1e2ca8('0x8')]=_['intersection'](_0x1dd449[_0x1e2ca8('0x2b')],_0x1dd449[_0x1e2ca8('0x18')]),_0x1956f4[_0x1e2ca8('0x27')]=_[_0x1e2ca8('0x33')](_0x1dd449[_0x1e2ca8('0x2b')],qs['fields'](_0x2ac24b[_0x1e2ca8('0x18')][_0x1e2ca8('0x1f')])),_0x1956f4[_0x1e2ca8('0x27')]=_0x1956f4['attributes']['length']?_0x1956f4[_0x1e2ca8('0x27')]:_0x1dd449[_0x1e2ca8('0x2b')],_0x2ac24b[_0x1e2ca8('0x18')]['includeAll']&&(_0x1956f4['include']=[{'all':!![]}]),_0x1956f4=_[_0x1e2ca8('0x0')]({},_0x1956f4,_0x2ac24b[_0x1e2ca8('0x2a')]),db[_0x1e2ca8('0x4')][_0x1e2ca8('0x13')](_0x1956f4)[_0x1e2ca8('0x34')](handleEntityNotFound(_0x43c19a,null))[_0x1e2ca8('0x34')](respondWithResult(_0x43c19a,null))[_0x1e2ca8('0x25')](handleError(_0x43c19a,null));},exports[_0x396870('0x29')]=function(_0x1521c6,_0x5d48fc){const _0x275bc=_0x396870;return db[_0x275bc('0x4')][_0x275bc('0x29')](_0x1521c6[_0x275bc('0x22')],{})[_0x275bc('0x34')](respondWithResult(_0x5d48fc,0xc9))[_0x275bc('0x25')](handleError(_0x5d48fc,null));},exports[_0x396870('0xc')]=function(_0xe96709,_0x317ac2){const _0x1d9df5=_0x396870;return _0xe96709[_0x1d9df5('0x22')]['id']&&delete _0xe96709[_0x1d9df5('0x22')]['id'],db[_0x1d9df5('0x4')]['findOne']({'where':{'id':_0xe96709[_0x1d9df5('0x16')]['id']}})['then'](handleEntityNotFound(_0x317ac2,null))[_0x1d9df5('0x34')](saveUpdates(_0xe96709[_0x1d9df5('0x22')],null))['then'](respondWithResult(_0x317ac2,null))[_0x1d9df5('0x25')](handleError(_0x317ac2,null));},exports[_0x396870('0x17')]=function(_0x4a3fbd,_0x136170){const _0x424307=_0x396870;return db[_0x424307('0x4')]['findOne']({'where':{'id':_0x4a3fbd['params']['id']}})['then'](handleEntityNotFound(_0x136170,null))['then'](removeEntity(_0x136170,null))[_0x424307('0x25')](handleError(_0x136170,null));},exports[_0x396870('0xe')]=function(_0x5bcd3d,_0x3b9c81){const _0x27d4ee=_0x396870;let _0x204be8={};const _0x2122e3={};let _0xd4a4cc,_0x395a3e;return db[_0x27d4ee('0x4')]['findOne']({'where':{'id':_0x5bcd3d[_0x27d4ee('0x16')]['id']}})[_0x27d4ee('0x34')](handleEntityNotFound(_0x3b9c81,null))[_0x27d4ee('0x34')](function(_0x34fddd){const _0x2cc338=_0x27d4ee;if(_0x34fddd)return _0xd4a4cc=_0x34fddd,_0x2122e3[_0x2cc338('0x2b')]=_[_0x2cc338('0x1b')](db[_0x2cc338('0x1c')][_0x2cc338('0x26')]),_0x2122e3[_0x2cc338('0x18')]=_['keys'](_0x5bcd3d[_0x2cc338('0x18')]),_0x2122e3['filters']=_[_0x2cc338('0x33')](_0x2122e3[_0x2cc338('0x2b')],_0x2122e3[_0x2cc338('0x18')]),_0x204be8[_0x2cc338('0x27')]=_[_0x2cc338('0x33')](_0x2122e3[_0x2cc338('0x2b')],qs[_0x2cc338('0x1f')](_0x5bcd3d[_0x2cc338('0x18')]['fields'])),_0x204be8[_0x2cc338('0x27')]=_0x204be8[_0x2cc338('0x27')][_0x2cc338('0xd')]?_0x204be8['attributes']:_0x2122e3[_0x2cc338('0x2b')],_0x204be8[_0x2cc338('0x1d')]=qs['sort'](_0x5bcd3d[_0x2cc338('0x18')][_0x2cc338('0xa')]),_0x204be8[_0x2cc338('0x10')]=qs['filters'](_[_0x2cc338('0x2d')](_0x5bcd3d['query'],_0x2122e3[_0x2cc338('0x8')])),_0x5bcd3d[_0x2cc338('0x18')][_0x2cc338('0x12')]&&(_0x204be8[_0x2cc338('0x10')]=_[_0x2cc338('0x0')](_0x204be8['where'],{[Op['or']]:_[_0x2cc338('0x31')](_0x204be8[_0x2cc338('0x27')],function(_0x3edbd5){const _0x4d24f3=_0x2cc338,_0x1c823b={};return _0x1c823b[_0x3edbd5]={[Op[_0x4d24f3('0x14')]]:'%'+_0x5bcd3d[_0x4d24f3('0x18')][_0x4d24f3('0x12')]+'%'},_0x1c823b;})})),_0x204be8=_['merge']({},_0x204be8,_0x5bcd3d[_0x2cc338('0x2a')]),_0xd4a4cc[_0x2cc338('0xe')](_0x204be8);})['then'](function(_0x4f1c19){const _0x5c63d5=_0x27d4ee;if(_0x4f1c19)return _0x395a3e=_0x4f1c19[_0x5c63d5('0xd')],typeof _0x5bcd3d[_0x5c63d5('0x18')][_0x5c63d5('0x9')]===_0x5c63d5('0x19')&&(_0x204be8[_0x5c63d5('0x1e')]=qs['limit'](_0x5bcd3d[_0x5c63d5('0x18')][_0x5c63d5('0x1e')]),_0x204be8[_0x5c63d5('0x3')]=qs['offset'](_0x5bcd3d['query'][_0x5c63d5('0x3')])),_0xd4a4cc['getFields'](_0x204be8);})[_0x27d4ee('0x34')](function(_0x5e6bae){if(_0x5e6bae)return _0x5e6bae?{'count':_0x395a3e,'rows':_0x5e6bae}:null;})[_0x27d4ee('0x34')](respondWithResult(_0x3b9c81,null))[_0x27d4ee('0x25')](handleError(_0x3b9c81,null));},exports['getSubjects']=function(_0x1b2864,_0x2cbb34){const _0x440237=_0x396870;let _0x2f9f11={};const _0x3578e3={};let _0x14f349,_0x59a4f8;return db[_0x440237('0x4')][_0x440237('0x13')]({'where':{'id':_0x1b2864[_0x440237('0x16')]['id']}})[_0x440237('0x34')](handleEntityNotFound(_0x2cbb34,null))['then'](function(_0x34139e){const _0x4281cc=_0x440237;if(_0x34139e)return _0x14f349=_0x34139e,_0x3578e3[_0x4281cc('0x2b')]=_['keys'](db[_0x4281cc('0x1c')][_0x4281cc('0x26')]),_0x3578e3[_0x4281cc('0x18')]=_[_0x4281cc('0x1b')](_0x1b2864[_0x4281cc('0x18')]),_0x3578e3[_0x4281cc('0x8')]=_[_0x4281cc('0x33')](_0x3578e3[_0x4281cc('0x2b')],_0x3578e3[_0x4281cc('0x18')]),_0x2f9f11[_0x4281cc('0x27')]=_[_0x4281cc('0x33')](_0x3578e3[_0x4281cc('0x2b')],qs[_0x4281cc('0x1f')](_0x1b2864[_0x4281cc('0x18')][_0x4281cc('0x1f')])),_0x2f9f11[_0x4281cc('0x27')]=_0x2f9f11[_0x4281cc('0x27')][_0x4281cc('0xd')]?_0x2f9f11[_0x4281cc('0x27')]:_0x3578e3['model'],_0x2f9f11['order']=qs['sort'](_0x1b2864[_0x4281cc('0x18')][_0x4281cc('0xa')]),_0x2f9f11[_0x4281cc('0x10')]=qs[_0x4281cc('0x8')](_['pick'](_0x1b2864[_0x4281cc('0x18')],_0x3578e3[_0x4281cc('0x8')])),_0x1b2864['query'][_0x4281cc('0x12')]&&(_0x2f9f11[_0x4281cc('0x10')]=_[_0x4281cc('0x0')](_0x2f9f11[_0x4281cc('0x10')],{[Op['or']]:_[_0x4281cc('0x31')](_0x2f9f11[_0x4281cc('0x27')],function(_0x428af6){const _0x463133=_0x4281cc,_0x27c5e1={};return _0x27c5e1[_0x428af6]={[Op[_0x463133('0x14')]]:'%'+_0x1b2864[_0x463133('0x18')]['filter']+'%'},_0x27c5e1;})})),_0x2f9f11=_[_0x4281cc('0x0')]({},_0x2f9f11,_0x1b2864['options']),_0x14f349[_0x4281cc('0x1a')](_0x2f9f11);})['then'](function(_0x3ccf49){const _0x581f43=_0x440237;if(_0x3ccf49)return _0x59a4f8=_0x3ccf49['length'],typeof _0x1b2864[_0x581f43('0x18')]['nolimit']==='undefined'&&(_0x2f9f11['limit']=qs[_0x581f43('0x1e')](_0x1b2864[_0x581f43('0x18')]['limit']),_0x2f9f11[_0x581f43('0x3')]=qs[_0x581f43('0x3')](_0x1b2864[_0x581f43('0x18')][_0x581f43('0x3')])),_0x14f349[_0x581f43('0x1a')](_0x2f9f11);})[_0x440237('0x34')](function(_0x5b6074){if(_0x5b6074)return _0x5b6074?{'count':_0x59a4f8,'rows':_0x5b6074}:null;})[_0x440237('0x34')](respondWithResult(_0x2cbb34,null))[_0x440237('0x25')](handleError(_0x2cbb34,null));},exports[_0x396870('0x24')]=function(_0x13bba4,_0x19409f){const _0x250de9=_0x396870;let _0x1f7982={};const _0x24b205={};let _0x363d0c,_0x57cace;return db[_0x250de9('0x4')][_0x250de9('0x13')]({'where':{'id':_0x13bba4['params']['id']}})[_0x250de9('0x34')](handleEntityNotFound(_0x19409f,null))[_0x250de9('0x34')](function(_0x1d38fb){const _0x39b4b7=_0x250de9;if(_0x1d38fb)return _0x363d0c=_0x1d38fb,_0x24b205[_0x39b4b7('0x2b')]=_['keys'](db[_0x39b4b7('0x1c')][_0x39b4b7('0x26')]),_0x24b205['query']=_['keys'](_0x13bba4[_0x39b4b7('0x18')]),_0x24b205[_0x39b4b7('0x8')]=_[_0x39b4b7('0x33')](_0x24b205[_0x39b4b7('0x2b')],_0x24b205[_0x39b4b7('0x18')]),_0x1f7982[_0x39b4b7('0x27')]=_['intersection'](_0x24b205[_0x39b4b7('0x2b')],qs['fields'](_0x13bba4['query']['fields'])),_0x1f7982[_0x39b4b7('0x27')]=_0x1f7982['attributes'][_0x39b4b7('0xd')]?_0x1f7982[_0x39b4b7('0x27')]:_0x24b205[_0x39b4b7('0x2b')],_0x1f7982['order']=qs[_0x39b4b7('0xa')](_0x13bba4[_0x39b4b7('0x18')][_0x39b4b7('0xa')]),_0x1f7982['where']=qs[_0x39b4b7('0x8')](_['pick'](_0x13bba4[_0x39b4b7('0x18')],_0x24b205[_0x39b4b7('0x8')])),_0x13bba4[_0x39b4b7('0x18')][_0x39b4b7('0x12')]&&(_0x1f7982[_0x39b4b7('0x10')]=_[_0x39b4b7('0x0')](_0x1f7982[_0x39b4b7('0x10')],{[Op['or']]:_[_0x39b4b7('0x31')](_0x1f7982[_0x39b4b7('0x27')],function(_0x2bddb9){const _0x2487c9=_0x39b4b7,_0x4d939e={};return _0x4d939e[_0x2bddb9]={[Op['like']]:'%'+_0x13bba4[_0x2487c9('0x18')]['filter']+'%'},_0x4d939e;})})),_0x1f7982=_[_0x39b4b7('0x0')]({},_0x1f7982,_0x13bba4['options']),_0x363d0c[_0x39b4b7('0x24')](_0x1f7982);})[_0x250de9('0x34')](function(_0x24df22){const _0x42e64d=_0x250de9;if(_0x24df22)return _0x57cace=_0x24df22['length'],typeof _0x13bba4['query'][_0x42e64d('0x9')]===_0x42e64d('0x19')&&(_0x1f7982['limit']=qs['limit'](_0x13bba4[_0x42e64d('0x18')][_0x42e64d('0x1e')]),_0x1f7982['offset']=qs[_0x42e64d('0x3')](_0x13bba4['query'][_0x42e64d('0x3')])),_0x363d0c['getDescriptions'](_0x1f7982);})['then'](function(_0x319e11){if(_0x319e11)return _0x319e11?{'count':_0x57cace,'rows':_0x319e11}:null;})[_0x250de9('0x34')](respondWithResult(_0x19409f,null))[_0x250de9('0x25')](handleError(_0x19409f,null));};
\ No newline at end of file