Built motion from commit b517aaa2a6638133380e4d135c64a80893061362. Version 3.0.0...
[motion-next.git] / server / api / intVtigerConfiguration / intVtigerConfiguration.controller.js
index b2b3f23..72ae37b 100644 (file)
@@ -1 +1 @@
-const a325_0x5f10=['sort','count','rows','fieldName','offset','show','create','findOne','type','api','attributes','query','Content-Range','length','undefined','order','body','includeAll','getFields','options','sequelize','error','where','json','index','keys','filters','intersection','../../mysqldb','VIRTUAL','params','then','getSubjects','limit','getDescriptions','rawAttributes','map','VtigerConfiguration','catch','filter','nolimit','update','findAll','key','end','merge','fields','name','include','sendStatus','VtigerField','model','lodash','like','pick','set','status'];(function(_0x8d03a6,_0x5f107f){const _0xfad0b2=function(_0x29384d){while(--_0x29384d){_0x8d03a6['push'](_0x8d03a6['shift']());}};_0xfad0b2(++_0x5f107f);}(a325_0x5f10,0x10d));const a325_0xfad0=function(_0x8d03a6,_0x5f107f){_0x8d03a6=_0x8d03a6-0x0;let _0xfad0b2=a325_0x5f10[_0x8d03a6];return _0xfad0b2;};const _0x1b32e0=a325_0xfad0;'use strict';const _=require(_0x1b32e0('0xb')),qs=require('../../components/parsers/qs'),logger=require('../../config/logger')(_0x1b32e0('0x19')),db=require(_0x1b32e0('0x2c'))['db'],{Op}=require(_0x1b32e0('0x24'));function respondWithResult(_0x29384d,_0x19df94){return _0x19df94=_0x19df94||0xc8,function(_0x46c8bc){const _0x1d5836=a325_0xfad0;if(_0x46c8bc)return _0x29384d[_0x1d5836('0xf')](_0x19df94)[_0x1d5836('0x27')](_0x46c8bc);};}function respondWithFilteredResult(_0x15851e,_0x4ceae1){return function(_0x2cb182){const _0x493d47=a325_0xfad0;if(_0x2cb182){const _0x1270bc=_0x2cb182[_0x493d47('0x11')],_0x479dc8=_0x4ceae1['offset'];let _0xebd4d=_0x4ceae1[_0x493d47('0x14')]+_0x4ceae1[_0x493d47('0x31')],_0x2c7d07;return _0xebd4d>=_0x1270bc?(_0xebd4d=_0x1270bc,_0x2c7d07=0xc8):_0x2c7d07=0xce,_0x15851e[_0x493d47('0xf')](_0x2c7d07),_0x15851e[_0x493d47('0xe')](_0x493d47('0x1c'),_0x479dc8+'-'+_0xebd4d+'/'+_0x1270bc)[_0x493d47('0x27')](_0x2cb182);}return null;};}function saveUpdates(_0x5ea477){return function(_0x295aa6){const _0x401b9f=a325_0xfad0;if(_0x295aa6)return _0x295aa6[_0x401b9f('0x0')](_0x5ea477)[_0x401b9f('0x2f')](function(_0x60a1d1){return _0x60a1d1;});return null;};}function removeEntity(_0x236cfb){return function(_0x15b810){if(_0x15b810)return _0x15b810['destroy']()['then'](function(){const _0x5661e8=a325_0xfad0;_0x236cfb['status'](0xcc)[_0x5661e8('0x3')]();});};}function handleEntityNotFound(_0x4d106d){return function(_0x548245){const _0xe7021c=a325_0xfad0;return!_0x548245&&_0x4d106d[_0xe7021c('0x8')](0x194),_0x548245;};}function handleError(_0x4c0fa2,_0x5a81b4){return _0x5a81b4=_0x5a81b4||0x1f4,function(_0x321ed7){const _0x2c6e34=a325_0xfad0;logger[_0x2c6e34('0x25')](_0x321ed7['stack']),_0x321ed7[_0x2c6e34('0x6')]&&delete _0x321ed7[_0x2c6e34('0x6')],_0x4c0fa2['status'](_0x5a81b4)['send'](_0x321ed7);};}exports[_0x1b32e0('0x28')]=function(_0x16e0d9,_0x252189){const _0x2bf17c=_0x1b32e0;let _0x414d48={};const _0x3eb7ec={},_0x133b38={'count':0x0,'rows':[]},_0x292d79=_[_0x2bf17c('0x34')](db['VtigerConfiguration'][_0x2bf17c('0x33')],function(_0xbd5316){const _0x1792b9=_0x2bf17c;return{'name':_0xbd5316[_0x1792b9('0x13')],'type':_0xbd5316[_0x1792b9('0x18')][_0x1792b9('0x2')]};});_0x3eb7ec['model']=_[_0x2bf17c('0x34')](_0x292d79,'name'),_0x3eb7ec[_0x2bf17c('0x1b')]=_[_0x2bf17c('0x29')](_0x16e0d9['query']),_0x3eb7ec[_0x2bf17c('0x2a')]=_[_0x2bf17c('0x2b')](_0x3eb7ec[_0x2bf17c('0xa')],_0x3eb7ec['query']),_0x414d48[_0x2bf17c('0x1a')]=_[_0x2bf17c('0x2b')](_0x3eb7ec[_0x2bf17c('0xa')],qs[_0x2bf17c('0x5')](_0x16e0d9[_0x2bf17c('0x1b')][_0x2bf17c('0x5')])),_0x414d48[_0x2bf17c('0x1a')]=_0x414d48[_0x2bf17c('0x1a')]['length']?_0x414d48[_0x2bf17c('0x1a')]:_0x3eb7ec[_0x2bf17c('0xa')];typeof _0x16e0d9[_0x2bf17c('0x1b')][_0x2bf17c('0x38')]===_0x2bf17c('0x1e')&&(_0x414d48[_0x2bf17c('0x31')]=qs[_0x2bf17c('0x31')](_0x16e0d9[_0x2bf17c('0x1b')]['limit']),_0x414d48['offset']=qs['offset'](_0x16e0d9[_0x2bf17c('0x1b')]['offset']));_0x414d48[_0x2bf17c('0x1f')]=qs[_0x2bf17c('0x10')](_0x16e0d9['query']['sort']),_0x414d48[_0x2bf17c('0x26')]=qs[_0x2bf17c('0x2a')](_[_0x2bf17c('0xd')](_0x16e0d9[_0x2bf17c('0x1b')],_0x3eb7ec[_0x2bf17c('0x2a')]),_0x292d79);_0x16e0d9['query']['filter']&&(_0x414d48['where']=_[_0x2bf17c('0x4')](_0x414d48[_0x2bf17c('0x26')],{[Op['or']]:_[_0x2bf17c('0x34')](_0x292d79,function(_0x2a78c7){const _0x2d9e26=_0x2bf17c;if(_0x2a78c7[_0x2d9e26('0x18')]!==_0x2d9e26('0x2d')){const _0x4f86d7={};return _0x4f86d7[_0x2a78c7[_0x2d9e26('0x6')]]={[Op[_0x2d9e26('0xc')]]:'%'+_0x16e0d9['query'][_0x2d9e26('0x37')]+'%'},_0x4f86d7;}})}));_0x414d48=_[_0x2bf17c('0x4')]({},_0x414d48,_0x16e0d9['options']);const _0x5bd35b={'where':_0x414d48['where']};return db[_0x2bf17c('0x35')][_0x2bf17c('0x11')](_0x5bd35b)[_0x2bf17c('0x2f')](function(_0x2353b8){const _0x57a2a1=_0x2bf17c;return _0x133b38[_0x57a2a1('0x11')]=_0x2353b8,_0x16e0d9[_0x57a2a1('0x1b')][_0x57a2a1('0x21')]&&(_0x414d48[_0x57a2a1('0x7')]=[{'all':!![]}]),db[_0x57a2a1('0x35')][_0x57a2a1('0x1')](_0x414d48);})[_0x2bf17c('0x2f')](function(_0x4b7876){const _0x131db2=_0x2bf17c;return _0x133b38[_0x131db2('0x12')]=_0x4b7876,_0x133b38;})[_0x2bf17c('0x2f')](respondWithFilteredResult(_0x252189,_0x414d48))[_0x2bf17c('0x36')](handleError(_0x252189,null));},exports[_0x1b32e0('0x15')]=function(_0xfe9696,_0x1296ba){const _0x598d9d=_0x1b32e0;let _0xaca038={'raw':![],'where':{'id':_0xfe9696[_0x598d9d('0x2e')]['id']}};const _0x871e13={};return _0x871e13[_0x598d9d('0xa')]=_[_0x598d9d('0x29')](db['VtigerConfiguration']['rawAttributes']),_0x871e13[_0x598d9d('0x1b')]=_[_0x598d9d('0x29')](_0xfe9696[_0x598d9d('0x1b')]),_0x871e13['filters']=_['intersection'](_0x871e13[_0x598d9d('0xa')],_0x871e13[_0x598d9d('0x1b')]),_0xaca038[_0x598d9d('0x1a')]=_[_0x598d9d('0x2b')](_0x871e13['model'],qs[_0x598d9d('0x5')](_0xfe9696[_0x598d9d('0x1b')][_0x598d9d('0x5')])),_0xaca038[_0x598d9d('0x1a')]=_0xaca038[_0x598d9d('0x1a')][_0x598d9d('0x1d')]?_0xaca038[_0x598d9d('0x1a')]:_0x871e13['model'],_0xfe9696[_0x598d9d('0x1b')]['includeAll']&&(_0xaca038[_0x598d9d('0x7')]=[{'all':!![]}]),_0xaca038=_['merge']({},_0xaca038,_0xfe9696[_0x598d9d('0x23')]),db['VtigerConfiguration'][_0x598d9d('0x17')](_0xaca038)[_0x598d9d('0x2f')](handleEntityNotFound(_0x1296ba,null))[_0x598d9d('0x2f')](respondWithResult(_0x1296ba,null))['catch'](handleError(_0x1296ba,null));},exports['create']=function(_0x4072ad,_0x25a9e8){const _0x2a552d=_0x1b32e0;return db['VtigerConfiguration'][_0x2a552d('0x16')](_0x4072ad['body'],{})[_0x2a552d('0x2f')](respondWithResult(_0x25a9e8,0xc9))[_0x2a552d('0x36')](handleError(_0x25a9e8,null));},exports[_0x1b32e0('0x0')]=function(_0x4d7d2e,_0x24e4f7){const _0x3cd18a=_0x1b32e0;return _0x4d7d2e['body']['id']&&delete _0x4d7d2e[_0x3cd18a('0x20')]['id'],db[_0x3cd18a('0x35')][_0x3cd18a('0x17')]({'where':{'id':_0x4d7d2e[_0x3cd18a('0x2e')]['id']}})[_0x3cd18a('0x2f')](handleEntityNotFound(_0x24e4f7,null))[_0x3cd18a('0x2f')](saveUpdates(_0x4d7d2e[_0x3cd18a('0x20')],null))[_0x3cd18a('0x2f')](respondWithResult(_0x24e4f7,null))[_0x3cd18a('0x36')](handleError(_0x24e4f7,null));},exports['destroy']=function(_0x3c862e,_0x305a3d){const _0x4be407=_0x1b32e0;return db[_0x4be407('0x35')]['findOne']({'where':{'id':_0x3c862e[_0x4be407('0x2e')]['id']}})[_0x4be407('0x2f')](handleEntityNotFound(_0x305a3d,null))[_0x4be407('0x2f')](removeEntity(_0x305a3d,null))[_0x4be407('0x36')](handleError(_0x305a3d,null));},exports['getFields']=function(_0x547e6f,_0x10efcf){const _0x16623a=_0x1b32e0;let _0x2820ee={};const _0x1ed73b={};let _0xb2bedb,_0x415e3f;return db[_0x16623a('0x35')][_0x16623a('0x17')]({'where':{'id':_0x547e6f[_0x16623a('0x2e')]['id']}})['then'](handleEntityNotFound(_0x10efcf,null))[_0x16623a('0x2f')](function(_0x480c03){const _0x32f326=_0x16623a;if(_0x480c03)return _0xb2bedb=_0x480c03,_0x1ed73b[_0x32f326('0xa')]=_['keys'](db[_0x32f326('0x9')][_0x32f326('0x33')]),_0x1ed73b['query']=_[_0x32f326('0x29')](_0x547e6f[_0x32f326('0x1b')]),_0x1ed73b[_0x32f326('0x2a')]=_[_0x32f326('0x2b')](_0x1ed73b[_0x32f326('0xa')],_0x1ed73b[_0x32f326('0x1b')]),_0x2820ee['attributes']=_[_0x32f326('0x2b')](_0x1ed73b[_0x32f326('0xa')],qs['fields'](_0x547e6f['query'][_0x32f326('0x5')])),_0x2820ee[_0x32f326('0x1a')]=_0x2820ee['attributes'][_0x32f326('0x1d')]?_0x2820ee[_0x32f326('0x1a')]:_0x1ed73b[_0x32f326('0xa')],_0x2820ee[_0x32f326('0x1f')]=qs['sort'](_0x547e6f[_0x32f326('0x1b')][_0x32f326('0x10')]),_0x2820ee[_0x32f326('0x26')]=qs[_0x32f326('0x2a')](_[_0x32f326('0xd')](_0x547e6f['query'],_0x1ed73b[_0x32f326('0x2a')])),_0x547e6f[_0x32f326('0x1b')]['filter']&&(_0x2820ee['where']=_[_0x32f326('0x4')](_0x2820ee['where'],{[Op['or']]:_[_0x32f326('0x34')](_0x2820ee[_0x32f326('0x1a')],function(_0x3634d7){const _0x143f9b=_0x32f326,_0x5a43d8={};return _0x5a43d8[_0x3634d7]={[Op['like']]:'%'+_0x547e6f[_0x143f9b('0x1b')][_0x143f9b('0x37')]+'%'},_0x5a43d8;})})),_0x2820ee=_[_0x32f326('0x4')]({},_0x2820ee,_0x547e6f[_0x32f326('0x23')]),_0xb2bedb[_0x32f326('0x22')](_0x2820ee);})['then'](function(_0x316f19){const _0x1e8420=_0x16623a;if(_0x316f19)return _0x415e3f=_0x316f19[_0x1e8420('0x1d')],typeof _0x547e6f['query']['nolimit']===_0x1e8420('0x1e')&&(_0x2820ee[_0x1e8420('0x31')]=qs['limit'](_0x547e6f[_0x1e8420('0x1b')][_0x1e8420('0x31')]),_0x2820ee['offset']=qs[_0x1e8420('0x14')](_0x547e6f[_0x1e8420('0x1b')][_0x1e8420('0x14')])),_0xb2bedb['getFields'](_0x2820ee);})[_0x16623a('0x2f')](function(_0xad9482){if(_0xad9482)return _0xad9482?{'count':_0x415e3f,'rows':_0xad9482}:null;})[_0x16623a('0x2f')](respondWithResult(_0x10efcf,null))[_0x16623a('0x36')](handleError(_0x10efcf,null));},exports[_0x1b32e0('0x30')]=function(_0x2b95db,_0x63459f){const _0x3c1ef1=_0x1b32e0;let _0x1021bc={};const _0x2d6f1b={};let _0x2fdbf0,_0x469306;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x2b95db[_0x3c1ef1('0x2e')]['id']}})[_0x3c1ef1('0x2f')](handleEntityNotFound(_0x63459f,null))[_0x3c1ef1('0x2f')](function(_0x3967e6){const _0x2ca4fd=_0x3c1ef1;if(_0x3967e6)return _0x2fdbf0=_0x3967e6,_0x2d6f1b[_0x2ca4fd('0xa')]=_['keys'](db[_0x2ca4fd('0x9')][_0x2ca4fd('0x33')]),_0x2d6f1b['query']=_[_0x2ca4fd('0x29')](_0x2b95db['query']),_0x2d6f1b['filters']=_[_0x2ca4fd('0x2b')](_0x2d6f1b[_0x2ca4fd('0xa')],_0x2d6f1b[_0x2ca4fd('0x1b')]),_0x1021bc['attributes']=_[_0x2ca4fd('0x2b')](_0x2d6f1b[_0x2ca4fd('0xa')],qs[_0x2ca4fd('0x5')](_0x2b95db['query'][_0x2ca4fd('0x5')])),_0x1021bc[_0x2ca4fd('0x1a')]=_0x1021bc[_0x2ca4fd('0x1a')]['length']?_0x1021bc['attributes']:_0x2d6f1b[_0x2ca4fd('0xa')],_0x1021bc[_0x2ca4fd('0x1f')]=qs[_0x2ca4fd('0x10')](_0x2b95db[_0x2ca4fd('0x1b')][_0x2ca4fd('0x10')]),_0x1021bc[_0x2ca4fd('0x26')]=qs['filters'](_[_0x2ca4fd('0xd')](_0x2b95db['query'],_0x2d6f1b[_0x2ca4fd('0x2a')])),_0x2b95db[_0x2ca4fd('0x1b')][_0x2ca4fd('0x37')]&&(_0x1021bc[_0x2ca4fd('0x26')]=_['merge'](_0x1021bc[_0x2ca4fd('0x26')],{[Op['or']]:_[_0x2ca4fd('0x34')](_0x1021bc[_0x2ca4fd('0x1a')],function(_0x4e6992){const _0xbfc900=_0x2ca4fd,_0x5d76a3={};return _0x5d76a3[_0x4e6992]={[Op[_0xbfc900('0xc')]]:'%'+_0x2b95db[_0xbfc900('0x1b')][_0xbfc900('0x37')]+'%'},_0x5d76a3;})})),_0x1021bc=_[_0x2ca4fd('0x4')]({},_0x1021bc,_0x2b95db[_0x2ca4fd('0x23')]),_0x2fdbf0[_0x2ca4fd('0x30')](_0x1021bc);})[_0x3c1ef1('0x2f')](function(_0x4bc5b7){const _0x3dd31d=_0x3c1ef1;if(_0x4bc5b7)return _0x469306=_0x4bc5b7['length'],typeof _0x2b95db[_0x3dd31d('0x1b')][_0x3dd31d('0x38')]===_0x3dd31d('0x1e')&&(_0x1021bc[_0x3dd31d('0x31')]=qs[_0x3dd31d('0x31')](_0x2b95db[_0x3dd31d('0x1b')]['limit']),_0x1021bc[_0x3dd31d('0x14')]=qs[_0x3dd31d('0x14')](_0x2b95db[_0x3dd31d('0x1b')][_0x3dd31d('0x14')])),_0x2fdbf0[_0x3dd31d('0x30')](_0x1021bc);})[_0x3c1ef1('0x2f')](function(_0x5c6704){if(_0x5c6704)return _0x5c6704?{'count':_0x469306,'rows':_0x5c6704}:null;})[_0x3c1ef1('0x2f')](respondWithResult(_0x63459f,null))[_0x3c1ef1('0x36')](handleError(_0x63459f,null));},exports[_0x1b32e0('0x32')]=function(_0x86ee,_0x42aa82){const _0xa20e83=_0x1b32e0;let _0x3cecd3={};const _0xbd9df3={};let _0x533590,_0x206035;return db[_0xa20e83('0x35')][_0xa20e83('0x17')]({'where':{'id':_0x86ee[_0xa20e83('0x2e')]['id']}})[_0xa20e83('0x2f')](handleEntityNotFound(_0x42aa82,null))[_0xa20e83('0x2f')](function(_0x3e6475){const _0x2d5ebe=_0xa20e83;if(_0x3e6475)return _0x533590=_0x3e6475,_0xbd9df3[_0x2d5ebe('0xa')]=_[_0x2d5ebe('0x29')](db[_0x2d5ebe('0x9')]['rawAttributes']),_0xbd9df3[_0x2d5ebe('0x1b')]=_[_0x2d5ebe('0x29')](_0x86ee[_0x2d5ebe('0x1b')]),_0xbd9df3[_0x2d5ebe('0x2a')]=_[_0x2d5ebe('0x2b')](_0xbd9df3['model'],_0xbd9df3[_0x2d5ebe('0x1b')]),_0x3cecd3[_0x2d5ebe('0x1a')]=_[_0x2d5ebe('0x2b')](_0xbd9df3[_0x2d5ebe('0xa')],qs[_0x2d5ebe('0x5')](_0x86ee[_0x2d5ebe('0x1b')][_0x2d5ebe('0x5')])),_0x3cecd3[_0x2d5ebe('0x1a')]=_0x3cecd3[_0x2d5ebe('0x1a')][_0x2d5ebe('0x1d')]?_0x3cecd3[_0x2d5ebe('0x1a')]:_0xbd9df3[_0x2d5ebe('0xa')],_0x3cecd3[_0x2d5ebe('0x1f')]=qs[_0x2d5ebe('0x10')](_0x86ee['query']['sort']),_0x3cecd3[_0x2d5ebe('0x26')]=qs[_0x2d5ebe('0x2a')](_[_0x2d5ebe('0xd')](_0x86ee[_0x2d5ebe('0x1b')],_0xbd9df3['filters'])),_0x86ee['query'][_0x2d5ebe('0x37')]&&(_0x3cecd3['where']=_['merge'](_0x3cecd3[_0x2d5ebe('0x26')],{[Op['or']]:_[_0x2d5ebe('0x34')](_0x3cecd3[_0x2d5ebe('0x1a')],function(_0x36b070){const _0x4f5fa4=_0x2d5ebe,_0x42cf40={};return _0x42cf40[_0x36b070]={[Op[_0x4f5fa4('0xc')]]:'%'+_0x86ee[_0x4f5fa4('0x1b')][_0x4f5fa4('0x37')]+'%'},_0x42cf40;})})),_0x3cecd3=_[_0x2d5ebe('0x4')]({},_0x3cecd3,_0x86ee[_0x2d5ebe('0x23')]),_0x533590['getDescriptions'](_0x3cecd3);})[_0xa20e83('0x2f')](function(_0x39a7d8){const _0x325fbe=_0xa20e83;if(_0x39a7d8)return _0x206035=_0x39a7d8[_0x325fbe('0x1d')],typeof _0x86ee[_0x325fbe('0x1b')][_0x325fbe('0x38')]===_0x325fbe('0x1e')&&(_0x3cecd3[_0x325fbe('0x31')]=qs[_0x325fbe('0x31')](_0x86ee[_0x325fbe('0x1b')][_0x325fbe('0x31')]),_0x3cecd3[_0x325fbe('0x14')]=qs['offset'](_0x86ee[_0x325fbe('0x1b')][_0x325fbe('0x14')])),_0x533590['getDescriptions'](_0x3cecd3);})['then'](function(_0x2a9cef){if(_0x2a9cef)return _0x2a9cef?{'count':_0x206035,'rows':_0x2a9cef}:null;})[_0xa20e83('0x2f')](respondWithResult(_0x42aa82,null))[_0xa20e83('0x36')](handleError(_0x42aa82,null));};
\ No newline at end of file
+const a325_0x1935=['type','stack','name','length','sequelize','like','error','../../config/logger','create','params','then','query','getSubjects','count','filters','update','show','nolimit','VtigerConfiguration','pick','Content-Range','getDescriptions','sendStatus','undefined','attributes','VIRTUAL','fieldName','../../components/parsers/qs','api','destroy','filter','set','fields','limit','where','keys','rawAttributes','includeAll','index','include','findOne','map','model','merge','json','VtigerField','getFields','../../mysqldb','options','status','offset','order','catch','sort','body','intersection'];(function(_0x537920,_0x1935da){const _0x3c2c9f=function(_0x3c8e72){while(--_0x3c8e72){_0x537920['push'](_0x537920['shift']());}};_0x3c2c9f(++_0x1935da);}(a325_0x1935,0x78));const a325_0x3c2c=function(_0x537920,_0x1935da){_0x537920=_0x537920-0x0;let _0x3c2c9f=a325_0x1935[_0x537920];return _0x3c2c9f;};const _0x29167d=a325_0x3c2c;'use strict';const _=require('lodash'),qs=require(_0x29167d('0x13')),logger=require(_0x29167d('0x37'))(_0x29167d('0x14')),db=require(_0x29167d('0x27'))['db'],{Op}=require(_0x29167d('0x34'));function respondWithResult(_0x3c8e72,_0x5684da){return _0x5684da=_0x5684da||0xc8,function(_0x17501d){const _0x4f84c2=a325_0x3c2c;if(_0x17501d)return _0x3c8e72[_0x4f84c2('0x29')](_0x5684da)[_0x4f84c2('0x24')](_0x17501d);};}function respondWithFilteredResult(_0xde9583,_0x134154){return function(_0x1ea237){const _0x1dd776=a325_0x3c2c;if(_0x1ea237){const _0x450de5=_0x1ea237[_0x1dd776('0x5')],_0x2f0848=_0x134154[_0x1dd776('0x2a')];let _0x13d065=_0x134154[_0x1dd776('0x2a')]+_0x134154['limit'],_0x5b0c8d;return _0x13d065>=_0x450de5?(_0x13d065=_0x450de5,_0x5b0c8d=0xc8):_0x5b0c8d=0xce,_0xde9583[_0x1dd776('0x29')](_0x5b0c8d),_0xde9583[_0x1dd776('0x17')](_0x1dd776('0xc'),_0x2f0848+'-'+_0x13d065+'/'+_0x450de5)[_0x1dd776('0x24')](_0x1ea237);}return null;};}function saveUpdates(_0x2233b0){return function(_0x2ee22e){const _0x1f9758=a325_0x3c2c;if(_0x2ee22e)return _0x2ee22e[_0x1f9758('0x7')](_0x2233b0)[_0x1f9758('0x2')](function(_0xb7260a){return _0xb7260a;});return null;};}function removeEntity(_0x44d308){return function(_0x257e3e){const _0x3d6a3a=a325_0x3c2c;if(_0x257e3e)return _0x257e3e[_0x3d6a3a('0x15')]()[_0x3d6a3a('0x2')](function(){const _0xf3478c=_0x3d6a3a;_0x44d308[_0xf3478c('0x29')](0xcc)['end']();});};}function handleEntityNotFound(_0x4a949c){return function(_0x38bf0b){const _0x77c083=a325_0x3c2c;return!_0x38bf0b&&_0x4a949c[_0x77c083('0xe')](0x194),_0x38bf0b;};}function handleError(_0x4bf0e9,_0x4643a4){return _0x4643a4=_0x4643a4||0x1f4,function(_0x394057){const _0x2b840f=a325_0x3c2c;logger[_0x2b840f('0x36')](_0x394057[_0x2b840f('0x31')]),_0x394057[_0x2b840f('0x32')]&&delete _0x394057[_0x2b840f('0x32')],_0x4bf0e9[_0x2b840f('0x29')](_0x4643a4)['send'](_0x394057);};}exports[_0x29167d('0x1e')]=function(_0x3885fa,_0x47a04e){const _0x8d24ea=_0x29167d;let _0x247524={};const _0x1e6c36={},_0xcc3e48={'count':0x0,'rows':[]},_0x470019=_['map'](db[_0x8d24ea('0xa')]['rawAttributes'],function(_0x438348){const _0x318644=_0x8d24ea;return{'name':_0x438348[_0x318644('0x12')],'type':_0x438348[_0x318644('0x30')]['key']};});_0x1e6c36[_0x8d24ea('0x22')]=_[_0x8d24ea('0x21')](_0x470019,'name'),_0x1e6c36[_0x8d24ea('0x3')]=_[_0x8d24ea('0x1b')](_0x3885fa[_0x8d24ea('0x3')]),_0x1e6c36[_0x8d24ea('0x6')]=_[_0x8d24ea('0x2f')](_0x1e6c36['model'],_0x1e6c36[_0x8d24ea('0x3')]),_0x247524[_0x8d24ea('0x10')]=_['intersection'](_0x1e6c36['model'],qs[_0x8d24ea('0x18')](_0x3885fa[_0x8d24ea('0x3')][_0x8d24ea('0x18')])),_0x247524[_0x8d24ea('0x10')]=_0x247524['attributes']['length']?_0x247524['attributes']:_0x1e6c36[_0x8d24ea('0x22')];typeof _0x3885fa[_0x8d24ea('0x3')][_0x8d24ea('0x9')]===_0x8d24ea('0xf')&&(_0x247524[_0x8d24ea('0x19')]=qs['limit'](_0x3885fa[_0x8d24ea('0x3')][_0x8d24ea('0x19')]),_0x247524[_0x8d24ea('0x2a')]=qs[_0x8d24ea('0x2a')](_0x3885fa[_0x8d24ea('0x3')]['offset']));_0x247524[_0x8d24ea('0x2b')]=qs[_0x8d24ea('0x2d')](_0x3885fa[_0x8d24ea('0x3')][_0x8d24ea('0x2d')]),_0x247524[_0x8d24ea('0x1a')]=qs[_0x8d24ea('0x6')](_[_0x8d24ea('0xb')](_0x3885fa[_0x8d24ea('0x3')],_0x1e6c36[_0x8d24ea('0x6')]),_0x470019);_0x3885fa[_0x8d24ea('0x3')]['filter']&&(_0x247524['where']=_[_0x8d24ea('0x23')](_0x247524['where'],{[Op['or']]:_[_0x8d24ea('0x21')](_0x470019,function(_0x48b358){const _0x4ed8db=_0x8d24ea;if(_0x48b358['type']!==_0x4ed8db('0x11')){const _0xf951dd={};return _0xf951dd[_0x48b358[_0x4ed8db('0x32')]]={[Op[_0x4ed8db('0x35')]]:'%'+_0x3885fa[_0x4ed8db('0x3')]['filter']+'%'},_0xf951dd;}})}));_0x247524=_[_0x8d24ea('0x23')]({},_0x247524,_0x3885fa['options']);const _0x19111c={'where':_0x247524[_0x8d24ea('0x1a')]};return db['VtigerConfiguration'][_0x8d24ea('0x5')](_0x19111c)[_0x8d24ea('0x2')](function(_0x5ac665){const _0x23213e=_0x8d24ea;return _0xcc3e48[_0x23213e('0x5')]=_0x5ac665,_0x3885fa[_0x23213e('0x3')][_0x23213e('0x1d')]&&(_0x247524['include']=[{'all':!![]}]),db[_0x23213e('0xa')]['findAll'](_0x247524);})[_0x8d24ea('0x2')](function(_0x4f2143){return _0xcc3e48['rows']=_0x4f2143,_0xcc3e48;})[_0x8d24ea('0x2')](respondWithFilteredResult(_0x47a04e,_0x247524))['catch'](handleError(_0x47a04e,null));},exports[_0x29167d('0x8')]=function(_0x2ea3b0,_0x6f09ba){const _0x139b88=_0x29167d;let _0xdc69ec={'raw':![],'where':{'id':_0x2ea3b0[_0x139b88('0x1')]['id']}};const _0x6fc940={};return _0x6fc940[_0x139b88('0x22')]=_[_0x139b88('0x1b')](db['VtigerConfiguration'][_0x139b88('0x1c')]),_0x6fc940['query']=_[_0x139b88('0x1b')](_0x2ea3b0['query']),_0x6fc940['filters']=_[_0x139b88('0x2f')](_0x6fc940[_0x139b88('0x22')],_0x6fc940[_0x139b88('0x3')]),_0xdc69ec[_0x139b88('0x10')]=_['intersection'](_0x6fc940['model'],qs[_0x139b88('0x18')](_0x2ea3b0[_0x139b88('0x3')][_0x139b88('0x18')])),_0xdc69ec[_0x139b88('0x10')]=_0xdc69ec['attributes'][_0x139b88('0x33')]?_0xdc69ec['attributes']:_0x6fc940['model'],_0x2ea3b0[_0x139b88('0x3')][_0x139b88('0x1d')]&&(_0xdc69ec[_0x139b88('0x1f')]=[{'all':!![]}]),_0xdc69ec=_[_0x139b88('0x23')]({},_0xdc69ec,_0x2ea3b0[_0x139b88('0x28')]),db[_0x139b88('0xa')][_0x139b88('0x20')](_0xdc69ec)['then'](handleEntityNotFound(_0x6f09ba,null))['then'](respondWithResult(_0x6f09ba,null))[_0x139b88('0x2c')](handleError(_0x6f09ba,null));},exports[_0x29167d('0x0')]=function(_0x438965,_0x338169){const _0x52d221=_0x29167d;return db[_0x52d221('0xa')][_0x52d221('0x0')](_0x438965[_0x52d221('0x2e')],{})['then'](respondWithResult(_0x338169,0xc9))[_0x52d221('0x2c')](handleError(_0x338169,null));},exports[_0x29167d('0x7')]=function(_0x47ef4f,_0x323c30){const _0x44d1c0=_0x29167d;return _0x47ef4f[_0x44d1c0('0x2e')]['id']&&delete _0x47ef4f['body']['id'],db[_0x44d1c0('0xa')][_0x44d1c0('0x20')]({'where':{'id':_0x47ef4f[_0x44d1c0('0x1')]['id']}})[_0x44d1c0('0x2')](handleEntityNotFound(_0x323c30,null))['then'](saveUpdates(_0x47ef4f[_0x44d1c0('0x2e')],null))[_0x44d1c0('0x2')](respondWithResult(_0x323c30,null))[_0x44d1c0('0x2c')](handleError(_0x323c30,null));},exports['destroy']=function(_0x5d353e,_0x274a37){const _0x33e064=_0x29167d;return db[_0x33e064('0xa')][_0x33e064('0x20')]({'where':{'id':_0x5d353e[_0x33e064('0x1')]['id']}})[_0x33e064('0x2')](handleEntityNotFound(_0x274a37,null))[_0x33e064('0x2')](removeEntity(_0x274a37,null))[_0x33e064('0x2c')](handleError(_0x274a37,null));},exports[_0x29167d('0x26')]=function(_0x28b1e6,_0x2ff714){const _0x1ed543=_0x29167d;let _0x2679fe={};const _0x551cd1={};let _0x5ee2fe,_0x1d2f8b;return db[_0x1ed543('0xa')][_0x1ed543('0x20')]({'where':{'id':_0x28b1e6['params']['id']}})[_0x1ed543('0x2')](handleEntityNotFound(_0x2ff714,null))[_0x1ed543('0x2')](function(_0x40da9f){const _0x63209d=_0x1ed543;if(_0x40da9f)return _0x5ee2fe=_0x40da9f,_0x551cd1[_0x63209d('0x22')]=_[_0x63209d('0x1b')](db[_0x63209d('0x25')][_0x63209d('0x1c')]),_0x551cd1['query']=_['keys'](_0x28b1e6[_0x63209d('0x3')]),_0x551cd1[_0x63209d('0x6')]=_[_0x63209d('0x2f')](_0x551cd1[_0x63209d('0x22')],_0x551cd1[_0x63209d('0x3')]),_0x2679fe[_0x63209d('0x10')]=_[_0x63209d('0x2f')](_0x551cd1[_0x63209d('0x22')],qs[_0x63209d('0x18')](_0x28b1e6[_0x63209d('0x3')]['fields'])),_0x2679fe[_0x63209d('0x10')]=_0x2679fe[_0x63209d('0x10')][_0x63209d('0x33')]?_0x2679fe['attributes']:_0x551cd1[_0x63209d('0x22')],_0x2679fe['order']=qs[_0x63209d('0x2d')](_0x28b1e6[_0x63209d('0x3')][_0x63209d('0x2d')]),_0x2679fe[_0x63209d('0x1a')]=qs[_0x63209d('0x6')](_[_0x63209d('0xb')](_0x28b1e6[_0x63209d('0x3')],_0x551cd1[_0x63209d('0x6')])),_0x28b1e6[_0x63209d('0x3')]['filter']&&(_0x2679fe[_0x63209d('0x1a')]=_[_0x63209d('0x23')](_0x2679fe['where'],{[Op['or']]:_['map'](_0x2679fe[_0x63209d('0x10')],function(_0x54a3cc){const _0x260756=_0x63209d,_0x3bfee5={};return _0x3bfee5[_0x54a3cc]={[Op['like']]:'%'+_0x28b1e6[_0x260756('0x3')][_0x260756('0x16')]+'%'},_0x3bfee5;})})),_0x2679fe=_[_0x63209d('0x23')]({},_0x2679fe,_0x28b1e6[_0x63209d('0x28')]),_0x5ee2fe[_0x63209d('0x26')](_0x2679fe);})['then'](function(_0x2a3459){const _0x200d08=_0x1ed543;if(_0x2a3459)return _0x1d2f8b=_0x2a3459[_0x200d08('0x33')],typeof _0x28b1e6[_0x200d08('0x3')][_0x200d08('0x9')]===_0x200d08('0xf')&&(_0x2679fe['limit']=qs[_0x200d08('0x19')](_0x28b1e6[_0x200d08('0x3')][_0x200d08('0x19')]),_0x2679fe['offset']=qs[_0x200d08('0x2a')](_0x28b1e6[_0x200d08('0x3')][_0x200d08('0x2a')])),_0x5ee2fe[_0x200d08('0x26')](_0x2679fe);})[_0x1ed543('0x2')](function(_0x13dab7){if(_0x13dab7)return _0x13dab7?{'count':_0x1d2f8b,'rows':_0x13dab7}:null;})[_0x1ed543('0x2')](respondWithResult(_0x2ff714,null))[_0x1ed543('0x2c')](handleError(_0x2ff714,null));},exports[_0x29167d('0x4')]=function(_0x4122cb,_0x46d544){const _0x21e27a=_0x29167d;let _0x108ecb={};const _0x219ea8={};let _0x438a4a,_0x5c3215;return db[_0x21e27a('0xa')]['findOne']({'where':{'id':_0x4122cb['params']['id']}})[_0x21e27a('0x2')](handleEntityNotFound(_0x46d544,null))[_0x21e27a('0x2')](function(_0x18a6e3){const _0x4cf5b9=_0x21e27a;if(_0x18a6e3)return _0x438a4a=_0x18a6e3,_0x219ea8[_0x4cf5b9('0x22')]=_[_0x4cf5b9('0x1b')](db[_0x4cf5b9('0x25')]['rawAttributes']),_0x219ea8['query']=_['keys'](_0x4122cb[_0x4cf5b9('0x3')]),_0x219ea8['filters']=_[_0x4cf5b9('0x2f')](_0x219ea8[_0x4cf5b9('0x22')],_0x219ea8[_0x4cf5b9('0x3')]),_0x108ecb[_0x4cf5b9('0x10')]=_[_0x4cf5b9('0x2f')](_0x219ea8[_0x4cf5b9('0x22')],qs[_0x4cf5b9('0x18')](_0x4122cb[_0x4cf5b9('0x3')][_0x4cf5b9('0x18')])),_0x108ecb['attributes']=_0x108ecb['attributes'][_0x4cf5b9('0x33')]?_0x108ecb[_0x4cf5b9('0x10')]:_0x219ea8['model'],_0x108ecb[_0x4cf5b9('0x2b')]=qs[_0x4cf5b9('0x2d')](_0x4122cb[_0x4cf5b9('0x3')][_0x4cf5b9('0x2d')]),_0x108ecb['where']=qs['filters'](_[_0x4cf5b9('0xb')](_0x4122cb[_0x4cf5b9('0x3')],_0x219ea8[_0x4cf5b9('0x6')])),_0x4122cb[_0x4cf5b9('0x3')][_0x4cf5b9('0x16')]&&(_0x108ecb[_0x4cf5b9('0x1a')]=_['merge'](_0x108ecb[_0x4cf5b9('0x1a')],{[Op['or']]:_['map'](_0x108ecb[_0x4cf5b9('0x10')],function(_0x53c4a7){const _0x38386c=_0x4cf5b9,_0x127c6a={};return _0x127c6a[_0x53c4a7]={[Op['like']]:'%'+_0x4122cb[_0x38386c('0x3')][_0x38386c('0x16')]+'%'},_0x127c6a;})})),_0x108ecb=_[_0x4cf5b9('0x23')]({},_0x108ecb,_0x4122cb[_0x4cf5b9('0x28')]),_0x438a4a[_0x4cf5b9('0x4')](_0x108ecb);})[_0x21e27a('0x2')](function(_0x586b79){const _0x4043ae=_0x21e27a;if(_0x586b79)return _0x5c3215=_0x586b79['length'],typeof _0x4122cb[_0x4043ae('0x3')][_0x4043ae('0x9')]==='undefined'&&(_0x108ecb[_0x4043ae('0x19')]=qs['limit'](_0x4122cb[_0x4043ae('0x3')][_0x4043ae('0x19')]),_0x108ecb[_0x4043ae('0x2a')]=qs[_0x4043ae('0x2a')](_0x4122cb['query'][_0x4043ae('0x2a')])),_0x438a4a[_0x4043ae('0x4')](_0x108ecb);})['then'](function(_0x39428f){if(_0x39428f)return _0x39428f?{'count':_0x5c3215,'rows':_0x39428f}:null;})[_0x21e27a('0x2')](respondWithResult(_0x46d544,null))[_0x21e27a('0x2c')](handleError(_0x46d544,null));},exports['getDescriptions']=function(_0x347dc0,_0x563702){const _0x224741=_0x29167d;let _0x2ab137={};const _0x33e55a={};let _0x391e91,_0x7a08db;return db[_0x224741('0xa')][_0x224741('0x20')]({'where':{'id':_0x347dc0[_0x224741('0x1')]['id']}})[_0x224741('0x2')](handleEntityNotFound(_0x563702,null))[_0x224741('0x2')](function(_0x2aa573){const _0x47d669=_0x224741;if(_0x2aa573)return _0x391e91=_0x2aa573,_0x33e55a[_0x47d669('0x22')]=_[_0x47d669('0x1b')](db[_0x47d669('0x25')]['rawAttributes']),_0x33e55a[_0x47d669('0x3')]=_['keys'](_0x347dc0['query']),_0x33e55a[_0x47d669('0x6')]=_['intersection'](_0x33e55a[_0x47d669('0x22')],_0x33e55a[_0x47d669('0x3')]),_0x2ab137['attributes']=_['intersection'](_0x33e55a[_0x47d669('0x22')],qs[_0x47d669('0x18')](_0x347dc0['query'][_0x47d669('0x18')])),_0x2ab137[_0x47d669('0x10')]=_0x2ab137[_0x47d669('0x10')]['length']?_0x2ab137[_0x47d669('0x10')]:_0x33e55a[_0x47d669('0x22')],_0x2ab137[_0x47d669('0x2b')]=qs[_0x47d669('0x2d')](_0x347dc0['query'][_0x47d669('0x2d')]),_0x2ab137[_0x47d669('0x1a')]=qs[_0x47d669('0x6')](_[_0x47d669('0xb')](_0x347dc0[_0x47d669('0x3')],_0x33e55a[_0x47d669('0x6')])),_0x347dc0['query'][_0x47d669('0x16')]&&(_0x2ab137[_0x47d669('0x1a')]=_['merge'](_0x2ab137['where'],{[Op['or']]:_[_0x47d669('0x21')](_0x2ab137[_0x47d669('0x10')],function(_0x4f443d){const _0x80e644=_0x47d669,_0x44baba={};return _0x44baba[_0x4f443d]={[Op[_0x80e644('0x35')]]:'%'+_0x347dc0[_0x80e644('0x3')][_0x80e644('0x16')]+'%'},_0x44baba;})})),_0x2ab137=_[_0x47d669('0x23')]({},_0x2ab137,_0x347dc0[_0x47d669('0x28')]),_0x391e91[_0x47d669('0xd')](_0x2ab137);})['then'](function(_0x8524a9){const _0x294006=_0x224741;if(_0x8524a9)return _0x7a08db=_0x8524a9[_0x294006('0x33')],typeof _0x347dc0['query']['nolimit']===_0x294006('0xf')&&(_0x2ab137[_0x294006('0x19')]=qs[_0x294006('0x19')](_0x347dc0[_0x294006('0x3')][_0x294006('0x19')]),_0x2ab137[_0x294006('0x2a')]=qs[_0x294006('0x2a')](_0x347dc0[_0x294006('0x3')][_0x294006('0x2a')])),_0x391e91['getDescriptions'](_0x2ab137);})[_0x224741('0x2')](function(_0x327495){if(_0x327495)return _0x327495?{'count':_0x7a08db,'rows':_0x327495}:null;})['then'](respondWithResult(_0x563702,null))['catch'](handleError(_0x563702,null));};
\ No newline at end of file