Built motion from commit df3e9871f6bcc3432fec345b2f4facbd4dba8b5c. Version 3.0.0...
[motion-next.git] / server / api / intVtigerConfiguration / intVtigerConfiguration.controller.js
index f3837d7..ca8cb20 100644 (file)
@@ -1 +1 @@
-const a325_0x2e09=['status','attributes','map','send','order','VtigerField','query','sendStatus','params','getFields','pick','offset','key','../../components/parsers/qs','sequelize','model','intersection','body','undefined','VtigerConfiguration','like','where','destroy','fieldName','fields','getDescriptions','sort','include','error','../../mysqldb','nolimit','findAll','type','catch','set','filters','update','../../config/logger','merge','name','getSubjects','length','then','filter','findOne','options','rawAttributes','stack','includeAll','keys','count','limit'];(function(_0x16d248,_0x2e09f5){const _0xf2a0ae=function(_0xdc33f6){while(--_0xdc33f6){_0x16d248['push'](_0x16d248['shift']());}};_0xf2a0ae(++_0x2e09f5);}(a325_0x2e09,0x1bb));const a325_0xf2a0=function(_0x16d248,_0x2e09f5){_0x16d248=_0x16d248-0x0;let _0xf2a0ae=a325_0x2e09[_0x16d248];return _0xf2a0ae;};const _0x6b82fd=a325_0xf2a0;'use strict';const _=require('lodash'),qs=require(_0x6b82fd('0x26')),logger=require(_0x6b82fd('0xa'))('api'),db=require(_0x6b82fd('0x2'))['db'],{Op}=require(_0x6b82fd('0x27'));function respondWithResult(_0xdc33f6,_0x4a30f7){return _0x4a30f7=_0x4a30f7||0xc8,function(_0x982ce9){const _0x4c25f9=a325_0xf2a0;if(_0x982ce9)return _0xdc33f6[_0x4c25f9('0x19')](_0x4a30f7)['json'](_0x982ce9);};}function respondWithFilteredResult(_0x3310df,_0x554027){return function(_0x4a7f39){const _0x305db3=a325_0xf2a0;if(_0x4a7f39){const _0x297c70=_0x4a7f39[_0x305db3('0x17')],_0x259773=_0x554027['offset'];let _0x38a263=_0x554027['offset']+_0x554027[_0x305db3('0x18')],_0xc6afa9;return _0x38a263>=_0x297c70?(_0x38a263=_0x297c70,_0xc6afa9=0xc8):_0xc6afa9=0xce,_0x3310df[_0x305db3('0x19')](_0xc6afa9),_0x3310df[_0x305db3('0x7')]('Content-Range',_0x259773+'-'+_0x38a263+'/'+_0x297c70)['json'](_0x4a7f39);}return null;};}function saveUpdates(_0xdd843c){return function(_0x4e22f2){const _0x21342e=a325_0xf2a0;if(_0x4e22f2)return _0x4e22f2['update'](_0xdd843c)[_0x21342e('0xf')](function(_0x48294b){return _0x48294b;});return null;};}function removeEntity(_0x3a50ea){return function(_0x2d47ab){const _0x3b607a=a325_0xf2a0;if(_0x2d47ab)return _0x2d47ab['destroy']()[_0x3b607a('0xf')](function(){const _0x185743=_0x3b607a;_0x3a50ea[_0x185743('0x19')](0xcc)['end']();});};}function handleEntityNotFound(_0x9ce826){return function(_0x2df4e9){const _0x451a65=a325_0xf2a0;return!_0x2df4e9&&_0x9ce826[_0x451a65('0x20')](0x194),_0x2df4e9;};}function handleError(_0x3d4664,_0x186cb7){return _0x186cb7=_0x186cb7||0x1f4,function(_0x150693){const _0x53f5f4=a325_0xf2a0;logger[_0x53f5f4('0x1')](_0x150693[_0x53f5f4('0x14')]),_0x150693[_0x53f5f4('0xc')]&&delete _0x150693[_0x53f5f4('0xc')],_0x3d4664[_0x53f5f4('0x19')](_0x186cb7)[_0x53f5f4('0x1c')](_0x150693);};}exports['index']=function(_0x223d5a,_0x22b19a){const _0x294905=_0x6b82fd;let _0x306378={};const _0x1e0acd={},_0x3a75ce={'count':0x0,'rows':[]},_0x34b62e=_[_0x294905('0x1b')](db[_0x294905('0x2c')][_0x294905('0x13')],function(_0x3ae0c5){const _0x4ff7c9=_0x294905;return{'name':_0x3ae0c5[_0x4ff7c9('0x30')],'type':_0x3ae0c5[_0x4ff7c9('0x5')][_0x4ff7c9('0x25')]};});_0x1e0acd[_0x294905('0x28')]=_[_0x294905('0x1b')](_0x34b62e,_0x294905('0xc')),_0x1e0acd[_0x294905('0x1f')]=_[_0x294905('0x16')](_0x223d5a[_0x294905('0x1f')]),_0x1e0acd['filters']=_['intersection'](_0x1e0acd['model'],_0x1e0acd[_0x294905('0x1f')]),_0x306378[_0x294905('0x1a')]=_[_0x294905('0x29')](_0x1e0acd[_0x294905('0x28')],qs[_0x294905('0x31')](_0x223d5a['query'][_0x294905('0x31')])),_0x306378['attributes']=_0x306378[_0x294905('0x1a')]['length']?_0x306378[_0x294905('0x1a')]:_0x1e0acd['model'];typeof _0x223d5a['query'][_0x294905('0x3')]===_0x294905('0x2b')&&(_0x306378[_0x294905('0x18')]=qs[_0x294905('0x18')](_0x223d5a[_0x294905('0x1f')][_0x294905('0x18')]),_0x306378[_0x294905('0x24')]=qs[_0x294905('0x24')](_0x223d5a[_0x294905('0x1f')][_0x294905('0x24')]));_0x306378['order']=qs['sort'](_0x223d5a[_0x294905('0x1f')][_0x294905('0x33')]),_0x306378[_0x294905('0x2e')]=qs[_0x294905('0x8')](_[_0x294905('0x23')](_0x223d5a[_0x294905('0x1f')],_0x1e0acd['filters']),_0x34b62e);_0x223d5a[_0x294905('0x1f')][_0x294905('0x10')]&&(_0x306378[_0x294905('0x2e')]=_[_0x294905('0xb')](_0x306378['where'],{[Op['or']]:_['map'](_0x34b62e,function(_0x1d12f3){const _0x2aa636=_0x294905;if(_0x1d12f3[_0x2aa636('0x5')]!=='VIRTUAL'){const _0x4d29ea={};return _0x4d29ea[_0x1d12f3[_0x2aa636('0xc')]]={[Op[_0x2aa636('0x2d')]]:'%'+_0x223d5a['query'][_0x2aa636('0x10')]+'%'},_0x4d29ea;}})}));_0x306378=_['merge']({},_0x306378,_0x223d5a[_0x294905('0x12')]);const _0x3623a6={'where':_0x306378[_0x294905('0x2e')]};return db[_0x294905('0x2c')][_0x294905('0x17')](_0x3623a6)[_0x294905('0xf')](function(_0x2f09d3){const _0x1fbd1e=_0x294905;return _0x3a75ce[_0x1fbd1e('0x17')]=_0x2f09d3,_0x223d5a[_0x1fbd1e('0x1f')]['includeAll']&&(_0x306378[_0x1fbd1e('0x0')]=[{'all':!![]}]),db[_0x1fbd1e('0x2c')][_0x1fbd1e('0x4')](_0x306378);})[_0x294905('0xf')](function(_0x53fb55){return _0x3a75ce['rows']=_0x53fb55,_0x3a75ce;})[_0x294905('0xf')](respondWithFilteredResult(_0x22b19a,_0x306378))['catch'](handleError(_0x22b19a,null));},exports['show']=function(_0x37b6ec,_0x5a965){const _0x2335ff=_0x6b82fd;let _0x398dc8={'raw':![],'where':{'id':_0x37b6ec[_0x2335ff('0x21')]['id']}};const _0x1d1f0b={};return _0x1d1f0b[_0x2335ff('0x28')]=_[_0x2335ff('0x16')](db['VtigerConfiguration']['rawAttributes']),_0x1d1f0b[_0x2335ff('0x1f')]=_[_0x2335ff('0x16')](_0x37b6ec[_0x2335ff('0x1f')]),_0x1d1f0b[_0x2335ff('0x8')]=_[_0x2335ff('0x29')](_0x1d1f0b[_0x2335ff('0x28')],_0x1d1f0b[_0x2335ff('0x1f')]),_0x398dc8['attributes']=_['intersection'](_0x1d1f0b[_0x2335ff('0x28')],qs[_0x2335ff('0x31')](_0x37b6ec[_0x2335ff('0x1f')][_0x2335ff('0x31')])),_0x398dc8['attributes']=_0x398dc8[_0x2335ff('0x1a')]['length']?_0x398dc8[_0x2335ff('0x1a')]:_0x1d1f0b[_0x2335ff('0x28')],_0x37b6ec[_0x2335ff('0x1f')][_0x2335ff('0x15')]&&(_0x398dc8[_0x2335ff('0x0')]=[{'all':!![]}]),_0x398dc8=_[_0x2335ff('0xb')]({},_0x398dc8,_0x37b6ec[_0x2335ff('0x12')]),db[_0x2335ff('0x2c')][_0x2335ff('0x11')](_0x398dc8)['then'](handleEntityNotFound(_0x5a965,null))['then'](respondWithResult(_0x5a965,null))[_0x2335ff('0x6')](handleError(_0x5a965,null));},exports['create']=function(_0x2e33c1,_0x521293){const _0x399647=_0x6b82fd;return db[_0x399647('0x2c')]['create'](_0x2e33c1[_0x399647('0x2a')],{})['then'](respondWithResult(_0x521293,0xc9))[_0x399647('0x6')](handleError(_0x521293,null));},exports[_0x6b82fd('0x9')]=function(_0x405969,_0x46acc9){const _0x329390=_0x6b82fd;return _0x405969[_0x329390('0x2a')]['id']&&delete _0x405969[_0x329390('0x2a')]['id'],db[_0x329390('0x2c')][_0x329390('0x11')]({'where':{'id':_0x405969[_0x329390('0x21')]['id']}})[_0x329390('0xf')](handleEntityNotFound(_0x46acc9,null))[_0x329390('0xf')](saveUpdates(_0x405969[_0x329390('0x2a')],null))[_0x329390('0xf')](respondWithResult(_0x46acc9,null))[_0x329390('0x6')](handleError(_0x46acc9,null));},exports[_0x6b82fd('0x2f')]=function(_0x3d2d1e,_0x209978){const _0xdb06bd=_0x6b82fd;return db[_0xdb06bd('0x2c')][_0xdb06bd('0x11')]({'where':{'id':_0x3d2d1e[_0xdb06bd('0x21')]['id']}})[_0xdb06bd('0xf')](handleEntityNotFound(_0x209978,null))[_0xdb06bd('0xf')](removeEntity(_0x209978,null))[_0xdb06bd('0x6')](handleError(_0x209978,null));},exports[_0x6b82fd('0x22')]=function(_0x428f57,_0x49445f){const _0x2c2b98=_0x6b82fd;let _0x391d69={};const _0x126d32={};let _0x52a39a,_0x29779c;return db[_0x2c2b98('0x2c')]['findOne']({'where':{'id':_0x428f57['params']['id']}})[_0x2c2b98('0xf')](handleEntityNotFound(_0x49445f,null))[_0x2c2b98('0xf')](function(_0x59d1c2){const _0x4b10ae=_0x2c2b98;if(_0x59d1c2)return _0x52a39a=_0x59d1c2,_0x126d32[_0x4b10ae('0x28')]=_[_0x4b10ae('0x16')](db[_0x4b10ae('0x1e')][_0x4b10ae('0x13')]),_0x126d32['query']=_[_0x4b10ae('0x16')](_0x428f57[_0x4b10ae('0x1f')]),_0x126d32['filters']=_[_0x4b10ae('0x29')](_0x126d32['model'],_0x126d32[_0x4b10ae('0x1f')]),_0x391d69['attributes']=_[_0x4b10ae('0x29')](_0x126d32[_0x4b10ae('0x28')],qs[_0x4b10ae('0x31')](_0x428f57[_0x4b10ae('0x1f')]['fields'])),_0x391d69[_0x4b10ae('0x1a')]=_0x391d69[_0x4b10ae('0x1a')][_0x4b10ae('0xe')]?_0x391d69[_0x4b10ae('0x1a')]:_0x126d32[_0x4b10ae('0x28')],_0x391d69[_0x4b10ae('0x1d')]=qs[_0x4b10ae('0x33')](_0x428f57['query'][_0x4b10ae('0x33')]),_0x391d69['where']=qs[_0x4b10ae('0x8')](_['pick'](_0x428f57[_0x4b10ae('0x1f')],_0x126d32[_0x4b10ae('0x8')])),_0x428f57[_0x4b10ae('0x1f')]['filter']&&(_0x391d69[_0x4b10ae('0x2e')]=_['merge'](_0x391d69['where'],{[Op['or']]:_['map'](_0x391d69['attributes'],function(_0x3e081f){const _0x568448=_0x4b10ae,_0x38c9c4={};return _0x38c9c4[_0x3e081f]={[Op[_0x568448('0x2d')]]:'%'+_0x428f57[_0x568448('0x1f')][_0x568448('0x10')]+'%'},_0x38c9c4;})})),_0x391d69=_['merge']({},_0x391d69,_0x428f57[_0x4b10ae('0x12')]),_0x52a39a[_0x4b10ae('0x22')](_0x391d69);})[_0x2c2b98('0xf')](function(_0x4ed9d4){const _0x230c84=_0x2c2b98;if(_0x4ed9d4)return _0x29779c=_0x4ed9d4[_0x230c84('0xe')],typeof _0x428f57[_0x230c84('0x1f')][_0x230c84('0x3')]===_0x230c84('0x2b')&&(_0x391d69[_0x230c84('0x18')]=qs[_0x230c84('0x18')](_0x428f57[_0x230c84('0x1f')][_0x230c84('0x18')]),_0x391d69['offset']=qs[_0x230c84('0x24')](_0x428f57[_0x230c84('0x1f')][_0x230c84('0x24')])),_0x52a39a[_0x230c84('0x22')](_0x391d69);})[_0x2c2b98('0xf')](function(_0x596740){if(_0x596740)return _0x596740?{'count':_0x29779c,'rows':_0x596740}:null;})[_0x2c2b98('0xf')](respondWithResult(_0x49445f,null))['catch'](handleError(_0x49445f,null));},exports['getSubjects']=function(_0x34feb1,_0x3668c0){const _0x31085c=_0x6b82fd;let _0x15ceda={};const _0x257c69={};let _0x2ccf45,_0x5148af;return db[_0x31085c('0x2c')][_0x31085c('0x11')]({'where':{'id':_0x34feb1[_0x31085c('0x21')]['id']}})['then'](handleEntityNotFound(_0x3668c0,null))['then'](function(_0x5a601d){const _0x459a1d=_0x31085c;if(_0x5a601d)return _0x2ccf45=_0x5a601d,_0x257c69['model']=_['keys'](db[_0x459a1d('0x1e')][_0x459a1d('0x13')]),_0x257c69[_0x459a1d('0x1f')]=_[_0x459a1d('0x16')](_0x34feb1[_0x459a1d('0x1f')]),_0x257c69[_0x459a1d('0x8')]=_[_0x459a1d('0x29')](_0x257c69['model'],_0x257c69[_0x459a1d('0x1f')]),_0x15ceda[_0x459a1d('0x1a')]=_['intersection'](_0x257c69['model'],qs[_0x459a1d('0x31')](_0x34feb1[_0x459a1d('0x1f')][_0x459a1d('0x31')])),_0x15ceda[_0x459a1d('0x1a')]=_0x15ceda[_0x459a1d('0x1a')][_0x459a1d('0xe')]?_0x15ceda['attributes']:_0x257c69[_0x459a1d('0x28')],_0x15ceda[_0x459a1d('0x1d')]=qs[_0x459a1d('0x33')](_0x34feb1['query'][_0x459a1d('0x33')]),_0x15ceda[_0x459a1d('0x2e')]=qs['filters'](_['pick'](_0x34feb1[_0x459a1d('0x1f')],_0x257c69[_0x459a1d('0x8')])),_0x34feb1[_0x459a1d('0x1f')][_0x459a1d('0x10')]&&(_0x15ceda[_0x459a1d('0x2e')]=_[_0x459a1d('0xb')](_0x15ceda[_0x459a1d('0x2e')],{[Op['or']]:_[_0x459a1d('0x1b')](_0x15ceda[_0x459a1d('0x1a')],function(_0x484fab){const _0x23b55d=_0x459a1d,_0x523daa={};return _0x523daa[_0x484fab]={[Op[_0x23b55d('0x2d')]]:'%'+_0x34feb1[_0x23b55d('0x1f')]['filter']+'%'},_0x523daa;})})),_0x15ceda=_[_0x459a1d('0xb')]({},_0x15ceda,_0x34feb1['options']),_0x2ccf45[_0x459a1d('0xd')](_0x15ceda);})['then'](function(_0x37e1d0){const _0x106248=_0x31085c;if(_0x37e1d0)return _0x5148af=_0x37e1d0[_0x106248('0xe')],typeof _0x34feb1[_0x106248('0x1f')]['nolimit']===_0x106248('0x2b')&&(_0x15ceda[_0x106248('0x18')]=qs['limit'](_0x34feb1['query'][_0x106248('0x18')]),_0x15ceda[_0x106248('0x24')]=qs[_0x106248('0x24')](_0x34feb1[_0x106248('0x1f')][_0x106248('0x24')])),_0x2ccf45['getSubjects'](_0x15ceda);})[_0x31085c('0xf')](function(_0x368a5c){if(_0x368a5c)return _0x368a5c?{'count':_0x5148af,'rows':_0x368a5c}:null;})['then'](respondWithResult(_0x3668c0,null))[_0x31085c('0x6')](handleError(_0x3668c0,null));},exports['getDescriptions']=function(_0x34b910,_0x2a675d){const _0xeeb400=_0x6b82fd;let _0x3a2a1b={};const _0x4d19ae={};let _0x384730,_0xf3c9df;return db[_0xeeb400('0x2c')][_0xeeb400('0x11')]({'where':{'id':_0x34b910['params']['id']}})[_0xeeb400('0xf')](handleEntityNotFound(_0x2a675d,null))[_0xeeb400('0xf')](function(_0x585753){const _0x37504b=_0xeeb400;if(_0x585753)return _0x384730=_0x585753,_0x4d19ae[_0x37504b('0x28')]=_[_0x37504b('0x16')](db[_0x37504b('0x1e')][_0x37504b('0x13')]),_0x4d19ae[_0x37504b('0x1f')]=_[_0x37504b('0x16')](_0x34b910[_0x37504b('0x1f')]),_0x4d19ae['filters']=_[_0x37504b('0x29')](_0x4d19ae[_0x37504b('0x28')],_0x4d19ae[_0x37504b('0x1f')]),_0x3a2a1b[_0x37504b('0x1a')]=_[_0x37504b('0x29')](_0x4d19ae[_0x37504b('0x28')],qs[_0x37504b('0x31')](_0x34b910[_0x37504b('0x1f')][_0x37504b('0x31')])),_0x3a2a1b[_0x37504b('0x1a')]=_0x3a2a1b[_0x37504b('0x1a')][_0x37504b('0xe')]?_0x3a2a1b['attributes']:_0x4d19ae[_0x37504b('0x28')],_0x3a2a1b[_0x37504b('0x1d')]=qs[_0x37504b('0x33')](_0x34b910[_0x37504b('0x1f')]['sort']),_0x3a2a1b[_0x37504b('0x2e')]=qs[_0x37504b('0x8')](_[_0x37504b('0x23')](_0x34b910['query'],_0x4d19ae['filters'])),_0x34b910['query']['filter']&&(_0x3a2a1b['where']=_['merge'](_0x3a2a1b[_0x37504b('0x2e')],{[Op['or']]:_[_0x37504b('0x1b')](_0x3a2a1b[_0x37504b('0x1a')],function(_0x1aaffe){const _0x5f1aaa=_0x37504b,_0x21c225={};return _0x21c225[_0x1aaffe]={[Op[_0x5f1aaa('0x2d')]]:'%'+_0x34b910['query'][_0x5f1aaa('0x10')]+'%'},_0x21c225;})})),_0x3a2a1b=_[_0x37504b('0xb')]({},_0x3a2a1b,_0x34b910[_0x37504b('0x12')]),_0x384730[_0x37504b('0x32')](_0x3a2a1b);})[_0xeeb400('0xf')](function(_0x3ee238){const _0x13f727=_0xeeb400;if(_0x3ee238)return _0xf3c9df=_0x3ee238[_0x13f727('0xe')],typeof _0x34b910[_0x13f727('0x1f')][_0x13f727('0x3')]==='undefined'&&(_0x3a2a1b[_0x13f727('0x18')]=qs['limit'](_0x34b910[_0x13f727('0x1f')][_0x13f727('0x18')]),_0x3a2a1b[_0x13f727('0x24')]=qs[_0x13f727('0x24')](_0x34b910[_0x13f727('0x1f')][_0x13f727('0x24')])),_0x384730[_0x13f727('0x32')](_0x3a2a1b);})['then'](function(_0x4daacf){if(_0x4daacf)return _0x4daacf?{'count':_0xf3c9df,'rows':_0x4daacf}:null;})['then'](respondWithResult(_0x2a675d,null))['catch'](handleError(_0x2a675d,null));};
\ No newline at end of file
+const a325_0x6d27=['undefined','filters','includeAll','create','index','like','../../components/parsers/qs','intersection','status','update','getFields','../../config/logger','fields','model','query','set','merge','params','offset','filter','getSubjects','error','../../mysqldb','type','options','sendStatus','rawAttributes','catch','keys','then','VIRTUAL','order','json','sort','limit','where','destroy','VtigerField','VtigerConfiguration','stack','nolimit','findOne','attributes','rows','pick','name','map','send','body','Content-Range','include','fieldName','length','getDescriptions','count','findAll'];(function(_0x2e0dd6,_0x6d272f){const _0x14d077=function(_0x1be5d7){while(--_0x1be5d7){_0x2e0dd6['push'](_0x2e0dd6['shift']());}};_0x14d077(++_0x6d272f);}(a325_0x6d27,0x1ba));const a325_0x14d0=function(_0x2e0dd6,_0x6d272f){_0x2e0dd6=_0x2e0dd6-0x0;let _0x14d077=a325_0x6d27[_0x2e0dd6];return _0x14d077;};const _0x2884ee=a325_0x14d0;'use strict';const _=require('lodash'),qs=require(_0x2884ee('0xc')),logger=require(_0x2884ee('0x11'))('api'),db=require(_0x2884ee('0x1c'))['db'],{Op}=require('sequelize');function respondWithResult(_0x1be5d7,_0x2fe3f4){return _0x2fe3f4=_0x2fe3f4||0xc8,function(_0x42eb93){const _0x55f160=a325_0x14d0;if(_0x42eb93)return _0x1be5d7[_0x55f160('0xe')](_0x2fe3f4)[_0x55f160('0x26')](_0x42eb93);};}function respondWithFilteredResult(_0x2d2173,_0x54a154){return function(_0x4b179e){const _0x391c35=a325_0x14d0;if(_0x4b179e){const _0x138685=_0x4b179e[_0x391c35('0x4')],_0x2c7a28=_0x54a154[_0x391c35('0x18')];let _0x2c72cf=_0x54a154['offset']+_0x54a154['limit'],_0x5a7a25;return _0x2c72cf>=_0x138685?(_0x2c72cf=_0x138685,_0x5a7a25=0xc8):_0x5a7a25=0xce,_0x2d2173[_0x391c35('0xe')](_0x5a7a25),_0x2d2173[_0x391c35('0x15')](_0x391c35('0x37'),_0x2c7a28+'-'+_0x2c72cf+'/'+_0x138685)[_0x391c35('0x26')](_0x4b179e);}return null;};}function saveUpdates(_0xee9cea){return function(_0x4bc560){const _0x15d5a1=a325_0x14d0;if(_0x4bc560)return _0x4bc560['update'](_0xee9cea)[_0x15d5a1('0x23')](function(_0x36bbee){return _0x36bbee;});return null;};}function removeEntity(_0x190f08){return function(_0x254e8b){const _0xa6a2ba=a325_0x14d0;if(_0x254e8b)return _0x254e8b[_0xa6a2ba('0x2a')]()[_0xa6a2ba('0x23')](function(){const _0x3345e5=_0xa6a2ba;_0x190f08[_0x3345e5('0xe')](0xcc)['end']();});};}function handleEntityNotFound(_0x17cfed){return function(_0x1d2f1c){const _0x5cae8c=a325_0x14d0;return!_0x1d2f1c&&_0x17cfed[_0x5cae8c('0x1f')](0x194),_0x1d2f1c;};}function handleError(_0x58f833,_0x3a0375){return _0x3a0375=_0x3a0375||0x1f4,function(_0x174a39){const _0x3427df=a325_0x14d0;logger[_0x3427df('0x1b')](_0x174a39[_0x3427df('0x2d')]),_0x174a39[_0x3427df('0x33')]&&delete _0x174a39[_0x3427df('0x33')],_0x58f833['status'](_0x3a0375)[_0x3427df('0x35')](_0x174a39);};}exports[_0x2884ee('0xa')]=function(_0x113d06,_0x3145c4){const _0x56cbb8=_0x2884ee;let _0x297336={};const _0x170955={},_0x1efc4c={'count':0x0,'rows':[]},_0x4112ab=_['map'](db[_0x56cbb8('0x2c')][_0x56cbb8('0x20')],function(_0x2a5073){const _0x1ea998=_0x56cbb8;return{'name':_0x2a5073[_0x1ea998('0x1')],'type':_0x2a5073[_0x1ea998('0x1d')]['key']};});_0x170955[_0x56cbb8('0x13')]=_['map'](_0x4112ab,_0x56cbb8('0x33')),_0x170955[_0x56cbb8('0x14')]=_[_0x56cbb8('0x22')](_0x113d06['query']),_0x170955[_0x56cbb8('0x7')]=_['intersection'](_0x170955[_0x56cbb8('0x13')],_0x170955[_0x56cbb8('0x14')]),_0x297336[_0x56cbb8('0x30')]=_[_0x56cbb8('0xd')](_0x170955[_0x56cbb8('0x13')],qs[_0x56cbb8('0x12')](_0x113d06[_0x56cbb8('0x14')][_0x56cbb8('0x12')])),_0x297336[_0x56cbb8('0x30')]=_0x297336[_0x56cbb8('0x30')][_0x56cbb8('0x2')]?_0x297336[_0x56cbb8('0x30')]:_0x170955[_0x56cbb8('0x13')];typeof _0x113d06[_0x56cbb8('0x14')][_0x56cbb8('0x2e')]===_0x56cbb8('0x6')&&(_0x297336[_0x56cbb8('0x28')]=qs[_0x56cbb8('0x28')](_0x113d06[_0x56cbb8('0x14')][_0x56cbb8('0x28')]),_0x297336[_0x56cbb8('0x18')]=qs['offset'](_0x113d06['query'][_0x56cbb8('0x18')]));_0x297336['order']=qs['sort'](_0x113d06[_0x56cbb8('0x14')][_0x56cbb8('0x27')]),_0x297336[_0x56cbb8('0x29')]=qs[_0x56cbb8('0x7')](_[_0x56cbb8('0x32')](_0x113d06['query'],_0x170955[_0x56cbb8('0x7')]),_0x4112ab);_0x113d06[_0x56cbb8('0x14')]['filter']&&(_0x297336[_0x56cbb8('0x29')]=_['merge'](_0x297336[_0x56cbb8('0x29')],{[Op['or']]:_[_0x56cbb8('0x34')](_0x4112ab,function(_0x366633){const _0x342405=_0x56cbb8;if(_0x366633[_0x342405('0x1d')]!==_0x342405('0x24')){const _0x2c9ac8={};return _0x2c9ac8[_0x366633[_0x342405('0x33')]]={[Op[_0x342405('0xb')]]:'%'+_0x113d06['query'][_0x342405('0x19')]+'%'},_0x2c9ac8;}})}));_0x297336=_[_0x56cbb8('0x16')]({},_0x297336,_0x113d06[_0x56cbb8('0x1e')]);const _0x4368cf={'where':_0x297336[_0x56cbb8('0x29')]};return db[_0x56cbb8('0x2c')][_0x56cbb8('0x4')](_0x4368cf)[_0x56cbb8('0x23')](function(_0x42668b){const _0x15d2bc=_0x56cbb8;return _0x1efc4c[_0x15d2bc('0x4')]=_0x42668b,_0x113d06['query'][_0x15d2bc('0x8')]&&(_0x297336['include']=[{'all':!![]}]),db[_0x15d2bc('0x2c')][_0x15d2bc('0x5')](_0x297336);})[_0x56cbb8('0x23')](function(_0x2944cc){const _0x27fa8f=_0x56cbb8;return _0x1efc4c[_0x27fa8f('0x31')]=_0x2944cc,_0x1efc4c;})[_0x56cbb8('0x23')](respondWithFilteredResult(_0x3145c4,_0x297336))[_0x56cbb8('0x21')](handleError(_0x3145c4,null));},exports['show']=function(_0x137401,_0x3155da){const _0x2dd191=_0x2884ee;let _0x1a73b0={'raw':![],'where':{'id':_0x137401[_0x2dd191('0x17')]['id']}};const _0x28b565={};return _0x28b565[_0x2dd191('0x13')]=_[_0x2dd191('0x22')](db[_0x2dd191('0x2c')][_0x2dd191('0x20')]),_0x28b565[_0x2dd191('0x14')]=_[_0x2dd191('0x22')](_0x137401[_0x2dd191('0x14')]),_0x28b565[_0x2dd191('0x7')]=_[_0x2dd191('0xd')](_0x28b565[_0x2dd191('0x13')],_0x28b565[_0x2dd191('0x14')]),_0x1a73b0[_0x2dd191('0x30')]=_['intersection'](_0x28b565[_0x2dd191('0x13')],qs['fields'](_0x137401[_0x2dd191('0x14')][_0x2dd191('0x12')])),_0x1a73b0[_0x2dd191('0x30')]=_0x1a73b0[_0x2dd191('0x30')]['length']?_0x1a73b0['attributes']:_0x28b565[_0x2dd191('0x13')],_0x137401[_0x2dd191('0x14')]['includeAll']&&(_0x1a73b0[_0x2dd191('0x0')]=[{'all':!![]}]),_0x1a73b0=_['merge']({},_0x1a73b0,_0x137401[_0x2dd191('0x1e')]),db[_0x2dd191('0x2c')][_0x2dd191('0x2f')](_0x1a73b0)[_0x2dd191('0x23')](handleEntityNotFound(_0x3155da,null))['then'](respondWithResult(_0x3155da,null))[_0x2dd191('0x21')](handleError(_0x3155da,null));},exports['create']=function(_0x216fa1,_0x31566e){const _0xca6f4=_0x2884ee;return db[_0xca6f4('0x2c')][_0xca6f4('0x9')](_0x216fa1['body'],{})['then'](respondWithResult(_0x31566e,0xc9))['catch'](handleError(_0x31566e,null));},exports[_0x2884ee('0xf')]=function(_0x1719aa,_0x82b380){const _0x384274=_0x2884ee;return _0x1719aa[_0x384274('0x36')]['id']&&delete _0x1719aa['body']['id'],db[_0x384274('0x2c')][_0x384274('0x2f')]({'where':{'id':_0x1719aa[_0x384274('0x17')]['id']}})[_0x384274('0x23')](handleEntityNotFound(_0x82b380,null))[_0x384274('0x23')](saveUpdates(_0x1719aa[_0x384274('0x36')],null))[_0x384274('0x23')](respondWithResult(_0x82b380,null))[_0x384274('0x21')](handleError(_0x82b380,null));},exports[_0x2884ee('0x2a')]=function(_0x544b5c,_0x3e66bc){const _0x5aa205=_0x2884ee;return db[_0x5aa205('0x2c')][_0x5aa205('0x2f')]({'where':{'id':_0x544b5c[_0x5aa205('0x17')]['id']}})[_0x5aa205('0x23')](handleEntityNotFound(_0x3e66bc,null))[_0x5aa205('0x23')](removeEntity(_0x3e66bc,null))[_0x5aa205('0x21')](handleError(_0x3e66bc,null));},exports[_0x2884ee('0x10')]=function(_0x243190,_0x5b4e4d){const _0x41cc0a=_0x2884ee;let _0x81ad3d={};const _0x1177c2={};let _0x11f068,_0x379a30;return db[_0x41cc0a('0x2c')][_0x41cc0a('0x2f')]({'where':{'id':_0x243190[_0x41cc0a('0x17')]['id']}})[_0x41cc0a('0x23')](handleEntityNotFound(_0x5b4e4d,null))[_0x41cc0a('0x23')](function(_0x958b32){const _0x2d9f74=_0x41cc0a;if(_0x958b32)return _0x11f068=_0x958b32,_0x1177c2['model']=_[_0x2d9f74('0x22')](db['VtigerField'][_0x2d9f74('0x20')]),_0x1177c2[_0x2d9f74('0x14')]=_[_0x2d9f74('0x22')](_0x243190[_0x2d9f74('0x14')]),_0x1177c2[_0x2d9f74('0x7')]=_['intersection'](_0x1177c2[_0x2d9f74('0x13')],_0x1177c2[_0x2d9f74('0x14')]),_0x81ad3d[_0x2d9f74('0x30')]=_[_0x2d9f74('0xd')](_0x1177c2[_0x2d9f74('0x13')],qs[_0x2d9f74('0x12')](_0x243190[_0x2d9f74('0x14')][_0x2d9f74('0x12')])),_0x81ad3d['attributes']=_0x81ad3d[_0x2d9f74('0x30')][_0x2d9f74('0x2')]?_0x81ad3d[_0x2d9f74('0x30')]:_0x1177c2[_0x2d9f74('0x13')],_0x81ad3d[_0x2d9f74('0x25')]=qs['sort'](_0x243190[_0x2d9f74('0x14')]['sort']),_0x81ad3d['where']=qs['filters'](_[_0x2d9f74('0x32')](_0x243190[_0x2d9f74('0x14')],_0x1177c2['filters'])),_0x243190[_0x2d9f74('0x14')]['filter']&&(_0x81ad3d[_0x2d9f74('0x29')]=_[_0x2d9f74('0x16')](_0x81ad3d[_0x2d9f74('0x29')],{[Op['or']]:_['map'](_0x81ad3d[_0x2d9f74('0x30')],function(_0x450a36){const _0x36b075={};return _0x36b075[_0x450a36]={[Op['like']]:'%'+_0x243190['query']['filter']+'%'},_0x36b075;})})),_0x81ad3d=_[_0x2d9f74('0x16')]({},_0x81ad3d,_0x243190['options']),_0x11f068[_0x2d9f74('0x10')](_0x81ad3d);})[_0x41cc0a('0x23')](function(_0x1f980f){const _0x1a6468=_0x41cc0a;if(_0x1f980f)return _0x379a30=_0x1f980f[_0x1a6468('0x2')],typeof _0x243190['query'][_0x1a6468('0x2e')]===_0x1a6468('0x6')&&(_0x81ad3d['limit']=qs[_0x1a6468('0x28')](_0x243190[_0x1a6468('0x14')]['limit']),_0x81ad3d[_0x1a6468('0x18')]=qs[_0x1a6468('0x18')](_0x243190[_0x1a6468('0x14')][_0x1a6468('0x18')])),_0x11f068[_0x1a6468('0x10')](_0x81ad3d);})[_0x41cc0a('0x23')](function(_0x1ded30){if(_0x1ded30)return _0x1ded30?{'count':_0x379a30,'rows':_0x1ded30}:null;})[_0x41cc0a('0x23')](respondWithResult(_0x5b4e4d,null))[_0x41cc0a('0x21')](handleError(_0x5b4e4d,null));},exports[_0x2884ee('0x1a')]=function(_0x151a77,_0x38542c){const _0x2dc4d0=_0x2884ee;let _0x536694={};const _0x530080={};let _0x1a02e5,_0x22fc41;return db[_0x2dc4d0('0x2c')]['findOne']({'where':{'id':_0x151a77[_0x2dc4d0('0x17')]['id']}})['then'](handleEntityNotFound(_0x38542c,null))['then'](function(_0x4c5df5){const _0x4ecab2=_0x2dc4d0;if(_0x4c5df5)return _0x1a02e5=_0x4c5df5,_0x530080[_0x4ecab2('0x13')]=_[_0x4ecab2('0x22')](db['VtigerField']['rawAttributes']),_0x530080[_0x4ecab2('0x14')]=_['keys'](_0x151a77[_0x4ecab2('0x14')]),_0x530080[_0x4ecab2('0x7')]=_[_0x4ecab2('0xd')](_0x530080['model'],_0x530080[_0x4ecab2('0x14')]),_0x536694[_0x4ecab2('0x30')]=_[_0x4ecab2('0xd')](_0x530080[_0x4ecab2('0x13')],qs[_0x4ecab2('0x12')](_0x151a77[_0x4ecab2('0x14')][_0x4ecab2('0x12')])),_0x536694[_0x4ecab2('0x30')]=_0x536694[_0x4ecab2('0x30')]['length']?_0x536694['attributes']:_0x530080['model'],_0x536694['order']=qs[_0x4ecab2('0x27')](_0x151a77[_0x4ecab2('0x14')][_0x4ecab2('0x27')]),_0x536694[_0x4ecab2('0x29')]=qs[_0x4ecab2('0x7')](_[_0x4ecab2('0x32')](_0x151a77['query'],_0x530080['filters'])),_0x151a77[_0x4ecab2('0x14')][_0x4ecab2('0x19')]&&(_0x536694[_0x4ecab2('0x29')]=_[_0x4ecab2('0x16')](_0x536694[_0x4ecab2('0x29')],{[Op['or']]:_[_0x4ecab2('0x34')](_0x536694[_0x4ecab2('0x30')],function(_0x30e1a7){const _0x54b0e0=_0x4ecab2,_0x41d724={};return _0x41d724[_0x30e1a7]={[Op[_0x54b0e0('0xb')]]:'%'+_0x151a77[_0x54b0e0('0x14')][_0x54b0e0('0x19')]+'%'},_0x41d724;})})),_0x536694=_['merge']({},_0x536694,_0x151a77[_0x4ecab2('0x1e')]),_0x1a02e5[_0x4ecab2('0x1a')](_0x536694);})[_0x2dc4d0('0x23')](function(_0x5462ba){const _0x2cab66=_0x2dc4d0;if(_0x5462ba)return _0x22fc41=_0x5462ba[_0x2cab66('0x2')],typeof _0x151a77[_0x2cab66('0x14')][_0x2cab66('0x2e')]==='undefined'&&(_0x536694[_0x2cab66('0x28')]=qs['limit'](_0x151a77[_0x2cab66('0x14')][_0x2cab66('0x28')]),_0x536694[_0x2cab66('0x18')]=qs[_0x2cab66('0x18')](_0x151a77[_0x2cab66('0x14')][_0x2cab66('0x18')])),_0x1a02e5[_0x2cab66('0x1a')](_0x536694);})[_0x2dc4d0('0x23')](function(_0x4a28d1){if(_0x4a28d1)return _0x4a28d1?{'count':_0x22fc41,'rows':_0x4a28d1}:null;})['then'](respondWithResult(_0x38542c,null))[_0x2dc4d0('0x21')](handleError(_0x38542c,null));},exports[_0x2884ee('0x3')]=function(_0x600d5e,_0x110f22){const _0x297b6d=_0x2884ee;let _0x2bdd47={};const _0x15b5e6={};let _0x1456e4,_0x462b9;return db[_0x297b6d('0x2c')][_0x297b6d('0x2f')]({'where':{'id':_0x600d5e[_0x297b6d('0x17')]['id']}})['then'](handleEntityNotFound(_0x110f22,null))[_0x297b6d('0x23')](function(_0x98719e){const _0x50c558=_0x297b6d;if(_0x98719e)return _0x1456e4=_0x98719e,_0x15b5e6['model']=_['keys'](db[_0x50c558('0x2b')]['rawAttributes']),_0x15b5e6['query']=_[_0x50c558('0x22')](_0x600d5e[_0x50c558('0x14')]),_0x15b5e6[_0x50c558('0x7')]=_[_0x50c558('0xd')](_0x15b5e6[_0x50c558('0x13')],_0x15b5e6[_0x50c558('0x14')]),_0x2bdd47[_0x50c558('0x30')]=_['intersection'](_0x15b5e6[_0x50c558('0x13')],qs[_0x50c558('0x12')](_0x600d5e[_0x50c558('0x14')][_0x50c558('0x12')])),_0x2bdd47[_0x50c558('0x30')]=_0x2bdd47[_0x50c558('0x30')][_0x50c558('0x2')]?_0x2bdd47[_0x50c558('0x30')]:_0x15b5e6[_0x50c558('0x13')],_0x2bdd47[_0x50c558('0x25')]=qs[_0x50c558('0x27')](_0x600d5e['query'][_0x50c558('0x27')]),_0x2bdd47[_0x50c558('0x29')]=qs['filters'](_[_0x50c558('0x32')](_0x600d5e[_0x50c558('0x14')],_0x15b5e6['filters'])),_0x600d5e[_0x50c558('0x14')][_0x50c558('0x19')]&&(_0x2bdd47[_0x50c558('0x29')]=_[_0x50c558('0x16')](_0x2bdd47[_0x50c558('0x29')],{[Op['or']]:_[_0x50c558('0x34')](_0x2bdd47[_0x50c558('0x30')],function(_0x252af3){const _0x1efd63=_0x50c558,_0xb97d31={};return _0xb97d31[_0x252af3]={[Op['like']]:'%'+_0x600d5e[_0x1efd63('0x14')]['filter']+'%'},_0xb97d31;})})),_0x2bdd47=_[_0x50c558('0x16')]({},_0x2bdd47,_0x600d5e[_0x50c558('0x1e')]),_0x1456e4[_0x50c558('0x3')](_0x2bdd47);})['then'](function(_0xec8c00){const _0x1f6a08=_0x297b6d;if(_0xec8c00)return _0x462b9=_0xec8c00['length'],typeof _0x600d5e[_0x1f6a08('0x14')][_0x1f6a08('0x2e')]===_0x1f6a08('0x6')&&(_0x2bdd47[_0x1f6a08('0x28')]=qs[_0x1f6a08('0x28')](_0x600d5e[_0x1f6a08('0x14')][_0x1f6a08('0x28')]),_0x2bdd47[_0x1f6a08('0x18')]=qs[_0x1f6a08('0x18')](_0x600d5e[_0x1f6a08('0x14')]['offset'])),_0x1456e4[_0x1f6a08('0x3')](_0x2bdd47);})['then'](function(_0x2317c7){if(_0x2317c7)return _0x2317c7?{'count':_0x462b9,'rows':_0x2317c7}:null;})[_0x297b6d('0x23')](respondWithResult(_0x110f22,null))['catch'](handleError(_0x110f22,null));};
\ No newline at end of file