Built motion from commit f861bcb808219e66da88ba48b61bddb35224a65e. Version 3.0.0...
[motion-next.git] / server / api / intVtigerConfiguration / intVtigerConfiguration.controller.js
index 422ae02..2732eac 100644 (file)
@@ -1 +1 @@
-'use strict';const a390_0x5244=['@components/parsers/qs','index','158VsoDkx','@mysqldb','then','fields','length','update','error','getDescriptions','undefined','name','719380mMTOeg','VtigerField','status','getSubjects','filters','order','send','show','1239207ckbBsH','options','930107rGNWFh','pick','catch','limit','VtigerConfiguration','nolimit','map','933159yXeUAD','create','destroy','1nMjuQH','getFields','includeAll','filter','intersection','count','key','body','include','params','json','end','722341czaTCg','findAll','rawAttributes','model','query','407850uOFGDs','offset','findOne','rows','sort','Content-Range','233aBNJga','where','merge','lodash','api','keys','attributes'];const a390_0x12d7=function(_0x37a8f1,_0xd776c0){_0x37a8f1=_0x37a8f1-0xb6;let _0x524423=a390_0x5244[_0x37a8f1];return _0x524423;};const a390_0x1ddb4c=a390_0x12d7;(function(_0x2d55db,_0x5c1af1){const _0x3fa20b=a390_0x12d7;while(!![]){try{const _0x3d39cb=parseInt(_0x3fa20b(0xdb))+-parseInt(_0x3fa20b(0xd3))+parseInt(_0x3fa20b(0xe7))*-parseInt(_0x3fa20b(0xba))+-parseInt(_0x3fa20b(0xc0))*-parseInt(_0x3fa20b(0xc9))+parseInt(_0x3fa20b(0xe4))+parseInt(_0x3fa20b(0xf3))+-parseInt(_0x3fa20b(0xdd));if(_0x3d39cb===_0x5c1af1)break;else _0x2d55db['push'](_0x2d55db['shift']());}catch(_0x36ec1c){_0x2d55db['push'](_0x2d55db['shift']());}}}(a390_0x5244,0xd56c8));const _=require(a390_0x1ddb4c(0xc3)),qs=require(a390_0x1ddb4c(0xc7)),logger=require('@config/logger')(a390_0x1ddb4c(0xc4)),{db}=require(a390_0x1ddb4c(0xca)),{filterAttributes}=require('@utils/filter-attributes');function respondWithResult(_0xcd7a1e,_0x881921){return _0x881921=_0x881921||0xc8,function(_0xe2ddb3){const _0x5d1777=a390_0x12d7;if(_0xe2ddb3)return _0xcd7a1e[_0x5d1777(0xd5)](_0x881921)[_0x5d1777(0xf1)](_0xe2ddb3);};}function respondWithFilteredResult(_0x362856,_0x56be64){return function(_0x4d6740){const _0x3bf925=a390_0x12d7;if(_0x4d6740){const _0x1778de=_0x4d6740[_0x3bf925(0xec)],_0x31b141=_0x56be64[_0x3bf925(0xbb)];let _0xa401e1=_0x56be64['offset']+_0x56be64['limit'],_0x2c39eb;return _0xa401e1>=_0x1778de?(_0xa401e1=_0x1778de,_0x2c39eb=0xc8):_0x2c39eb=0xce,_0x362856['status'](_0x2c39eb),_0x362856['set'](_0x3bf925(0xbf),_0x31b141+'-'+_0xa401e1+'/'+_0x1778de)[_0x3bf925(0xf1)](_0x4d6740);}return null;};}function saveUpdates(_0x52245f){return function(_0x12c01c){const _0x55e072=a390_0x12d7;if(_0x12c01c)return _0x12c01c[_0x55e072(0xce)](_0x52245f)[_0x55e072(0xcb)](function(_0x3da693){return _0x3da693;});return null;};}function removeEntity(_0x567507){return function(_0x1a5453){const _0x3eb5f0=a390_0x12d7;if(_0x1a5453)return _0x1a5453[_0x3eb5f0(0xe6)]()[_0x3eb5f0(0xcb)](function(){const _0x47b102=_0x3eb5f0;_0x567507[_0x47b102(0xd5)](0xcc)[_0x47b102(0xf2)]();});};}function handleEntityNotFound(_0x2c9f93){return function(_0x4b9299){return!_0x4b9299&&_0x2c9f93['sendStatus'](0x194),_0x4b9299;};}function handleError(_0x16d265,_0x4d5523){return _0x4d5523=_0x4d5523||0x1f4,function(_0x599584){const _0x2c17c4=a390_0x12d7;logger[_0x2c17c4(0xcf)](_0x599584['stack']),_0x599584[_0x2c17c4(0xd2)]&&delete _0x599584['name'],_0x16d265[_0x2c17c4(0xd5)](_0x4d5523)[_0x2c17c4(0xd9)](_0x599584);};}exports[a390_0x1ddb4c(0xc8)]=function(_0x50c4ed,_0x1c4513){const _0x1af54b=a390_0x1ddb4c;let _0x48d691={};const _0x4f2473={},_0x4641a5={'count':0x0,'rows':[]},_0x3e0f88=_[_0x1af54b(0xe3)](db[_0x1af54b(0xe1)][_0x1af54b(0xb7)],function(_0x55297e){const _0xf39293=_0x1af54b;return{'name':_0x55297e['fieldName'],'type':_0x55297e['type'][_0xf39293(0xed)]};});_0x4f2473[_0x1af54b(0xb8)]=_[_0x1af54b(0xe3)](_0x3e0f88,_0x1af54b(0xd2)),_0x4f2473[_0x1af54b(0xb9)]=_['keys'](_0x50c4ed[_0x1af54b(0xb9)]),_0x4f2473[_0x1af54b(0xd7)]=_[_0x1af54b(0xeb)](_0x4f2473['model'],_0x4f2473[_0x1af54b(0xb9)]),_0x48d691[_0x1af54b(0xc6)]=_[_0x1af54b(0xeb)](_0x4f2473[_0x1af54b(0xb8)],qs[_0x1af54b(0xcc)](_0x50c4ed[_0x1af54b(0xb9)][_0x1af54b(0xcc)])),_0x48d691[_0x1af54b(0xc6)]=_0x48d691[_0x1af54b(0xc6)][_0x1af54b(0xcd)]?_0x48d691[_0x1af54b(0xc6)]:_0x4f2473[_0x1af54b(0xb8)];typeof _0x50c4ed[_0x1af54b(0xb9)][_0x1af54b(0xe2)]===_0x1af54b(0xd1)&&(_0x48d691['limit']=qs[_0x1af54b(0xe0)](_0x50c4ed[_0x1af54b(0xb9)][_0x1af54b(0xe0)]),_0x48d691[_0x1af54b(0xbb)]=qs[_0x1af54b(0xbb)](_0x50c4ed[_0x1af54b(0xb9)][_0x1af54b(0xbb)]));_0x48d691[_0x1af54b(0xd8)]=qs[_0x1af54b(0xbe)](_0x50c4ed[_0x1af54b(0xb9)][_0x1af54b(0xbe)]),_0x48d691['where']=qs[_0x1af54b(0xd7)](_['pick'](_0x50c4ed['query'],_0x4f2473[_0x1af54b(0xd7)]),_0x3e0f88),_0x48d691=filterAttributes(_0x48d691,_0x50c4ed[_0x1af54b(0xb9)]['filter'],_0x3e0f88,_0x50c4ed['options']);const _0x48461c={'where':_0x48d691[_0x1af54b(0xc1)]};return db['VtigerConfiguration']['count'](_0x48461c)[_0x1af54b(0xcb)](function(_0xee1b3b){const _0x2fb843=_0x1af54b;return _0x4641a5['count']=_0xee1b3b,_0x50c4ed[_0x2fb843(0xb9)][_0x2fb843(0xe9)]&&(_0x48d691[_0x2fb843(0xef)]=[{'all':!![]}]),db[_0x2fb843(0xe1)][_0x2fb843(0xb6)](_0x48d691);})[_0x1af54b(0xcb)](function(_0x489165){const _0x1738ae=_0x1af54b;return _0x4641a5[_0x1738ae(0xbd)]=_0x489165,_0x4641a5;})['then'](respondWithFilteredResult(_0x1c4513,_0x48d691))[_0x1af54b(0xdf)](handleError(_0x1c4513,null));},exports[a390_0x1ddb4c(0xda)]=function(_0x58195a,_0x23fcfc){const _0x4df718=a390_0x1ddb4c;let _0x4ff222={'raw':![],'where':{'id':_0x58195a[_0x4df718(0xf0)]['id']}};const _0x13a7d4={};return _0x13a7d4[_0x4df718(0xb8)]=_[_0x4df718(0xc5)](db[_0x4df718(0xe1)][_0x4df718(0xb7)]),_0x13a7d4[_0x4df718(0xb9)]=_[_0x4df718(0xc5)](_0x58195a[_0x4df718(0xb9)]),_0x13a7d4[_0x4df718(0xd7)]=_[_0x4df718(0xeb)](_0x13a7d4['model'],_0x13a7d4[_0x4df718(0xb9)]),_0x4ff222[_0x4df718(0xc6)]=_[_0x4df718(0xeb)](_0x13a7d4[_0x4df718(0xb8)],qs[_0x4df718(0xcc)](_0x58195a[_0x4df718(0xb9)][_0x4df718(0xcc)])),_0x4ff222[_0x4df718(0xc6)]=_0x4ff222['attributes'][_0x4df718(0xcd)]?_0x4ff222['attributes']:_0x13a7d4[_0x4df718(0xb8)],_0x58195a[_0x4df718(0xb9)][_0x4df718(0xe9)]&&(_0x4ff222[_0x4df718(0xef)]=[{'all':!![]}]),_0x4ff222=_[_0x4df718(0xc2)]({},_0x4ff222,_0x58195a[_0x4df718(0xdc)]),db[_0x4df718(0xe1)][_0x4df718(0xbc)](_0x4ff222)['then'](handleEntityNotFound(_0x23fcfc,null))['then'](respondWithResult(_0x23fcfc,null))[_0x4df718(0xdf)](handleError(_0x23fcfc,null));},exports[a390_0x1ddb4c(0xe5)]=function(_0x29c3b0,_0x4b5708){const _0x5ad4b3=a390_0x1ddb4c;return db[_0x5ad4b3(0xe1)][_0x5ad4b3(0xe5)](_0x29c3b0[_0x5ad4b3(0xee)],{})[_0x5ad4b3(0xcb)](respondWithResult(_0x4b5708,0xc9))[_0x5ad4b3(0xdf)](handleError(_0x4b5708,null));},exports[a390_0x1ddb4c(0xce)]=function(_0x59329f,_0x78527c){const _0x40bb2a=a390_0x1ddb4c;return _0x59329f[_0x40bb2a(0xee)]['id']&&delete _0x59329f[_0x40bb2a(0xee)]['id'],db[_0x40bb2a(0xe1)]['findOne']({'where':{'id':_0x59329f[_0x40bb2a(0xf0)]['id']}})[_0x40bb2a(0xcb)](handleEntityNotFound(_0x78527c,null))[_0x40bb2a(0xcb)](saveUpdates(_0x59329f[_0x40bb2a(0xee)],null))['then'](respondWithResult(_0x78527c,null))['catch'](handleError(_0x78527c,null));},exports[a390_0x1ddb4c(0xe6)]=function(_0x25049a,_0xebc9d5){const _0x2cab15=a390_0x1ddb4c;return db[_0x2cab15(0xe1)][_0x2cab15(0xbc)]({'where':{'id':_0x25049a[_0x2cab15(0xf0)]['id']}})[_0x2cab15(0xcb)](handleEntityNotFound(_0xebc9d5,null))[_0x2cab15(0xcb)](removeEntity(_0xebc9d5,null))[_0x2cab15(0xdf)](handleError(_0xebc9d5,null));},exports[a390_0x1ddb4c(0xe8)]=function(_0x4ac689,_0x46bda7){const _0x2acaeb=a390_0x1ddb4c;let _0x40d1a3={};const _0x21da2e={};let _0x32b869,_0x5b651d;return db[_0x2acaeb(0xe1)][_0x2acaeb(0xbc)]({'where':{'id':_0x4ac689[_0x2acaeb(0xf0)]['id']}})[_0x2acaeb(0xcb)](handleEntityNotFound(_0x46bda7,null))[_0x2acaeb(0xcb)](function(_0x111af8){const _0x4c6bee=_0x2acaeb;if(_0x111af8)return _0x32b869=_0x111af8,_0x21da2e[_0x4c6bee(0xb8)]=_['keys'](db['VtigerField'][_0x4c6bee(0xb7)]),_0x21da2e[_0x4c6bee(0xb9)]=_[_0x4c6bee(0xc5)](_0x4ac689[_0x4c6bee(0xb9)]),_0x21da2e[_0x4c6bee(0xd7)]=_['intersection'](_0x21da2e[_0x4c6bee(0xb8)],_0x21da2e[_0x4c6bee(0xb9)]),_0x40d1a3[_0x4c6bee(0xc6)]=_[_0x4c6bee(0xeb)](_0x21da2e[_0x4c6bee(0xb8)],qs[_0x4c6bee(0xcc)](_0x4ac689[_0x4c6bee(0xb9)][_0x4c6bee(0xcc)])),_0x40d1a3[_0x4c6bee(0xc6)]=_0x40d1a3[_0x4c6bee(0xc6)][_0x4c6bee(0xcd)]?_0x40d1a3['attributes']:_0x21da2e[_0x4c6bee(0xb8)],_0x40d1a3['order']=qs['sort'](_0x4ac689[_0x4c6bee(0xb9)][_0x4c6bee(0xbe)]),_0x40d1a3[_0x4c6bee(0xc1)]=qs[_0x4c6bee(0xd7)](_[_0x4c6bee(0xde)](_0x4ac689[_0x4c6bee(0xb9)],_0x21da2e[_0x4c6bee(0xd7)])),_0x40d1a3=filterAttributes(_0x40d1a3,_0x4ac689[_0x4c6bee(0xb9)][_0x4c6bee(0xea)],_0x40d1a3[_0x4c6bee(0xc6)],_0x4ac689[_0x4c6bee(0xdc)],![]),_0x32b869[_0x4c6bee(0xe8)](_0x40d1a3);})[_0x2acaeb(0xcb)](function(_0x55caff){const _0x305a70=_0x2acaeb;if(_0x55caff)return _0x5b651d=_0x55caff[_0x305a70(0xcd)],typeof _0x4ac689[_0x305a70(0xb9)][_0x305a70(0xe2)]==='undefined'&&(_0x40d1a3['limit']=qs['limit'](_0x4ac689['query'][_0x305a70(0xe0)]),_0x40d1a3[_0x305a70(0xbb)]=qs[_0x305a70(0xbb)](_0x4ac689[_0x305a70(0xb9)][_0x305a70(0xbb)])),_0x32b869[_0x305a70(0xe8)](_0x40d1a3);})[_0x2acaeb(0xcb)](function(_0x1b7952){if(_0x1b7952)return _0x1b7952?{'count':_0x5b651d,'rows':_0x1b7952}:null;})[_0x2acaeb(0xcb)](respondWithResult(_0x46bda7,null))[_0x2acaeb(0xdf)](handleError(_0x46bda7,null));},exports[a390_0x1ddb4c(0xd6)]=function(_0x3a7f1f,_0x5e5811){const _0x368c06=a390_0x1ddb4c;let _0x164105={};const _0x411fa0={};let _0x47d7af,_0x4e3a81;return db['VtigerConfiguration'][_0x368c06(0xbc)]({'where':{'id':_0x3a7f1f[_0x368c06(0xf0)]['id']}})[_0x368c06(0xcb)](handleEntityNotFound(_0x5e5811,null))['then'](function(_0x54e7b7){const _0x24fc07=_0x368c06;if(_0x54e7b7)return _0x47d7af=_0x54e7b7,_0x411fa0[_0x24fc07(0xb8)]=_[_0x24fc07(0xc5)](db['VtigerField'][_0x24fc07(0xb7)]),_0x411fa0[_0x24fc07(0xb9)]=_['keys'](_0x3a7f1f['query']),_0x411fa0[_0x24fc07(0xd7)]=_[_0x24fc07(0xeb)](_0x411fa0[_0x24fc07(0xb8)],_0x411fa0[_0x24fc07(0xb9)]),_0x164105[_0x24fc07(0xc6)]=_[_0x24fc07(0xeb)](_0x411fa0['model'],qs['fields'](_0x3a7f1f[_0x24fc07(0xb9)][_0x24fc07(0xcc)])),_0x164105[_0x24fc07(0xc6)]=_0x164105[_0x24fc07(0xc6)]['length']?_0x164105[_0x24fc07(0xc6)]:_0x411fa0[_0x24fc07(0xb8)],_0x164105[_0x24fc07(0xd8)]=qs[_0x24fc07(0xbe)](_0x3a7f1f[_0x24fc07(0xb9)]['sort']),_0x164105[_0x24fc07(0xc1)]=qs[_0x24fc07(0xd7)](_[_0x24fc07(0xde)](_0x3a7f1f['query'],_0x411fa0[_0x24fc07(0xd7)])),_0x164105=filterAttributes(_0x164105,_0x3a7f1f['query']['filter'],_0x164105['attributes'],_0x3a7f1f[_0x24fc07(0xdc)],![]),_0x47d7af[_0x24fc07(0xd6)](_0x164105);})[_0x368c06(0xcb)](function(_0xf778b2){const _0x1e09bb=_0x368c06;if(_0xf778b2)return _0x4e3a81=_0xf778b2['length'],typeof _0x3a7f1f[_0x1e09bb(0xb9)][_0x1e09bb(0xe2)]==='undefined'&&(_0x164105[_0x1e09bb(0xe0)]=qs[_0x1e09bb(0xe0)](_0x3a7f1f['query'][_0x1e09bb(0xe0)]),_0x164105[_0x1e09bb(0xbb)]=qs[_0x1e09bb(0xbb)](_0x3a7f1f[_0x1e09bb(0xb9)][_0x1e09bb(0xbb)])),_0x47d7af[_0x1e09bb(0xd6)](_0x164105);})['then'](function(_0x491fff){if(_0x491fff)return _0x491fff?{'count':_0x4e3a81,'rows':_0x491fff}:null;})[_0x368c06(0xcb)](respondWithResult(_0x5e5811,null))[_0x368c06(0xdf)](handleError(_0x5e5811,null));},exports[a390_0x1ddb4c(0xd0)]=function(_0x3031d7,_0x3be9d5){const _0xb8c1ae=a390_0x1ddb4c;let _0x20a41e={};const _0x2a5caf={};let _0x52c554,_0xe5c785;return db['VtigerConfiguration'][_0xb8c1ae(0xbc)]({'where':{'id':_0x3031d7[_0xb8c1ae(0xf0)]['id']}})['then'](handleEntityNotFound(_0x3be9d5,null))[_0xb8c1ae(0xcb)](function(_0x1e6e18){const _0x54fab6=_0xb8c1ae;if(_0x1e6e18)return _0x52c554=_0x1e6e18,_0x2a5caf['model']=_[_0x54fab6(0xc5)](db[_0x54fab6(0xd4)][_0x54fab6(0xb7)]),_0x2a5caf[_0x54fab6(0xb9)]=_[_0x54fab6(0xc5)](_0x3031d7['query']),_0x2a5caf[_0x54fab6(0xd7)]=_['intersection'](_0x2a5caf[_0x54fab6(0xb8)],_0x2a5caf[_0x54fab6(0xb9)]),_0x20a41e['attributes']=_['intersection'](_0x2a5caf['model'],qs[_0x54fab6(0xcc)](_0x3031d7[_0x54fab6(0xb9)][_0x54fab6(0xcc)])),_0x20a41e[_0x54fab6(0xc6)]=_0x20a41e[_0x54fab6(0xc6)][_0x54fab6(0xcd)]?_0x20a41e[_0x54fab6(0xc6)]:_0x2a5caf[_0x54fab6(0xb8)],_0x20a41e[_0x54fab6(0xd8)]=qs[_0x54fab6(0xbe)](_0x3031d7[_0x54fab6(0xb9)][_0x54fab6(0xbe)]),_0x20a41e[_0x54fab6(0xc1)]=qs[_0x54fab6(0xd7)](_[_0x54fab6(0xde)](_0x3031d7[_0x54fab6(0xb9)],_0x2a5caf[_0x54fab6(0xd7)])),_0x20a41e=filterAttributes(_0x20a41e,_0x3031d7[_0x54fab6(0xb9)]['filter'],_0x20a41e['attributes'],_0x3031d7[_0x54fab6(0xdc)],![]),_0x52c554[_0x54fab6(0xd0)](_0x20a41e);})[_0xb8c1ae(0xcb)](function(_0x5de701){const _0x55b1f2=_0xb8c1ae;if(_0x5de701)return _0xe5c785=_0x5de701[_0x55b1f2(0xcd)],typeof _0x3031d7['query'][_0x55b1f2(0xe2)]===_0x55b1f2(0xd1)&&(_0x20a41e[_0x55b1f2(0xe0)]=qs[_0x55b1f2(0xe0)](_0x3031d7[_0x55b1f2(0xb9)][_0x55b1f2(0xe0)]),_0x20a41e[_0x55b1f2(0xbb)]=qs['offset'](_0x3031d7['query'][_0x55b1f2(0xbb)])),_0x52c554[_0x55b1f2(0xd0)](_0x20a41e);})['then'](function(_0x8f16d){if(_0x8f16d)return _0x8f16d?{'count':_0xe5c785,'rows':_0x8f16d}:null;})['then'](respondWithResult(_0x3be9d5,null))[_0xb8c1ae(0xdf)](handleError(_0x3be9d5,null));};
\ No newline at end of file
+'use strict';const a390_0x560a=['count','destroy','limit','attributes','463051QEKdAD','create','getFields','stack','9tpOYis','intersection','3973gbAPZZ','getDescriptions','map','17sYpHWX','162125DOfVAa','order','1364211NgHtlE','Content-Range','@components/parsers/qs','catch','then','@config/logger','filter','where','undefined','model','merge','getSubjects','VtigerConfiguration','name','length','offset','149156bVNdsW','keys','include','findAll','nolimit','show','1026677DEpkkB','update','status','error','VtigerField','1376536KgCTbd','rows','key','type','end','pick','findOne','sort','fields','options','set','rawAttributes','body','fieldName','@mysqldb','query','index','params','filters'];const a390_0x1c38=function(_0x4e7fbd,_0x4d2d76){_0x4e7fbd=_0x4e7fbd-0x9c;let _0x560a43=a390_0x560a[_0x4e7fbd];return _0x560a43;};const a390_0x4f4609=a390_0x1c38;(function(_0x40cad6,_0x5b36c3){const _0x5ba1e7=a390_0x1c38;while(!![]){try{const _0x4cbb32=parseInt(_0x5ba1e7(0xa9))*-parseInt(_0x5ba1e7(0xaf))+-parseInt(_0x5ba1e7(0xc7))+parseInt(_0x5ba1e7(0xc1))+parseInt(_0x5ba1e7(0xab))*-parseInt(_0x5ba1e7(0xae))+parseInt(_0x5ba1e7(0xb1))+parseInt(_0x5ba1e7(0xcc))+parseInt(_0x5ba1e7(0xa5));if(_0x4cbb32===_0x5b36c3)break;else _0x40cad6['push'](_0x40cad6['shift']());}catch(_0xae51fa){_0x40cad6['push'](_0x40cad6['shift']());}}}(a390_0x560a,0xc337b));const _=require('lodash'),qs=require(a390_0x4f4609(0xb3)),logger=require(a390_0x4f4609(0xb6))('api'),{db}=require(a390_0x4f4609(0x9c)),{filterAttributes}=require('@utils/filter-attributes');function respondWithResult(_0x2d350f,_0xc4b26e){return _0xc4b26e=_0xc4b26e||0xc8,function(_0x3d9ba9){if(_0x3d9ba9)return _0x2d350f['status'](_0xc4b26e)['json'](_0x3d9ba9);};}function respondWithFilteredResult(_0x17d995,_0x51a599){return function(_0x2d3b37){const _0x21437a=a390_0x1c38;if(_0x2d3b37){const _0x5aca74=_0x2d3b37[_0x21437a(0xa1)],_0x21c53c=_0x51a599[_0x21437a(0xc0)];let _0x371cdf=_0x51a599[_0x21437a(0xc0)]+_0x51a599[_0x21437a(0xa3)],_0x55382d;return _0x371cdf>=_0x5aca74?(_0x371cdf=_0x5aca74,_0x55382d=0xc8):_0x55382d=0xce,_0x17d995[_0x21437a(0xc9)](_0x55382d),_0x17d995[_0x21437a(0xd6)](_0x21437a(0xb2),_0x21c53c+'-'+_0x371cdf+'/'+_0x5aca74)['json'](_0x2d3b37);}return null;};}function saveUpdates(_0x18ee96){return function(_0x124d7c){const _0x15dd05=a390_0x1c38;if(_0x124d7c)return _0x124d7c[_0x15dd05(0xc8)](_0x18ee96)['then'](function(_0x240714){return _0x240714;});return null;};}function removeEntity(_0xa91389){return function(_0x3ecdf0){const _0xe36600=a390_0x1c38;if(_0x3ecdf0)return _0x3ecdf0[_0xe36600(0xa2)]()[_0xe36600(0xb5)](function(){const _0x4dba81=_0xe36600;_0xa91389['status'](0xcc)[_0x4dba81(0xd0)]();});};}function handleEntityNotFound(_0x305970){return function(_0x424e71){return!_0x424e71&&_0x305970['sendStatus'](0x194),_0x424e71;};}function handleError(_0x148afe,_0x4df2b7){return _0x4df2b7=_0x4df2b7||0x1f4,function(_0x4dcdd){const _0x43ef4c=a390_0x1c38;logger[_0x43ef4c(0xca)](_0x4dcdd[_0x43ef4c(0xa8)]),_0x4dcdd[_0x43ef4c(0xbe)]&&delete _0x4dcdd[_0x43ef4c(0xbe)],_0x148afe[_0x43ef4c(0xc9)](_0x4df2b7)['send'](_0x4dcdd);};}exports[a390_0x4f4609(0x9e)]=function(_0xc81384,_0x32ba54){const _0x596e7d=a390_0x4f4609;let _0x125a02={};const _0x1ef7e5={},_0xadd36d={'count':0x0,'rows':[]},_0x2c27aa=_[_0x596e7d(0xad)](db['VtigerConfiguration'][_0x596e7d(0xd7)],function(_0x546aef){const _0x22485e=_0x596e7d;return{'name':_0x546aef[_0x22485e(0xd9)],'type':_0x546aef[_0x22485e(0xcf)][_0x22485e(0xce)]};});_0x1ef7e5['model']=_['map'](_0x2c27aa,_0x596e7d(0xbe)),_0x1ef7e5[_0x596e7d(0x9d)]=_[_0x596e7d(0xc2)](_0xc81384[_0x596e7d(0x9d)]),_0x1ef7e5[_0x596e7d(0xa0)]=_[_0x596e7d(0xaa)](_0x1ef7e5[_0x596e7d(0xba)],_0x1ef7e5[_0x596e7d(0x9d)]),_0x125a02[_0x596e7d(0xa4)]=_[_0x596e7d(0xaa)](_0x1ef7e5[_0x596e7d(0xba)],qs[_0x596e7d(0xd4)](_0xc81384[_0x596e7d(0x9d)][_0x596e7d(0xd4)])),_0x125a02[_0x596e7d(0xa4)]=_0x125a02['attributes'][_0x596e7d(0xbf)]?_0x125a02[_0x596e7d(0xa4)]:_0x1ef7e5[_0x596e7d(0xba)];typeof _0xc81384[_0x596e7d(0x9d)][_0x596e7d(0xc5)]===_0x596e7d(0xb9)&&(_0x125a02[_0x596e7d(0xa3)]=qs[_0x596e7d(0xa3)](_0xc81384[_0x596e7d(0x9d)][_0x596e7d(0xa3)]),_0x125a02[_0x596e7d(0xc0)]=qs[_0x596e7d(0xc0)](_0xc81384[_0x596e7d(0x9d)][_0x596e7d(0xc0)]));_0x125a02[_0x596e7d(0xb0)]=qs[_0x596e7d(0xd3)](_0xc81384[_0x596e7d(0x9d)][_0x596e7d(0xd3)]),_0x125a02['where']=qs[_0x596e7d(0xa0)](_[_0x596e7d(0xd1)](_0xc81384[_0x596e7d(0x9d)],_0x1ef7e5['filters']),_0x2c27aa),_0x125a02=filterAttributes(_0x125a02,_0xc81384[_0x596e7d(0x9d)][_0x596e7d(0xb7)],_0x2c27aa,_0xc81384[_0x596e7d(0xd5)]);const _0x240adf={'where':_0x125a02[_0x596e7d(0xb8)]};return db[_0x596e7d(0xbd)]['count'](_0x240adf)[_0x596e7d(0xb5)](function(_0x4d3eb8){const _0xc697e3=_0x596e7d;return _0xadd36d[_0xc697e3(0xa1)]=_0x4d3eb8,_0xc81384[_0xc697e3(0x9d)]['includeAll']&&(_0x125a02[_0xc697e3(0xc3)]=[{'all':!![]}]),db[_0xc697e3(0xbd)][_0xc697e3(0xc4)](_0x125a02);})[_0x596e7d(0xb5)](function(_0x42028a){const _0x1a75a4=_0x596e7d;return _0xadd36d[_0x1a75a4(0xcd)]=_0x42028a,_0xadd36d;})['then'](respondWithFilteredResult(_0x32ba54,_0x125a02))[_0x596e7d(0xb4)](handleError(_0x32ba54,null));},exports[a390_0x4f4609(0xc6)]=function(_0x473f1d,_0x42f4b9){const _0x5b37be=a390_0x4f4609;let _0x10e643={'raw':![],'where':{'id':_0x473f1d[_0x5b37be(0x9f)]['id']}};const _0x22c63b={};return _0x22c63b[_0x5b37be(0xba)]=_['keys'](db[_0x5b37be(0xbd)][_0x5b37be(0xd7)]),_0x22c63b[_0x5b37be(0x9d)]=_[_0x5b37be(0xc2)](_0x473f1d['query']),_0x22c63b[_0x5b37be(0xa0)]=_[_0x5b37be(0xaa)](_0x22c63b[_0x5b37be(0xba)],_0x22c63b[_0x5b37be(0x9d)]),_0x10e643[_0x5b37be(0xa4)]=_[_0x5b37be(0xaa)](_0x22c63b[_0x5b37be(0xba)],qs[_0x5b37be(0xd4)](_0x473f1d[_0x5b37be(0x9d)][_0x5b37be(0xd4)])),_0x10e643[_0x5b37be(0xa4)]=_0x10e643['attributes']['length']?_0x10e643['attributes']:_0x22c63b[_0x5b37be(0xba)],_0x473f1d[_0x5b37be(0x9d)]['includeAll']&&(_0x10e643[_0x5b37be(0xc3)]=[{'all':!![]}]),_0x10e643=_[_0x5b37be(0xbb)]({},_0x10e643,_0x473f1d['options']),db[_0x5b37be(0xbd)][_0x5b37be(0xd2)](_0x10e643)[_0x5b37be(0xb5)](handleEntityNotFound(_0x42f4b9,null))[_0x5b37be(0xb5)](respondWithResult(_0x42f4b9,null))[_0x5b37be(0xb4)](handleError(_0x42f4b9,null));},exports[a390_0x4f4609(0xa6)]=function(_0x35f195,_0x1297d4){const _0x459566=a390_0x4f4609;return db[_0x459566(0xbd)][_0x459566(0xa6)](_0x35f195[_0x459566(0xd8)],{})[_0x459566(0xb5)](respondWithResult(_0x1297d4,0xc9))['catch'](handleError(_0x1297d4,null));},exports[a390_0x4f4609(0xc8)]=function(_0x52444d,_0x7e7731){const _0x298cf2=a390_0x4f4609;return _0x52444d[_0x298cf2(0xd8)]['id']&&delete _0x52444d[_0x298cf2(0xd8)]['id'],db[_0x298cf2(0xbd)]['findOne']({'where':{'id':_0x52444d[_0x298cf2(0x9f)]['id']}})[_0x298cf2(0xb5)](handleEntityNotFound(_0x7e7731,null))[_0x298cf2(0xb5)](saveUpdates(_0x52444d[_0x298cf2(0xd8)],null))['then'](respondWithResult(_0x7e7731,null))[_0x298cf2(0xb4)](handleError(_0x7e7731,null));},exports['destroy']=function(_0x457e2c,_0x54afd1){const _0x224273=a390_0x4f4609;return db['VtigerConfiguration'][_0x224273(0xd2)]({'where':{'id':_0x457e2c[_0x224273(0x9f)]['id']}})['then'](handleEntityNotFound(_0x54afd1,null))[_0x224273(0xb5)](removeEntity(_0x54afd1,null))[_0x224273(0xb4)](handleError(_0x54afd1,null));},exports['getFields']=function(_0x41ee73,_0x26d2ce){const _0x49af78=a390_0x4f4609;let _0xaa014f={};const _0x48f0c2={};let _0x22d058,_0x578c35;return db[_0x49af78(0xbd)][_0x49af78(0xd2)]({'where':{'id':_0x41ee73['params']['id']}})[_0x49af78(0xb5)](handleEntityNotFound(_0x26d2ce,null))[_0x49af78(0xb5)](function(_0x19eed4){const _0x101562=_0x49af78;if(_0x19eed4)return _0x22d058=_0x19eed4,_0x48f0c2[_0x101562(0xba)]=_['keys'](db[_0x101562(0xcb)]['rawAttributes']),_0x48f0c2[_0x101562(0x9d)]=_[_0x101562(0xc2)](_0x41ee73['query']),_0x48f0c2['filters']=_['intersection'](_0x48f0c2[_0x101562(0xba)],_0x48f0c2[_0x101562(0x9d)]),_0xaa014f['attributes']=_[_0x101562(0xaa)](_0x48f0c2['model'],qs[_0x101562(0xd4)](_0x41ee73[_0x101562(0x9d)]['fields'])),_0xaa014f[_0x101562(0xa4)]=_0xaa014f[_0x101562(0xa4)][_0x101562(0xbf)]?_0xaa014f[_0x101562(0xa4)]:_0x48f0c2['model'],_0xaa014f['order']=qs['sort'](_0x41ee73[_0x101562(0x9d)][_0x101562(0xd3)]),_0xaa014f[_0x101562(0xb8)]=qs[_0x101562(0xa0)](_[_0x101562(0xd1)](_0x41ee73['query'],_0x48f0c2[_0x101562(0xa0)])),_0xaa014f=filterAttributes(_0xaa014f,_0x41ee73['query'][_0x101562(0xb7)],_0xaa014f['attributes'],_0x41ee73[_0x101562(0xd5)],![]),_0x22d058[_0x101562(0xa7)](_0xaa014f);})['then'](function(_0x4d4517){const _0x5aed27=_0x49af78;if(_0x4d4517)return _0x578c35=_0x4d4517[_0x5aed27(0xbf)],typeof _0x41ee73['query'][_0x5aed27(0xc5)]===_0x5aed27(0xb9)&&(_0xaa014f[_0x5aed27(0xa3)]=qs[_0x5aed27(0xa3)](_0x41ee73[_0x5aed27(0x9d)][_0x5aed27(0xa3)]),_0xaa014f[_0x5aed27(0xc0)]=qs[_0x5aed27(0xc0)](_0x41ee73[_0x5aed27(0x9d)][_0x5aed27(0xc0)])),_0x22d058[_0x5aed27(0xa7)](_0xaa014f);})[_0x49af78(0xb5)](function(_0x25ac98){if(_0x25ac98)return _0x25ac98?{'count':_0x578c35,'rows':_0x25ac98}:null;})[_0x49af78(0xb5)](respondWithResult(_0x26d2ce,null))[_0x49af78(0xb4)](handleError(_0x26d2ce,null));},exports['getSubjects']=function(_0x5b7ba2,_0x2cec6c){const _0x31f14d=a390_0x4f4609;let _0x2c2d4c={};const _0x377943={};let _0x48ff6d,_0x461e61;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x5b7ba2[_0x31f14d(0x9f)]['id']}})[_0x31f14d(0xb5)](handleEntityNotFound(_0x2cec6c,null))[_0x31f14d(0xb5)](function(_0x31eaa7){const _0x51d4f4=_0x31f14d;if(_0x31eaa7)return _0x48ff6d=_0x31eaa7,_0x377943[_0x51d4f4(0xba)]=_[_0x51d4f4(0xc2)](db[_0x51d4f4(0xcb)][_0x51d4f4(0xd7)]),_0x377943[_0x51d4f4(0x9d)]=_[_0x51d4f4(0xc2)](_0x5b7ba2[_0x51d4f4(0x9d)]),_0x377943['filters']=_[_0x51d4f4(0xaa)](_0x377943[_0x51d4f4(0xba)],_0x377943[_0x51d4f4(0x9d)]),_0x2c2d4c[_0x51d4f4(0xa4)]=_['intersection'](_0x377943[_0x51d4f4(0xba)],qs['fields'](_0x5b7ba2[_0x51d4f4(0x9d)]['fields'])),_0x2c2d4c['attributes']=_0x2c2d4c[_0x51d4f4(0xa4)]['length']?_0x2c2d4c[_0x51d4f4(0xa4)]:_0x377943[_0x51d4f4(0xba)],_0x2c2d4c[_0x51d4f4(0xb0)]=qs[_0x51d4f4(0xd3)](_0x5b7ba2[_0x51d4f4(0x9d)][_0x51d4f4(0xd3)]),_0x2c2d4c[_0x51d4f4(0xb8)]=qs[_0x51d4f4(0xa0)](_['pick'](_0x5b7ba2[_0x51d4f4(0x9d)],_0x377943[_0x51d4f4(0xa0)])),_0x2c2d4c=filterAttributes(_0x2c2d4c,_0x5b7ba2[_0x51d4f4(0x9d)][_0x51d4f4(0xb7)],_0x2c2d4c[_0x51d4f4(0xa4)],_0x5b7ba2[_0x51d4f4(0xd5)],![]),_0x48ff6d[_0x51d4f4(0xbc)](_0x2c2d4c);})[_0x31f14d(0xb5)](function(_0x1a0147){const _0x938082=_0x31f14d;if(_0x1a0147)return _0x461e61=_0x1a0147[_0x938082(0xbf)],typeof _0x5b7ba2['query']['nolimit']===_0x938082(0xb9)&&(_0x2c2d4c[_0x938082(0xa3)]=qs['limit'](_0x5b7ba2['query'][_0x938082(0xa3)]),_0x2c2d4c['offset']=qs['offset'](_0x5b7ba2['query']['offset'])),_0x48ff6d['getSubjects'](_0x2c2d4c);})['then'](function(_0x10ecb6){if(_0x10ecb6)return _0x10ecb6?{'count':_0x461e61,'rows':_0x10ecb6}:null;})[_0x31f14d(0xb5)](respondWithResult(_0x2cec6c,null))['catch'](handleError(_0x2cec6c,null));},exports[a390_0x4f4609(0xac)]=function(_0x19bd84,_0x456e7c){const _0x2d2e54=a390_0x4f4609;let _0x205447={};const _0x15cb8f={};let _0x295e0e,_0x40e81c;return db['VtigerConfiguration'][_0x2d2e54(0xd2)]({'where':{'id':_0x19bd84[_0x2d2e54(0x9f)]['id']}})[_0x2d2e54(0xb5)](handleEntityNotFound(_0x456e7c,null))[_0x2d2e54(0xb5)](function(_0x5071c2){const _0x3ea529=_0x2d2e54;if(_0x5071c2)return _0x295e0e=_0x5071c2,_0x15cb8f[_0x3ea529(0xba)]=_[_0x3ea529(0xc2)](db['VtigerField'][_0x3ea529(0xd7)]),_0x15cb8f[_0x3ea529(0x9d)]=_[_0x3ea529(0xc2)](_0x19bd84[_0x3ea529(0x9d)]),_0x15cb8f[_0x3ea529(0xa0)]=_[_0x3ea529(0xaa)](_0x15cb8f[_0x3ea529(0xba)],_0x15cb8f[_0x3ea529(0x9d)]),_0x205447[_0x3ea529(0xa4)]=_[_0x3ea529(0xaa)](_0x15cb8f[_0x3ea529(0xba)],qs['fields'](_0x19bd84[_0x3ea529(0x9d)][_0x3ea529(0xd4)])),_0x205447[_0x3ea529(0xa4)]=_0x205447[_0x3ea529(0xa4)][_0x3ea529(0xbf)]?_0x205447[_0x3ea529(0xa4)]:_0x15cb8f[_0x3ea529(0xba)],_0x205447[_0x3ea529(0xb0)]=qs[_0x3ea529(0xd3)](_0x19bd84[_0x3ea529(0x9d)][_0x3ea529(0xd3)]),_0x205447[_0x3ea529(0xb8)]=qs[_0x3ea529(0xa0)](_[_0x3ea529(0xd1)](_0x19bd84[_0x3ea529(0x9d)],_0x15cb8f['filters'])),_0x205447=filterAttributes(_0x205447,_0x19bd84[_0x3ea529(0x9d)][_0x3ea529(0xb7)],_0x205447[_0x3ea529(0xa4)],_0x19bd84[_0x3ea529(0xd5)],![]),_0x295e0e['getDescriptions'](_0x205447);})['then'](function(_0x3af226){const _0x52ba5c=_0x2d2e54;if(_0x3af226)return _0x40e81c=_0x3af226[_0x52ba5c(0xbf)],typeof _0x19bd84[_0x52ba5c(0x9d)]['nolimit']==='undefined'&&(_0x205447['limit']=qs[_0x52ba5c(0xa3)](_0x19bd84[_0x52ba5c(0x9d)][_0x52ba5c(0xa3)]),_0x205447[_0x52ba5c(0xc0)]=qs[_0x52ba5c(0xc0)](_0x19bd84['query'][_0x52ba5c(0xc0)])),_0x295e0e[_0x52ba5c(0xac)](_0x205447);})[_0x2d2e54(0xb5)](function(_0x7d7b72){if(_0x7d7b72)return _0x7d7b72?{'count':_0x40e81c,'rows':_0x7d7b72}:null;})['then'](respondWithResult(_0x456e7c,null))[_0x2d2e54(0xb4)](handleError(_0x456e7c,null));};
\ No newline at end of file