Built motion from commit a9fb64cc6defd8fb3a5cc199221f878e91c0e969. Version 3.0.0...
[motion-next.git] / server / api / intSugarcrmConfiguration / intSugarcrmConfiguration.controller.js
index f3c1d68..8f51b8a 100644 (file)
@@ -1 +1 @@
-const a312_0x376b=['SugarcrmConfiguration','length','order','rows','pick','map','SugarcrmField','sort','model','send','status','findOne','end','then','VIRTUAL','../../mysqldb','lodash','filter','filters','create','body','getSubjects','getFields','limit','keys','fields','merge','query','name','attributes','findAll','sendStatus','getDescriptions','fieldName','offset','catch','like','rawAttributes','type','intersection','params','update','json','set','key','options','index','count','where','destroy','nolimit','Content-Range','includeAll','undefined'];(function(_0x31fbb4,_0x376be9){const _0x4ee202=function(_0x272939){while(--_0x272939){_0x31fbb4['push'](_0x31fbb4['shift']());}};_0x4ee202(++_0x376be9);}(a312_0x376b,0x132));const a312_0x4ee2=function(_0x31fbb4,_0x376be9){_0x31fbb4=_0x31fbb4-0x0;let _0x4ee202=a312_0x376b[_0x31fbb4];return _0x4ee202;};const _0x18a6b7=a312_0x4ee2;'use strict';const _=require(_0x18a6b7('0x22')),qs=require('../../components/parsers/qs'),logger=require('../../config/logger')('api'),db=require(_0x18a6b7('0x21'))['db'],{Op}=require('sequelize');function respondWithResult(_0x272939,_0x136ad8){return _0x136ad8=_0x136ad8||0xc8,function(_0x16c52c){if(_0x16c52c)return _0x272939['status'](_0x136ad8)['json'](_0x16c52c);};}function respondWithFilteredResult(_0x4c0819,_0x1f9329){return function(_0x1e6365){const _0x44a6b7=a312_0x4ee2;if(_0x1e6365){const _0x5e6ff1=_0x1e6365[_0x44a6b7('0xb')],_0x1ab874=_0x1f9329[_0x44a6b7('0x34')];let _0x2d54fe=_0x1f9329['offset']+_0x1f9329['limit'],_0x3d2427;return _0x2d54fe>=_0x5e6ff1?(_0x2d54fe=_0x5e6ff1,_0x3d2427=0xc8):_0x3d2427=0xce,_0x4c0819[_0x44a6b7('0x1c')](_0x3d2427),_0x4c0819[_0x44a6b7('0x7')](_0x44a6b7('0xf'),_0x1ab874+'-'+_0x2d54fe+'/'+_0x5e6ff1)[_0x44a6b7('0x6')](_0x1e6365);}return null;};}function saveUpdates(_0x53bec2){return function(_0x221726){const _0x17033b=a312_0x4ee2;if(_0x221726)return _0x221726[_0x17033b('0x5')](_0x53bec2)[_0x17033b('0x1f')](function(_0x262791){return _0x262791;});return null;};}function removeEntity(_0x19ad6c){return function(_0x1d9820){const _0x1f2eb1=a312_0x4ee2;if(_0x1d9820)return _0x1d9820[_0x1f2eb1('0xd')]()[_0x1f2eb1('0x1f')](function(){const _0x176df0=_0x1f2eb1;_0x19ad6c[_0x176df0('0x1c')](0xcc)[_0x176df0('0x1e')]();});};}function handleEntityNotFound(_0x4f81d3){return function(_0x111b4d){const _0x334955=a312_0x4ee2;return!_0x111b4d&&_0x4f81d3[_0x334955('0x31')](0x194),_0x111b4d;};}function handleError(_0x43ae89,_0x4e298a){return _0x4e298a=_0x4e298a||0x1f4,function(_0x4a6a8){const _0x52722d=a312_0x4ee2;logger['error'](_0x4a6a8['stack']),_0x4a6a8[_0x52722d('0x2e')]&&delete _0x4a6a8[_0x52722d('0x2e')],_0x43ae89[_0x52722d('0x1c')](_0x4e298a)[_0x52722d('0x1b')](_0x4a6a8);};}exports[_0x18a6b7('0xa')]=function(_0x9fe70c,_0x121e5e){const _0x337418=_0x18a6b7;let _0x49a1f4={};const _0x8aa3f2={},_0x56ebed={'count':0x0,'rows':[]},_0x2949a1=_[_0x337418('0x17')](db['SugarcrmConfiguration'][_0x337418('0x1')],function(_0x16cdb6){const _0x5a3e32=_0x337418;return{'name':_0x16cdb6[_0x5a3e32('0x33')],'type':_0x16cdb6[_0x5a3e32('0x2')][_0x5a3e32('0x8')]};});_0x8aa3f2[_0x337418('0x1a')]=_[_0x337418('0x17')](_0x2949a1,_0x337418('0x2e')),_0x8aa3f2[_0x337418('0x2d')]=_[_0x337418('0x2a')](_0x9fe70c[_0x337418('0x2d')]),_0x8aa3f2[_0x337418('0x24')]=_['intersection'](_0x8aa3f2['model'],_0x8aa3f2[_0x337418('0x2d')]),_0x49a1f4['attributes']=_[_0x337418('0x3')](_0x8aa3f2[_0x337418('0x1a')],qs[_0x337418('0x2b')](_0x9fe70c[_0x337418('0x2d')][_0x337418('0x2b')])),_0x49a1f4[_0x337418('0x2f')]=_0x49a1f4[_0x337418('0x2f')][_0x337418('0x13')]?_0x49a1f4[_0x337418('0x2f')]:_0x8aa3f2[_0x337418('0x1a')];typeof _0x9fe70c[_0x337418('0x2d')][_0x337418('0xe')]===_0x337418('0x11')&&(_0x49a1f4[_0x337418('0x29')]=qs[_0x337418('0x29')](_0x9fe70c[_0x337418('0x2d')][_0x337418('0x29')]),_0x49a1f4[_0x337418('0x34')]=qs[_0x337418('0x34')](_0x9fe70c[_0x337418('0x2d')]['offset']));_0x49a1f4[_0x337418('0x14')]=qs[_0x337418('0x19')](_0x9fe70c[_0x337418('0x2d')][_0x337418('0x19')]),_0x49a1f4[_0x337418('0xc')]=qs[_0x337418('0x24')](_[_0x337418('0x16')](_0x9fe70c[_0x337418('0x2d')],_0x8aa3f2[_0x337418('0x24')]),_0x2949a1);_0x9fe70c[_0x337418('0x2d')][_0x337418('0x23')]&&(_0x49a1f4[_0x337418('0xc')]=_['merge'](_0x49a1f4[_0x337418('0xc')],{[Op['or']]:_[_0x337418('0x17')](_0x2949a1,function(_0x2b40e1){const _0x219348=_0x337418;if(_0x2b40e1['type']!==_0x219348('0x20')){const _0x187c80={};return _0x187c80[_0x2b40e1[_0x219348('0x2e')]]={[Op['like']]:'%'+_0x9fe70c[_0x219348('0x2d')][_0x219348('0x23')]+'%'},_0x187c80;}})}));_0x49a1f4=_['merge']({},_0x49a1f4,_0x9fe70c['options']);const _0x139c1a={'where':_0x49a1f4[_0x337418('0xc')]};return db[_0x337418('0x12')][_0x337418('0xb')](_0x139c1a)['then'](function(_0x2a87e5){const _0x11c8a9=_0x337418;return _0x56ebed['count']=_0x2a87e5,_0x9fe70c[_0x11c8a9('0x2d')][_0x11c8a9('0x10')]&&(_0x49a1f4['include']=[{'all':!![]}]),db['SugarcrmConfiguration'][_0x11c8a9('0x30')](_0x49a1f4);})[_0x337418('0x1f')](function(_0x1e80e0){const _0x340264=_0x337418;return _0x56ebed[_0x340264('0x15')]=_0x1e80e0,_0x56ebed;})[_0x337418('0x1f')](respondWithFilteredResult(_0x121e5e,_0x49a1f4))[_0x337418('0x35')](handleError(_0x121e5e,null));},exports['show']=function(_0x378760,_0xec8bc){const _0x25de1b=_0x18a6b7;let _0x39f7ca={'raw':![],'where':{'id':_0x378760[_0x25de1b('0x4')]['id']}};const _0x4abb61={};return _0x4abb61[_0x25de1b('0x1a')]=_[_0x25de1b('0x2a')](db[_0x25de1b('0x12')][_0x25de1b('0x1')]),_0x4abb61['query']=_[_0x25de1b('0x2a')](_0x378760[_0x25de1b('0x2d')]),_0x4abb61[_0x25de1b('0x24')]=_[_0x25de1b('0x3')](_0x4abb61[_0x25de1b('0x1a')],_0x4abb61[_0x25de1b('0x2d')]),_0x39f7ca[_0x25de1b('0x2f')]=_[_0x25de1b('0x3')](_0x4abb61[_0x25de1b('0x1a')],qs[_0x25de1b('0x2b')](_0x378760[_0x25de1b('0x2d')][_0x25de1b('0x2b')])),_0x39f7ca['attributes']=_0x39f7ca[_0x25de1b('0x2f')]['length']?_0x39f7ca[_0x25de1b('0x2f')]:_0x4abb61['model'],_0x378760[_0x25de1b('0x2d')]['includeAll']&&(_0x39f7ca['include']=[{'all':!![]}]),_0x39f7ca=_['merge']({},_0x39f7ca,_0x378760[_0x25de1b('0x9')]),db[_0x25de1b('0x12')][_0x25de1b('0x1d')](_0x39f7ca)[_0x25de1b('0x1f')](handleEntityNotFound(_0xec8bc,null))[_0x25de1b('0x1f')](respondWithResult(_0xec8bc,null))[_0x25de1b('0x35')](handleError(_0xec8bc,null));},exports['create']=function(_0x255872,_0x4fcb68){const _0x562195=_0x18a6b7;return db[_0x562195('0x12')][_0x562195('0x25')](_0x255872[_0x562195('0x26')],{})[_0x562195('0x1f')](respondWithResult(_0x4fcb68,0xc9))[_0x562195('0x35')](handleError(_0x4fcb68,null));},exports[_0x18a6b7('0x5')]=function(_0x4ece64,_0x30e790){const _0x176640=_0x18a6b7;return _0x4ece64[_0x176640('0x26')]['id']&&delete _0x4ece64[_0x176640('0x26')]['id'],db['SugarcrmConfiguration'][_0x176640('0x1d')]({'where':{'id':_0x4ece64[_0x176640('0x4')]['id']}})[_0x176640('0x1f')](handleEntityNotFound(_0x30e790,null))[_0x176640('0x1f')](saveUpdates(_0x4ece64['body'],null))['then'](respondWithResult(_0x30e790,null))['catch'](handleError(_0x30e790,null));},exports['destroy']=function(_0xb43dd6,_0x13b2bc){const _0x10b9b0=_0x18a6b7;return db[_0x10b9b0('0x12')]['findOne']({'where':{'id':_0xb43dd6[_0x10b9b0('0x4')]['id']}})[_0x10b9b0('0x1f')](handleEntityNotFound(_0x13b2bc,null))[_0x10b9b0('0x1f')](removeEntity(_0x13b2bc,null))[_0x10b9b0('0x35')](handleError(_0x13b2bc,null));},exports['getFields']=function(_0x8de847,_0x543326){const _0x3535bb=_0x18a6b7;let _0x111ce0={};const _0xe4d448={};let _0x53d9f8,_0x42cda9;return db['SugarcrmConfiguration'][_0x3535bb('0x1d')]({'where':{'id':_0x8de847['params']['id']}})[_0x3535bb('0x1f')](handleEntityNotFound(_0x543326,null))[_0x3535bb('0x1f')](function(_0x57849d){const _0x2ea6cb=_0x3535bb;if(_0x57849d)return _0x53d9f8=_0x57849d,_0xe4d448[_0x2ea6cb('0x1a')]=_[_0x2ea6cb('0x2a')](db[_0x2ea6cb('0x18')][_0x2ea6cb('0x1')]),_0xe4d448[_0x2ea6cb('0x2d')]=_[_0x2ea6cb('0x2a')](_0x8de847['query']),_0xe4d448[_0x2ea6cb('0x24')]=_[_0x2ea6cb('0x3')](_0xe4d448['model'],_0xe4d448[_0x2ea6cb('0x2d')]),_0x111ce0[_0x2ea6cb('0x2f')]=_['intersection'](_0xe4d448[_0x2ea6cb('0x1a')],qs[_0x2ea6cb('0x2b')](_0x8de847[_0x2ea6cb('0x2d')][_0x2ea6cb('0x2b')])),_0x111ce0[_0x2ea6cb('0x2f')]=_0x111ce0['attributes'][_0x2ea6cb('0x13')]?_0x111ce0[_0x2ea6cb('0x2f')]:_0xe4d448['model'],_0x111ce0[_0x2ea6cb('0x14')]=qs['sort'](_0x8de847['query'][_0x2ea6cb('0x19')]),_0x111ce0[_0x2ea6cb('0xc')]=qs['filters'](_['pick'](_0x8de847[_0x2ea6cb('0x2d')],_0xe4d448[_0x2ea6cb('0x24')])),_0x8de847[_0x2ea6cb('0x2d')][_0x2ea6cb('0x23')]&&(_0x111ce0[_0x2ea6cb('0xc')]=_['merge'](_0x111ce0['where'],{[Op['or']]:_['map'](_0x111ce0[_0x2ea6cb('0x2f')],function(_0x55dd67){const _0x2f4fde=_0x2ea6cb,_0x541c2d={};return _0x541c2d[_0x55dd67]={[Op[_0x2f4fde('0x0')]]:'%'+_0x8de847[_0x2f4fde('0x2d')]['filter']+'%'},_0x541c2d;})})),_0x111ce0=_[_0x2ea6cb('0x2c')]({},_0x111ce0,_0x8de847[_0x2ea6cb('0x9')]),_0x53d9f8[_0x2ea6cb('0x28')](_0x111ce0);})[_0x3535bb('0x1f')](function(_0x20df3d){const _0x175d5c=_0x3535bb;if(_0x20df3d)return _0x42cda9=_0x20df3d[_0x175d5c('0x13')],typeof _0x8de847[_0x175d5c('0x2d')][_0x175d5c('0xe')]===_0x175d5c('0x11')&&(_0x111ce0[_0x175d5c('0x29')]=qs['limit'](_0x8de847['query'][_0x175d5c('0x29')]),_0x111ce0['offset']=qs['offset'](_0x8de847[_0x175d5c('0x2d')][_0x175d5c('0x34')])),_0x53d9f8[_0x175d5c('0x28')](_0x111ce0);})[_0x3535bb('0x1f')](function(_0x21f300){if(_0x21f300)return _0x21f300?{'count':_0x42cda9,'rows':_0x21f300}:null;})[_0x3535bb('0x1f')](respondWithResult(_0x543326,null))[_0x3535bb('0x35')](handleError(_0x543326,null));},exports[_0x18a6b7('0x27')]=function(_0x395f75,_0x5cc8c0){const _0x1b7b6b=_0x18a6b7;let _0x5cd802={};const _0x2f3874={};let _0x411952,_0x54c300;return db[_0x1b7b6b('0x12')][_0x1b7b6b('0x1d')]({'where':{'id':_0x395f75[_0x1b7b6b('0x4')]['id']}})[_0x1b7b6b('0x1f')](handleEntityNotFound(_0x5cc8c0,null))[_0x1b7b6b('0x1f')](function(_0xeee801){const _0x34aca8=_0x1b7b6b;if(_0xeee801)return _0x411952=_0xeee801,_0x2f3874[_0x34aca8('0x1a')]=_[_0x34aca8('0x2a')](db['SugarcrmField'][_0x34aca8('0x1')]),_0x2f3874[_0x34aca8('0x2d')]=_['keys'](_0x395f75['query']),_0x2f3874[_0x34aca8('0x24')]=_[_0x34aca8('0x3')](_0x2f3874[_0x34aca8('0x1a')],_0x2f3874[_0x34aca8('0x2d')]),_0x5cd802[_0x34aca8('0x2f')]=_[_0x34aca8('0x3')](_0x2f3874[_0x34aca8('0x1a')],qs[_0x34aca8('0x2b')](_0x395f75[_0x34aca8('0x2d')][_0x34aca8('0x2b')])),_0x5cd802['attributes']=_0x5cd802[_0x34aca8('0x2f')][_0x34aca8('0x13')]?_0x5cd802[_0x34aca8('0x2f')]:_0x2f3874[_0x34aca8('0x1a')],_0x5cd802[_0x34aca8('0x14')]=qs[_0x34aca8('0x19')](_0x395f75[_0x34aca8('0x2d')][_0x34aca8('0x19')]),_0x5cd802['where']=qs[_0x34aca8('0x24')](_['pick'](_0x395f75['query'],_0x2f3874[_0x34aca8('0x24')])),_0x395f75[_0x34aca8('0x2d')][_0x34aca8('0x23')]&&(_0x5cd802[_0x34aca8('0xc')]=_['merge'](_0x5cd802['where'],{[Op['or']]:_[_0x34aca8('0x17')](_0x5cd802[_0x34aca8('0x2f')],function(_0x38e631){const _0x49ad3a=_0x34aca8,_0x4870f2={};return _0x4870f2[_0x38e631]={[Op[_0x49ad3a('0x0')]]:'%'+_0x395f75['query'][_0x49ad3a('0x23')]+'%'},_0x4870f2;})})),_0x5cd802=_[_0x34aca8('0x2c')]({},_0x5cd802,_0x395f75[_0x34aca8('0x9')]),_0x411952[_0x34aca8('0x27')](_0x5cd802);})['then'](function(_0x2bb728){const _0x440cab=_0x1b7b6b;if(_0x2bb728)return _0x54c300=_0x2bb728[_0x440cab('0x13')],typeof _0x395f75[_0x440cab('0x2d')][_0x440cab('0xe')]==='undefined'&&(_0x5cd802[_0x440cab('0x29')]=qs[_0x440cab('0x29')](_0x395f75[_0x440cab('0x2d')]['limit']),_0x5cd802[_0x440cab('0x34')]=qs[_0x440cab('0x34')](_0x395f75[_0x440cab('0x2d')][_0x440cab('0x34')])),_0x411952[_0x440cab('0x27')](_0x5cd802);})[_0x1b7b6b('0x1f')](function(_0x335656){if(_0x335656)return _0x335656?{'count':_0x54c300,'rows':_0x335656}:null;})['then'](respondWithResult(_0x5cc8c0,null))[_0x1b7b6b('0x35')](handleError(_0x5cc8c0,null));},exports[_0x18a6b7('0x32')]=function(_0x44ab5a,_0xe63da9){const _0x4c5e8c=_0x18a6b7;let _0x1ca69a={};const _0x2d87ef={};let _0x1ad722,_0x156b91;return db[_0x4c5e8c('0x12')][_0x4c5e8c('0x1d')]({'where':{'id':_0x44ab5a['params']['id']}})[_0x4c5e8c('0x1f')](handleEntityNotFound(_0xe63da9,null))[_0x4c5e8c('0x1f')](function(_0x2fd11f){const _0x3ed2c8=_0x4c5e8c;if(_0x2fd11f)return _0x1ad722=_0x2fd11f,_0x2d87ef[_0x3ed2c8('0x1a')]=_['keys'](db[_0x3ed2c8('0x18')]['rawAttributes']),_0x2d87ef['query']=_[_0x3ed2c8('0x2a')](_0x44ab5a[_0x3ed2c8('0x2d')]),_0x2d87ef[_0x3ed2c8('0x24')]=_['intersection'](_0x2d87ef['model'],_0x2d87ef['query']),_0x1ca69a['attributes']=_[_0x3ed2c8('0x3')](_0x2d87ef[_0x3ed2c8('0x1a')],qs['fields'](_0x44ab5a[_0x3ed2c8('0x2d')]['fields'])),_0x1ca69a[_0x3ed2c8('0x2f')]=_0x1ca69a[_0x3ed2c8('0x2f')][_0x3ed2c8('0x13')]?_0x1ca69a[_0x3ed2c8('0x2f')]:_0x2d87ef[_0x3ed2c8('0x1a')],_0x1ca69a[_0x3ed2c8('0x14')]=qs[_0x3ed2c8('0x19')](_0x44ab5a[_0x3ed2c8('0x2d')][_0x3ed2c8('0x19')]),_0x1ca69a[_0x3ed2c8('0xc')]=qs[_0x3ed2c8('0x24')](_[_0x3ed2c8('0x16')](_0x44ab5a[_0x3ed2c8('0x2d')],_0x2d87ef[_0x3ed2c8('0x24')])),_0x44ab5a['query'][_0x3ed2c8('0x23')]&&(_0x1ca69a[_0x3ed2c8('0xc')]=_[_0x3ed2c8('0x2c')](_0x1ca69a[_0x3ed2c8('0xc')],{[Op['or']]:_[_0x3ed2c8('0x17')](_0x1ca69a[_0x3ed2c8('0x2f')],function(_0x3c19bb){const _0x1bcc05=_0x3ed2c8,_0x4f79c5={};return _0x4f79c5[_0x3c19bb]={[Op[_0x1bcc05('0x0')]]:'%'+_0x44ab5a[_0x1bcc05('0x2d')][_0x1bcc05('0x23')]+'%'},_0x4f79c5;})})),_0x1ca69a=_[_0x3ed2c8('0x2c')]({},_0x1ca69a,_0x44ab5a[_0x3ed2c8('0x9')]),_0x1ad722[_0x3ed2c8('0x32')](_0x1ca69a);})[_0x4c5e8c('0x1f')](function(_0x23ccc9){const _0x5d914b=_0x4c5e8c;if(_0x23ccc9)return _0x156b91=_0x23ccc9['length'],typeof _0x44ab5a[_0x5d914b('0x2d')][_0x5d914b('0xe')]==='undefined'&&(_0x1ca69a[_0x5d914b('0x29')]=qs['limit'](_0x44ab5a['query']['limit']),_0x1ca69a[_0x5d914b('0x34')]=qs['offset'](_0x44ab5a[_0x5d914b('0x2d')][_0x5d914b('0x34')])),_0x1ad722[_0x5d914b('0x32')](_0x1ca69a);})[_0x4c5e8c('0x1f')](function(_0x14033e){if(_0x14033e)return _0x14033e?{'count':_0x156b91,'rows':_0x14033e}:null;})['then'](respondWithResult(_0xe63da9,null))[_0x4c5e8c('0x35')](handleError(_0xe63da9,null));};
\ No newline at end of file
+const a312_0x4c71=['then','include','api','order','../../mysqldb','count','status','catch','stack','query','filter','pick','attributes','json','destroy','params','keys','name','SugarcrmField','SugarcrmConfiguration','type','body','set','fields','getFields','rawAttributes','intersection','send','rows','error','undefined','create','merge','getSubjects','../../components/parsers/qs','getDescriptions','map','where','key','options','update','sort','findAll','lodash','sendStatus','index','findOne','offset','nolimit','filters','model','limit','Content-Range','like','VIRTUAL','length','includeAll'];(function(_0x301eab,_0x4c71ab){const _0x4a4a86=function(_0x3fad1c){while(--_0x3fad1c){_0x301eab['push'](_0x301eab['shift']());}};_0x4a4a86(++_0x4c71ab);}(a312_0x4c71,0xb8));const a312_0x4a4a=function(_0x301eab,_0x4c71ab){_0x301eab=_0x301eab-0x0;let _0x4a4a86=a312_0x4c71[_0x301eab];return _0x4a4a86;};const _0x9257f7=a312_0x4a4a;'use strict';const _=require(_0x9257f7('0x1e')),qs=require(_0x9257f7('0x15')),logger=require('../../config/logger')(_0x9257f7('0x2e')),db=require(_0x9257f7('0x30'))['db'],{Op}=require('sequelize');function respondWithResult(_0x3fad1c,_0x3c5b3e){return _0x3c5b3e=_0x3c5b3e||0xc8,function(_0x3be2ed){const _0x56606e=a312_0x4a4a;if(_0x3be2ed)return _0x3fad1c[_0x56606e('0x32')](_0x3c5b3e)[_0x56606e('0x0')](_0x3be2ed);};}function respondWithFilteredResult(_0x2a2aa3,_0x142ef9){return function(_0x1510c1){const _0x1462c7=a312_0x4a4a;if(_0x1510c1){const _0x38c1f2=_0x1510c1[_0x1462c7('0x31')],_0x3193ca=_0x142ef9[_0x1462c7('0x22')];let _0x421c1a=_0x142ef9[_0x1462c7('0x22')]+_0x142ef9['limit'],_0x1b24fe;return _0x421c1a>=_0x38c1f2?(_0x421c1a=_0x38c1f2,_0x1b24fe=0xc8):_0x1b24fe=0xce,_0x2a2aa3['status'](_0x1b24fe),_0x2a2aa3[_0x1462c7('0x9')](_0x1462c7('0x27'),_0x3193ca+'-'+_0x421c1a+'/'+_0x38c1f2)['json'](_0x1510c1);}return null;};}function saveUpdates(_0x2e17d1){return function(_0x37e1e8){const _0x23cc3f=a312_0x4a4a;if(_0x37e1e8)return _0x37e1e8[_0x23cc3f('0x1b')](_0x2e17d1)[_0x23cc3f('0x2c')](function(_0x4eb4b8){return _0x4eb4b8;});return null;};}function removeEntity(_0x46cdc9){return function(_0x43a03a){if(_0x43a03a)return _0x43a03a['destroy']()['then'](function(){const _0x1ce18e=a312_0x4a4a;_0x46cdc9[_0x1ce18e('0x32')](0xcc)['end']();});};}function handleEntityNotFound(_0x50d818){return function(_0x2333ee){const _0x455048=a312_0x4a4a;return!_0x2333ee&&_0x50d818[_0x455048('0x1f')](0x194),_0x2333ee;};}function handleError(_0xd2b613,_0x23b49f){return _0x23b49f=_0x23b49f||0x1f4,function(_0x5b0616){const _0x48718b=a312_0x4a4a;logger[_0x48718b('0x10')](_0x5b0616[_0x48718b('0x34')]),_0x5b0616[_0x48718b('0x4')]&&delete _0x5b0616[_0x48718b('0x4')],_0xd2b613['status'](_0x23b49f)[_0x48718b('0xe')](_0x5b0616);};}exports[_0x9257f7('0x20')]=function(_0x3687e4,_0x523d8c){const _0x2b900e=_0x9257f7;let _0x55ecbd={};const _0xc879f4={},_0x1fd84d={'count':0x0,'rows':[]},_0x21c04d=_[_0x2b900e('0x17')](db[_0x2b900e('0x6')][_0x2b900e('0xc')],function(_0x21b71c){const _0x3c5198=_0x2b900e;return{'name':_0x21b71c['fieldName'],'type':_0x21b71c[_0x3c5198('0x7')][_0x3c5198('0x19')]};});_0xc879f4[_0x2b900e('0x25')]=_[_0x2b900e('0x17')](_0x21c04d,'name'),_0xc879f4[_0x2b900e('0x35')]=_[_0x2b900e('0x3')](_0x3687e4[_0x2b900e('0x35')]),_0xc879f4[_0x2b900e('0x24')]=_[_0x2b900e('0xd')](_0xc879f4[_0x2b900e('0x25')],_0xc879f4[_0x2b900e('0x35')]),_0x55ecbd[_0x2b900e('0x38')]=_['intersection'](_0xc879f4[_0x2b900e('0x25')],qs['fields'](_0x3687e4[_0x2b900e('0x35')][_0x2b900e('0xa')])),_0x55ecbd[_0x2b900e('0x38')]=_0x55ecbd[_0x2b900e('0x38')]['length']?_0x55ecbd[_0x2b900e('0x38')]:_0xc879f4[_0x2b900e('0x25')];typeof _0x3687e4[_0x2b900e('0x35')][_0x2b900e('0x23')]==='undefined'&&(_0x55ecbd[_0x2b900e('0x26')]=qs[_0x2b900e('0x26')](_0x3687e4[_0x2b900e('0x35')][_0x2b900e('0x26')]),_0x55ecbd[_0x2b900e('0x22')]=qs[_0x2b900e('0x22')](_0x3687e4[_0x2b900e('0x35')][_0x2b900e('0x22')]));_0x55ecbd[_0x2b900e('0x2f')]=qs[_0x2b900e('0x1c')](_0x3687e4[_0x2b900e('0x35')][_0x2b900e('0x1c')]),_0x55ecbd[_0x2b900e('0x18')]=qs[_0x2b900e('0x24')](_[_0x2b900e('0x37')](_0x3687e4[_0x2b900e('0x35')],_0xc879f4[_0x2b900e('0x24')]),_0x21c04d);_0x3687e4[_0x2b900e('0x35')][_0x2b900e('0x36')]&&(_0x55ecbd['where']=_[_0x2b900e('0x13')](_0x55ecbd[_0x2b900e('0x18')],{[Op['or']]:_[_0x2b900e('0x17')](_0x21c04d,function(_0x117441){const _0x407346=_0x2b900e;if(_0x117441[_0x407346('0x7')]!==_0x407346('0x29')){const _0x50cda1={};return _0x50cda1[_0x117441[_0x407346('0x4')]]={[Op[_0x407346('0x28')]]:'%'+_0x3687e4[_0x407346('0x35')]['filter']+'%'},_0x50cda1;}})}));_0x55ecbd=_['merge']({},_0x55ecbd,_0x3687e4[_0x2b900e('0x1a')]);const _0x5e22d5={'where':_0x55ecbd['where']};return db[_0x2b900e('0x6')][_0x2b900e('0x31')](_0x5e22d5)[_0x2b900e('0x2c')](function(_0x4e1152){const _0x95a476=_0x2b900e;return _0x1fd84d[_0x95a476('0x31')]=_0x4e1152,_0x3687e4[_0x95a476('0x35')]['includeAll']&&(_0x55ecbd['include']=[{'all':!![]}]),db['SugarcrmConfiguration'][_0x95a476('0x1d')](_0x55ecbd);})[_0x2b900e('0x2c')](function(_0x5e7093){const _0x4a4c44=_0x2b900e;return _0x1fd84d[_0x4a4c44('0xf')]=_0x5e7093,_0x1fd84d;})[_0x2b900e('0x2c')](respondWithFilteredResult(_0x523d8c,_0x55ecbd))[_0x2b900e('0x33')](handleError(_0x523d8c,null));},exports['show']=function(_0x35db65,_0x485997){const _0x1e26dc=_0x9257f7;let _0x3d7471={'raw':![],'where':{'id':_0x35db65[_0x1e26dc('0x2')]['id']}};const _0x45af88={};return _0x45af88['model']=_[_0x1e26dc('0x3')](db['SugarcrmConfiguration'][_0x1e26dc('0xc')]),_0x45af88[_0x1e26dc('0x35')]=_[_0x1e26dc('0x3')](_0x35db65[_0x1e26dc('0x35')]),_0x45af88[_0x1e26dc('0x24')]=_[_0x1e26dc('0xd')](_0x45af88[_0x1e26dc('0x25')],_0x45af88[_0x1e26dc('0x35')]),_0x3d7471[_0x1e26dc('0x38')]=_[_0x1e26dc('0xd')](_0x45af88[_0x1e26dc('0x25')],qs[_0x1e26dc('0xa')](_0x35db65[_0x1e26dc('0x35')][_0x1e26dc('0xa')])),_0x3d7471[_0x1e26dc('0x38')]=_0x3d7471[_0x1e26dc('0x38')]['length']?_0x3d7471[_0x1e26dc('0x38')]:_0x45af88[_0x1e26dc('0x25')],_0x35db65[_0x1e26dc('0x35')][_0x1e26dc('0x2b')]&&(_0x3d7471[_0x1e26dc('0x2d')]=[{'all':!![]}]),_0x3d7471=_[_0x1e26dc('0x13')]({},_0x3d7471,_0x35db65[_0x1e26dc('0x1a')]),db[_0x1e26dc('0x6')][_0x1e26dc('0x21')](_0x3d7471)[_0x1e26dc('0x2c')](handleEntityNotFound(_0x485997,null))[_0x1e26dc('0x2c')](respondWithResult(_0x485997,null))[_0x1e26dc('0x33')](handleError(_0x485997,null));},exports[_0x9257f7('0x12')]=function(_0x29945c,_0x3099bc){const _0x5c75b8=_0x9257f7;return db[_0x5c75b8('0x6')]['create'](_0x29945c[_0x5c75b8('0x8')],{})[_0x5c75b8('0x2c')](respondWithResult(_0x3099bc,0xc9))[_0x5c75b8('0x33')](handleError(_0x3099bc,null));},exports[_0x9257f7('0x1b')]=function(_0x1e3d38,_0x23c447){const _0x364a52=_0x9257f7;return _0x1e3d38[_0x364a52('0x8')]['id']&&delete _0x1e3d38[_0x364a52('0x8')]['id'],db[_0x364a52('0x6')]['findOne']({'where':{'id':_0x1e3d38[_0x364a52('0x2')]['id']}})[_0x364a52('0x2c')](handleEntityNotFound(_0x23c447,null))[_0x364a52('0x2c')](saveUpdates(_0x1e3d38[_0x364a52('0x8')],null))['then'](respondWithResult(_0x23c447,null))[_0x364a52('0x33')](handleError(_0x23c447,null));},exports[_0x9257f7('0x1')]=function(_0xcc5793,_0x4369bf){const _0x4c2d93=_0x9257f7;return db[_0x4c2d93('0x6')][_0x4c2d93('0x21')]({'where':{'id':_0xcc5793[_0x4c2d93('0x2')]['id']}})['then'](handleEntityNotFound(_0x4369bf,null))[_0x4c2d93('0x2c')](removeEntity(_0x4369bf,null))['catch'](handleError(_0x4369bf,null));},exports['getFields']=function(_0x312ecb,_0x2191c3){const _0x269904=_0x9257f7;let _0x1e3942={};const _0x430dc5={};let _0x8552cb,_0x27242c;return db[_0x269904('0x6')][_0x269904('0x21')]({'where':{'id':_0x312ecb[_0x269904('0x2')]['id']}})['then'](handleEntityNotFound(_0x2191c3,null))[_0x269904('0x2c')](function(_0x3b5aac){const _0x592f30=_0x269904;if(_0x3b5aac)return _0x8552cb=_0x3b5aac,_0x430dc5[_0x592f30('0x25')]=_['keys'](db[_0x592f30('0x5')]['rawAttributes']),_0x430dc5[_0x592f30('0x35')]=_[_0x592f30('0x3')](_0x312ecb[_0x592f30('0x35')]),_0x430dc5['filters']=_[_0x592f30('0xd')](_0x430dc5[_0x592f30('0x25')],_0x430dc5[_0x592f30('0x35')]),_0x1e3942[_0x592f30('0x38')]=_[_0x592f30('0xd')](_0x430dc5[_0x592f30('0x25')],qs['fields'](_0x312ecb['query']['fields'])),_0x1e3942[_0x592f30('0x38')]=_0x1e3942[_0x592f30('0x38')][_0x592f30('0x2a')]?_0x1e3942[_0x592f30('0x38')]:_0x430dc5['model'],_0x1e3942[_0x592f30('0x2f')]=qs[_0x592f30('0x1c')](_0x312ecb['query']['sort']),_0x1e3942[_0x592f30('0x18')]=qs['filters'](_[_0x592f30('0x37')](_0x312ecb[_0x592f30('0x35')],_0x430dc5[_0x592f30('0x24')])),_0x312ecb[_0x592f30('0x35')][_0x592f30('0x36')]&&(_0x1e3942[_0x592f30('0x18')]=_[_0x592f30('0x13')](_0x1e3942[_0x592f30('0x18')],{[Op['or']]:_[_0x592f30('0x17')](_0x1e3942[_0x592f30('0x38')],function(_0x4477a7){const _0x711b48=_0x592f30,_0x1dcc3b={};return _0x1dcc3b[_0x4477a7]={[Op[_0x711b48('0x28')]]:'%'+_0x312ecb[_0x711b48('0x35')][_0x711b48('0x36')]+'%'},_0x1dcc3b;})})),_0x1e3942=_[_0x592f30('0x13')]({},_0x1e3942,_0x312ecb['options']),_0x8552cb[_0x592f30('0xb')](_0x1e3942);})[_0x269904('0x2c')](function(_0x42c747){const _0x368fc4=_0x269904;if(_0x42c747)return _0x27242c=_0x42c747[_0x368fc4('0x2a')],typeof _0x312ecb[_0x368fc4('0x35')][_0x368fc4('0x23')]===_0x368fc4('0x11')&&(_0x1e3942[_0x368fc4('0x26')]=qs[_0x368fc4('0x26')](_0x312ecb[_0x368fc4('0x35')][_0x368fc4('0x26')]),_0x1e3942[_0x368fc4('0x22')]=qs['offset'](_0x312ecb[_0x368fc4('0x35')][_0x368fc4('0x22')])),_0x8552cb['getFields'](_0x1e3942);})[_0x269904('0x2c')](function(_0x439d0c){if(_0x439d0c)return _0x439d0c?{'count':_0x27242c,'rows':_0x439d0c}:null;})[_0x269904('0x2c')](respondWithResult(_0x2191c3,null))[_0x269904('0x33')](handleError(_0x2191c3,null));},exports[_0x9257f7('0x14')]=function(_0x57019a,_0x510a89){const _0x49a972=_0x9257f7;let _0x36edc4={};const _0x457a7b={};let _0xc12421,_0x31c328;return db[_0x49a972('0x6')][_0x49a972('0x21')]({'where':{'id':_0x57019a[_0x49a972('0x2')]['id']}})['then'](handleEntityNotFound(_0x510a89,null))[_0x49a972('0x2c')](function(_0x774633){const _0x5e39dc=_0x49a972;if(_0x774633)return _0xc12421=_0x774633,_0x457a7b[_0x5e39dc('0x25')]=_['keys'](db['SugarcrmField'][_0x5e39dc('0xc')]),_0x457a7b['query']=_[_0x5e39dc('0x3')](_0x57019a[_0x5e39dc('0x35')]),_0x457a7b[_0x5e39dc('0x24')]=_[_0x5e39dc('0xd')](_0x457a7b[_0x5e39dc('0x25')],_0x457a7b['query']),_0x36edc4[_0x5e39dc('0x38')]=_[_0x5e39dc('0xd')](_0x457a7b[_0x5e39dc('0x25')],qs[_0x5e39dc('0xa')](_0x57019a[_0x5e39dc('0x35')][_0x5e39dc('0xa')])),_0x36edc4[_0x5e39dc('0x38')]=_0x36edc4[_0x5e39dc('0x38')][_0x5e39dc('0x2a')]?_0x36edc4[_0x5e39dc('0x38')]:_0x457a7b[_0x5e39dc('0x25')],_0x36edc4[_0x5e39dc('0x2f')]=qs[_0x5e39dc('0x1c')](_0x57019a[_0x5e39dc('0x35')]['sort']),_0x36edc4['where']=qs['filters'](_[_0x5e39dc('0x37')](_0x57019a['query'],_0x457a7b['filters'])),_0x57019a['query'][_0x5e39dc('0x36')]&&(_0x36edc4['where']=_['merge'](_0x36edc4[_0x5e39dc('0x18')],{[Op['or']]:_[_0x5e39dc('0x17')](_0x36edc4[_0x5e39dc('0x38')],function(_0x388ab9){const _0x25e666=_0x5e39dc,_0xd33eb5={};return _0xd33eb5[_0x388ab9]={[Op['like']]:'%'+_0x57019a[_0x25e666('0x35')]['filter']+'%'},_0xd33eb5;})})),_0x36edc4=_[_0x5e39dc('0x13')]({},_0x36edc4,_0x57019a[_0x5e39dc('0x1a')]),_0xc12421['getSubjects'](_0x36edc4);})[_0x49a972('0x2c')](function(_0x1ba235){const _0x7e7ce7=_0x49a972;if(_0x1ba235)return _0x31c328=_0x1ba235['length'],typeof _0x57019a['query'][_0x7e7ce7('0x23')]===_0x7e7ce7('0x11')&&(_0x36edc4[_0x7e7ce7('0x26')]=qs['limit'](_0x57019a[_0x7e7ce7('0x35')][_0x7e7ce7('0x26')]),_0x36edc4[_0x7e7ce7('0x22')]=qs[_0x7e7ce7('0x22')](_0x57019a['query']['offset'])),_0xc12421[_0x7e7ce7('0x14')](_0x36edc4);})['then'](function(_0x58f7b0){if(_0x58f7b0)return _0x58f7b0?{'count':_0x31c328,'rows':_0x58f7b0}:null;})[_0x49a972('0x2c')](respondWithResult(_0x510a89,null))[_0x49a972('0x33')](handleError(_0x510a89,null));},exports[_0x9257f7('0x16')]=function(_0x5f2ccc,_0x4d45ff){const _0x8c0976=_0x9257f7;let _0x5f4575={};const _0x5bd587={};let _0x8768f8,_0x15f46c;return db[_0x8c0976('0x6')]['findOne']({'where':{'id':_0x5f2ccc['params']['id']}})[_0x8c0976('0x2c')](handleEntityNotFound(_0x4d45ff,null))[_0x8c0976('0x2c')](function(_0x365dfd){const _0x4eba73=_0x8c0976;if(_0x365dfd)return _0x8768f8=_0x365dfd,_0x5bd587[_0x4eba73('0x25')]=_['keys'](db[_0x4eba73('0x5')][_0x4eba73('0xc')]),_0x5bd587[_0x4eba73('0x35')]=_[_0x4eba73('0x3')](_0x5f2ccc[_0x4eba73('0x35')]),_0x5bd587['filters']=_[_0x4eba73('0xd')](_0x5bd587[_0x4eba73('0x25')],_0x5bd587[_0x4eba73('0x35')]),_0x5f4575[_0x4eba73('0x38')]=_[_0x4eba73('0xd')](_0x5bd587[_0x4eba73('0x25')],qs['fields'](_0x5f2ccc['query'][_0x4eba73('0xa')])),_0x5f4575[_0x4eba73('0x38')]=_0x5f4575['attributes'][_0x4eba73('0x2a')]?_0x5f4575[_0x4eba73('0x38')]:_0x5bd587['model'],_0x5f4575[_0x4eba73('0x2f')]=qs[_0x4eba73('0x1c')](_0x5f2ccc['query'][_0x4eba73('0x1c')]),_0x5f4575[_0x4eba73('0x18')]=qs[_0x4eba73('0x24')](_[_0x4eba73('0x37')](_0x5f2ccc[_0x4eba73('0x35')],_0x5bd587[_0x4eba73('0x24')])),_0x5f2ccc['query']['filter']&&(_0x5f4575['where']=_[_0x4eba73('0x13')](_0x5f4575[_0x4eba73('0x18')],{[Op['or']]:_[_0x4eba73('0x17')](_0x5f4575[_0x4eba73('0x38')],function(_0x5323a9){const _0x472ce8=_0x4eba73,_0x1ee06e={};return _0x1ee06e[_0x5323a9]={[Op[_0x472ce8('0x28')]]:'%'+_0x5f2ccc[_0x472ce8('0x35')][_0x472ce8('0x36')]+'%'},_0x1ee06e;})})),_0x5f4575=_['merge']({},_0x5f4575,_0x5f2ccc[_0x4eba73('0x1a')]),_0x8768f8[_0x4eba73('0x16')](_0x5f4575);})['then'](function(_0x20722e){const _0x3f8801=_0x8c0976;if(_0x20722e)return _0x15f46c=_0x20722e['length'],typeof _0x5f2ccc[_0x3f8801('0x35')][_0x3f8801('0x23')]===_0x3f8801('0x11')&&(_0x5f4575[_0x3f8801('0x26')]=qs[_0x3f8801('0x26')](_0x5f2ccc[_0x3f8801('0x35')][_0x3f8801('0x26')]),_0x5f4575[_0x3f8801('0x22')]=qs[_0x3f8801('0x22')](_0x5f2ccc['query']['offset'])),_0x8768f8['getDescriptions'](_0x5f4575);})['then'](function(_0x40a8cb){if(_0x40a8cb)return _0x40a8cb?{'count':_0x15f46c,'rows':_0x40a8cb}:null;})[_0x8c0976('0x2c')](respondWithResult(_0x4d45ff,null))[_0x8c0976('0x33')](handleError(_0x4d45ff,null));};
\ No newline at end of file