Built motion from commit 362b9399b4d0ed5560fbb795af995925d345fc38. Version 3.0.0...
[motion-next.git] / server / api / intSugarcrmConfiguration / intSugarcrmConfiguration.controller.js
index 2250033..c6fc66e 100644 (file)
@@ -1 +1 @@
-const a374_0x5138=['count','nolimit','where','options','findOne','getFields','getSubjects','sequelize','limit','order','../../mysqldb','include','query','type','then','fieldName','filters','pick','filter','length','create','getDescriptions','update','../../config/logger','map','params','fields','rawAttributes','findAll','sort','rows','stack','model','intersection','offset','set','keys','SugarcrmField','error','undefined','json','merge','SugarcrmConfiguration','body','attributes','catch','destroy','name','end','index','Content-Range','../../components/parsers/qs','like','status','lodash','includeAll','key'];(function(_0x547233,_0x35e8eb){const _0x513803=function(_0x293145){while(--_0x293145){_0x547233['push'](_0x547233['shift']());}};_0x513803(++_0x35e8eb);}(a374_0x5138,0x153));const a374_0x2931=function(_0x547233,_0x35e8eb){_0x547233=_0x547233-0x15c;let _0x513803=a374_0x5138[_0x547233];return _0x513803;};const a374_0x2361b9=a374_0x2931;'use strict';const _=require(a374_0x2361b9(0x15c)),qs=require(a374_0x2361b9(0x192)),logger=require(a374_0x2361b9(0x176))('api'),{db}=require(a374_0x2361b9(0x169)),{Op}=require(a374_0x2361b9(0x166));function respondWithResult(_0xee55b7,_0x31a059){return _0x31a059=_0x31a059||0xc8,function(_0x387e31){const _0x25a60b=a374_0x2931;if(_0x387e31)return _0xee55b7[_0x25a60b(0x194)](_0x31a059)['json'](_0x387e31);};}function respondWithFilteredResult(_0x556303,_0x5ab16d){return function(_0x567da9){const _0x33bd9c=a374_0x2931;if(_0x567da9){const _0x13af5d=_0x567da9[_0x33bd9c(0x15f)],_0x5578d6=_0x5ab16d[_0x33bd9c(0x181)];let _0x5159cb=_0x5ab16d[_0x33bd9c(0x181)]+_0x5ab16d[_0x33bd9c(0x167)],_0x511bdf;return _0x5159cb>=_0x13af5d?(_0x5159cb=_0x13af5d,_0x511bdf=0xc8):_0x511bdf=0xce,_0x556303[_0x33bd9c(0x194)](_0x511bdf),_0x556303[_0x33bd9c(0x182)](_0x33bd9c(0x191),_0x5578d6+'-'+_0x5159cb+'/'+_0x13af5d)[_0x33bd9c(0x187)](_0x567da9);}return null;};}function saveUpdates(_0x7c15cc){return function(_0x3fbe9a){const _0x58ba7e=a374_0x2931;if(_0x3fbe9a)return _0x3fbe9a[_0x58ba7e(0x175)](_0x7c15cc)['then'](function(_0x3433e3){return _0x3433e3;});return null;};}function removeEntity(_0x481a26){return function(_0x404fde){const _0x3793f3=a374_0x2931;if(_0x404fde)return _0x404fde[_0x3793f3(0x18d)]()['then'](function(){const _0x282c46=_0x3793f3;_0x481a26[_0x282c46(0x194)](0xcc)[_0x282c46(0x18f)]();});};}function handleEntityNotFound(_0x4b4fb2){return function(_0x3bc117){return!_0x3bc117&&_0x4b4fb2['sendStatus'](0x194),_0x3bc117;};}function handleError(_0x32d9dd,_0x479455){return _0x479455=_0x479455||0x1f4,function(_0x488f5e){const _0x220413=a374_0x2931;logger[_0x220413(0x185)](_0x488f5e[_0x220413(0x17e)]),_0x488f5e[_0x220413(0x18e)]&&delete _0x488f5e[_0x220413(0x18e)],_0x32d9dd[_0x220413(0x194)](_0x479455)['send'](_0x488f5e);};}exports[a374_0x2361b9(0x190)]=function(_0x3f0d6f,_0x36986c){const _0x3a7a00=a374_0x2361b9;let _0x538a0b={};const _0x4ea4b3={},_0x4fd9b4={'count':0x0,'rows':[]},_0xb37911=_[_0x3a7a00(0x177)](db[_0x3a7a00(0x189)][_0x3a7a00(0x17a)],function(_0x1140c3){const _0x2a3e8d=_0x3a7a00;return{'name':_0x1140c3[_0x2a3e8d(0x16e)],'type':_0x1140c3['type'][_0x2a3e8d(0x15e)]};});_0x4ea4b3[_0x3a7a00(0x17f)]=_['map'](_0xb37911,_0x3a7a00(0x18e)),_0x4ea4b3[_0x3a7a00(0x16b)]=_[_0x3a7a00(0x183)](_0x3f0d6f[_0x3a7a00(0x16b)]),_0x4ea4b3[_0x3a7a00(0x16f)]=_[_0x3a7a00(0x180)](_0x4ea4b3[_0x3a7a00(0x17f)],_0x4ea4b3['query']),_0x538a0b[_0x3a7a00(0x18b)]=_[_0x3a7a00(0x180)](_0x4ea4b3[_0x3a7a00(0x17f)],qs['fields'](_0x3f0d6f[_0x3a7a00(0x16b)][_0x3a7a00(0x179)])),_0x538a0b[_0x3a7a00(0x18b)]=_0x538a0b[_0x3a7a00(0x18b)][_0x3a7a00(0x172)]?_0x538a0b[_0x3a7a00(0x18b)]:_0x4ea4b3['model'];typeof _0x3f0d6f[_0x3a7a00(0x16b)]['nolimit']===_0x3a7a00(0x186)&&(_0x538a0b[_0x3a7a00(0x167)]=qs[_0x3a7a00(0x167)](_0x3f0d6f[_0x3a7a00(0x16b)][_0x3a7a00(0x167)]),_0x538a0b[_0x3a7a00(0x181)]=qs[_0x3a7a00(0x181)](_0x3f0d6f[_0x3a7a00(0x16b)]['offset']));_0x538a0b[_0x3a7a00(0x168)]=qs[_0x3a7a00(0x17c)](_0x3f0d6f[_0x3a7a00(0x16b)][_0x3a7a00(0x17c)]),_0x538a0b['where']=qs[_0x3a7a00(0x16f)](_[_0x3a7a00(0x170)](_0x3f0d6f[_0x3a7a00(0x16b)],_0x4ea4b3[_0x3a7a00(0x16f)]),_0xb37911);_0x3f0d6f[_0x3a7a00(0x16b)]['filter']&&(_0x538a0b[_0x3a7a00(0x161)]=_[_0x3a7a00(0x188)](_0x538a0b[_0x3a7a00(0x161)],{[Op['or']]:_['map'](_0xb37911,function(_0x235af3){const _0x52c23d=_0x3a7a00;if(_0x235af3[_0x52c23d(0x16c)]!=='VIRTUAL'){const _0x5c2a53={};return _0x5c2a53[_0x235af3['name']]={[Op[_0x52c23d(0x193)]]:'%'+_0x3f0d6f['query'][_0x52c23d(0x171)]+'%'},_0x5c2a53;}})}));_0x538a0b=_[_0x3a7a00(0x188)]({},_0x538a0b,_0x3f0d6f[_0x3a7a00(0x162)]);const _0x3d4991={'where':_0x538a0b[_0x3a7a00(0x161)]};return db['SugarcrmConfiguration'][_0x3a7a00(0x15f)](_0x3d4991)['then'](function(_0x34e1d1){const _0x5ec998=_0x3a7a00;return _0x4fd9b4[_0x5ec998(0x15f)]=_0x34e1d1,_0x3f0d6f[_0x5ec998(0x16b)]['includeAll']&&(_0x538a0b[_0x5ec998(0x16a)]=[{'all':!![]}]),db[_0x5ec998(0x189)][_0x5ec998(0x17b)](_0x538a0b);})['then'](function(_0x259ebf){const _0x4b212b=_0x3a7a00;return _0x4fd9b4[_0x4b212b(0x17d)]=_0x259ebf,_0x4fd9b4;})[_0x3a7a00(0x16d)](respondWithFilteredResult(_0x36986c,_0x538a0b))[_0x3a7a00(0x18c)](handleError(_0x36986c,null));},exports['show']=function(_0x5a42d9,_0x19a6ff){const _0x212620=a374_0x2361b9;let _0x3b3de9={'raw':![],'where':{'id':_0x5a42d9[_0x212620(0x178)]['id']}};const _0x2e473b={};return _0x2e473b[_0x212620(0x17f)]=_[_0x212620(0x183)](db[_0x212620(0x189)][_0x212620(0x17a)]),_0x2e473b[_0x212620(0x16b)]=_[_0x212620(0x183)](_0x5a42d9['query']),_0x2e473b[_0x212620(0x16f)]=_[_0x212620(0x180)](_0x2e473b['model'],_0x2e473b[_0x212620(0x16b)]),_0x3b3de9[_0x212620(0x18b)]=_['intersection'](_0x2e473b[_0x212620(0x17f)],qs[_0x212620(0x179)](_0x5a42d9[_0x212620(0x16b)][_0x212620(0x179)])),_0x3b3de9[_0x212620(0x18b)]=_0x3b3de9[_0x212620(0x18b)][_0x212620(0x172)]?_0x3b3de9[_0x212620(0x18b)]:_0x2e473b[_0x212620(0x17f)],_0x5a42d9[_0x212620(0x16b)][_0x212620(0x15d)]&&(_0x3b3de9[_0x212620(0x16a)]=[{'all':!![]}]),_0x3b3de9=_[_0x212620(0x188)]({},_0x3b3de9,_0x5a42d9[_0x212620(0x162)]),db[_0x212620(0x189)][_0x212620(0x163)](_0x3b3de9)[_0x212620(0x16d)](handleEntityNotFound(_0x19a6ff,null))[_0x212620(0x16d)](respondWithResult(_0x19a6ff,null))[_0x212620(0x18c)](handleError(_0x19a6ff,null));},exports[a374_0x2361b9(0x173)]=function(_0x3e32cd,_0x43c55f){const _0x2184ee=a374_0x2361b9;return db[_0x2184ee(0x189)][_0x2184ee(0x173)](_0x3e32cd['body'],{})[_0x2184ee(0x16d)](respondWithResult(_0x43c55f,0xc9))['catch'](handleError(_0x43c55f,null));},exports[a374_0x2361b9(0x175)]=function(_0x5c842b,_0x435350){const _0x431e4a=a374_0x2361b9;return _0x5c842b['body']['id']&&delete _0x5c842b[_0x431e4a(0x18a)]['id'],db[_0x431e4a(0x189)][_0x431e4a(0x163)]({'where':{'id':_0x5c842b[_0x431e4a(0x178)]['id']}})['then'](handleEntityNotFound(_0x435350,null))[_0x431e4a(0x16d)](saveUpdates(_0x5c842b[_0x431e4a(0x18a)],null))[_0x431e4a(0x16d)](respondWithResult(_0x435350,null))[_0x431e4a(0x18c)](handleError(_0x435350,null));},exports[a374_0x2361b9(0x18d)]=function(_0x2d916d,_0x1849b1){const _0x26d0a6=a374_0x2361b9;return db['SugarcrmConfiguration'][_0x26d0a6(0x163)]({'where':{'id':_0x2d916d['params']['id']}})['then'](handleEntityNotFound(_0x1849b1,null))[_0x26d0a6(0x16d)](removeEntity(_0x1849b1,null))[_0x26d0a6(0x18c)](handleError(_0x1849b1,null));},exports['getFields']=function(_0x564aa7,_0x3cd784){const _0x2a95d4=a374_0x2361b9;let _0xd9f44={};const _0x36f5a2={};let _0x18e256,_0x442520;return db[_0x2a95d4(0x189)][_0x2a95d4(0x163)]({'where':{'id':_0x564aa7[_0x2a95d4(0x178)]['id']}})[_0x2a95d4(0x16d)](handleEntityNotFound(_0x3cd784,null))['then'](function(_0x24d887){const _0x40ca37=_0x2a95d4;if(_0x24d887)return _0x18e256=_0x24d887,_0x36f5a2['model']=_[_0x40ca37(0x183)](db['SugarcrmField'][_0x40ca37(0x17a)]),_0x36f5a2['query']=_[_0x40ca37(0x183)](_0x564aa7[_0x40ca37(0x16b)]),_0x36f5a2[_0x40ca37(0x16f)]=_[_0x40ca37(0x180)](_0x36f5a2['model'],_0x36f5a2[_0x40ca37(0x16b)]),_0xd9f44[_0x40ca37(0x18b)]=_[_0x40ca37(0x180)](_0x36f5a2[_0x40ca37(0x17f)],qs[_0x40ca37(0x179)](_0x564aa7[_0x40ca37(0x16b)]['fields'])),_0xd9f44[_0x40ca37(0x18b)]=_0xd9f44[_0x40ca37(0x18b)]['length']?_0xd9f44[_0x40ca37(0x18b)]:_0x36f5a2['model'],_0xd9f44['order']=qs[_0x40ca37(0x17c)](_0x564aa7[_0x40ca37(0x16b)][_0x40ca37(0x17c)]),_0xd9f44['where']=qs[_0x40ca37(0x16f)](_[_0x40ca37(0x170)](_0x564aa7[_0x40ca37(0x16b)],_0x36f5a2[_0x40ca37(0x16f)])),_0x564aa7[_0x40ca37(0x16b)][_0x40ca37(0x171)]&&(_0xd9f44[_0x40ca37(0x161)]=_[_0x40ca37(0x188)](_0xd9f44[_0x40ca37(0x161)],{[Op['or']]:_[_0x40ca37(0x177)](_0xd9f44[_0x40ca37(0x18b)],function(_0x2718dd){const _0x3e7564=_0x40ca37,_0x232f52={};return _0x232f52[_0x2718dd]={[Op[_0x3e7564(0x193)]]:'%'+_0x564aa7['query'][_0x3e7564(0x171)]+'%'},_0x232f52;})})),_0xd9f44=_[_0x40ca37(0x188)]({},_0xd9f44,_0x564aa7[_0x40ca37(0x162)]),_0x18e256[_0x40ca37(0x164)](_0xd9f44);})[_0x2a95d4(0x16d)](function(_0x20f8a9){const _0x590ba7=_0x2a95d4;if(_0x20f8a9)return _0x442520=_0x20f8a9['length'],typeof _0x564aa7[_0x590ba7(0x16b)][_0x590ba7(0x160)]===_0x590ba7(0x186)&&(_0xd9f44[_0x590ba7(0x167)]=qs[_0x590ba7(0x167)](_0x564aa7[_0x590ba7(0x16b)][_0x590ba7(0x167)]),_0xd9f44[_0x590ba7(0x181)]=qs[_0x590ba7(0x181)](_0x564aa7['query'][_0x590ba7(0x181)])),_0x18e256[_0x590ba7(0x164)](_0xd9f44);})[_0x2a95d4(0x16d)](function(_0xe3fefb){if(_0xe3fefb)return _0xe3fefb?{'count':_0x442520,'rows':_0xe3fefb}:null;})['then'](respondWithResult(_0x3cd784,null))[_0x2a95d4(0x18c)](handleError(_0x3cd784,null));},exports[a374_0x2361b9(0x165)]=function(_0x2f98b0,_0x36038e){const _0x25b145=a374_0x2361b9;let _0x1ffcfa={};const _0x23dc19={};let _0x24fe66,_0x708975;return db[_0x25b145(0x189)][_0x25b145(0x163)]({'where':{'id':_0x2f98b0['params']['id']}})[_0x25b145(0x16d)](handleEntityNotFound(_0x36038e,null))[_0x25b145(0x16d)](function(_0xd2b8fd){const _0x461c88=_0x25b145;if(_0xd2b8fd)return _0x24fe66=_0xd2b8fd,_0x23dc19['model']=_[_0x461c88(0x183)](db[_0x461c88(0x184)][_0x461c88(0x17a)]),_0x23dc19[_0x461c88(0x16b)]=_[_0x461c88(0x183)](_0x2f98b0[_0x461c88(0x16b)]),_0x23dc19['filters']=_[_0x461c88(0x180)](_0x23dc19[_0x461c88(0x17f)],_0x23dc19['query']),_0x1ffcfa[_0x461c88(0x18b)]=_['intersection'](_0x23dc19['model'],qs[_0x461c88(0x179)](_0x2f98b0['query'][_0x461c88(0x179)])),_0x1ffcfa[_0x461c88(0x18b)]=_0x1ffcfa[_0x461c88(0x18b)][_0x461c88(0x172)]?_0x1ffcfa[_0x461c88(0x18b)]:_0x23dc19[_0x461c88(0x17f)],_0x1ffcfa[_0x461c88(0x168)]=qs[_0x461c88(0x17c)](_0x2f98b0['query'][_0x461c88(0x17c)]),_0x1ffcfa[_0x461c88(0x161)]=qs[_0x461c88(0x16f)](_['pick'](_0x2f98b0[_0x461c88(0x16b)],_0x23dc19[_0x461c88(0x16f)])),_0x2f98b0[_0x461c88(0x16b)][_0x461c88(0x171)]&&(_0x1ffcfa['where']=_['merge'](_0x1ffcfa[_0x461c88(0x161)],{[Op['or']]:_[_0x461c88(0x177)](_0x1ffcfa[_0x461c88(0x18b)],function(_0x167844){const _0x22f6fc=_0x461c88,_0x375b9a={};return _0x375b9a[_0x167844]={[Op[_0x22f6fc(0x193)]]:'%'+_0x2f98b0[_0x22f6fc(0x16b)][_0x22f6fc(0x171)]+'%'},_0x375b9a;})})),_0x1ffcfa=_['merge']({},_0x1ffcfa,_0x2f98b0[_0x461c88(0x162)]),_0x24fe66['getSubjects'](_0x1ffcfa);})[_0x25b145(0x16d)](function(_0x10b4c0){const _0x28fa3b=_0x25b145;if(_0x10b4c0)return _0x708975=_0x10b4c0[_0x28fa3b(0x172)],typeof _0x2f98b0[_0x28fa3b(0x16b)][_0x28fa3b(0x160)]===_0x28fa3b(0x186)&&(_0x1ffcfa[_0x28fa3b(0x167)]=qs[_0x28fa3b(0x167)](_0x2f98b0['query'][_0x28fa3b(0x167)]),_0x1ffcfa[_0x28fa3b(0x181)]=qs[_0x28fa3b(0x181)](_0x2f98b0[_0x28fa3b(0x16b)][_0x28fa3b(0x181)])),_0x24fe66[_0x28fa3b(0x165)](_0x1ffcfa);})[_0x25b145(0x16d)](function(_0x13bc58){if(_0x13bc58)return _0x13bc58?{'count':_0x708975,'rows':_0x13bc58}:null;})[_0x25b145(0x16d)](respondWithResult(_0x36038e,null))[_0x25b145(0x18c)](handleError(_0x36038e,null));},exports['getDescriptions']=function(_0x417ca1,_0x36e27d){const _0x4a224a=a374_0x2361b9;let _0x1e0924={};const _0x46480a={};let _0x56a860,_0x5988b3;return db[_0x4a224a(0x189)]['findOne']({'where':{'id':_0x417ca1[_0x4a224a(0x178)]['id']}})[_0x4a224a(0x16d)](handleEntityNotFound(_0x36e27d,null))[_0x4a224a(0x16d)](function(_0x3ec804){const _0x4ed599=_0x4a224a;if(_0x3ec804)return _0x56a860=_0x3ec804,_0x46480a['model']=_[_0x4ed599(0x183)](db[_0x4ed599(0x184)]['rawAttributes']),_0x46480a[_0x4ed599(0x16b)]=_[_0x4ed599(0x183)](_0x417ca1[_0x4ed599(0x16b)]),_0x46480a[_0x4ed599(0x16f)]=_[_0x4ed599(0x180)](_0x46480a[_0x4ed599(0x17f)],_0x46480a['query']),_0x1e0924[_0x4ed599(0x18b)]=_[_0x4ed599(0x180)](_0x46480a[_0x4ed599(0x17f)],qs[_0x4ed599(0x179)](_0x417ca1[_0x4ed599(0x16b)][_0x4ed599(0x179)])),_0x1e0924['attributes']=_0x1e0924[_0x4ed599(0x18b)][_0x4ed599(0x172)]?_0x1e0924['attributes']:_0x46480a[_0x4ed599(0x17f)],_0x1e0924[_0x4ed599(0x168)]=qs[_0x4ed599(0x17c)](_0x417ca1[_0x4ed599(0x16b)][_0x4ed599(0x17c)]),_0x1e0924[_0x4ed599(0x161)]=qs[_0x4ed599(0x16f)](_['pick'](_0x417ca1[_0x4ed599(0x16b)],_0x46480a[_0x4ed599(0x16f)])),_0x417ca1[_0x4ed599(0x16b)][_0x4ed599(0x171)]&&(_0x1e0924[_0x4ed599(0x161)]=_[_0x4ed599(0x188)](_0x1e0924[_0x4ed599(0x161)],{[Op['or']]:_[_0x4ed599(0x177)](_0x1e0924[_0x4ed599(0x18b)],function(_0x4474fc){const _0x306502=_0x4ed599,_0xed1d95={};return _0xed1d95[_0x4474fc]={[Op['like']]:'%'+_0x417ca1[_0x306502(0x16b)][_0x306502(0x171)]+'%'},_0xed1d95;})})),_0x1e0924=_['merge']({},_0x1e0924,_0x417ca1[_0x4ed599(0x162)]),_0x56a860['getDescriptions'](_0x1e0924);})[_0x4a224a(0x16d)](function(_0x172e89){const _0x12baa4=_0x4a224a;if(_0x172e89)return _0x5988b3=_0x172e89[_0x12baa4(0x172)],typeof _0x417ca1[_0x12baa4(0x16b)][_0x12baa4(0x160)]===_0x12baa4(0x186)&&(_0x1e0924[_0x12baa4(0x167)]=qs[_0x12baa4(0x167)](_0x417ca1[_0x12baa4(0x16b)][_0x12baa4(0x167)]),_0x1e0924[_0x12baa4(0x181)]=qs['offset'](_0x417ca1[_0x12baa4(0x16b)][_0x12baa4(0x181)])),_0x56a860[_0x12baa4(0x174)](_0x1e0924);})['then'](function(_0x15418a){if(_0x15418a)return _0x15418a?{'count':_0x5988b3,'rows':_0x15418a}:null;})[_0x4a224a(0x16d)](respondWithResult(_0x36e27d,null))[_0x4a224a(0x18c)](handleError(_0x36e27d,null));};
\ No newline at end of file
+const a374_0x5499=['body','api','merge','nolimit','stack','length','update','sequelize','rawAttributes','then','undefined','limit','findAll','fields','end','create','Content-Range','send','include','query','map','like','../../components/parsers/qs','error','../../config/logger','catch','getSubjects','filters','attributes','filter','set','pick','findOne','key','status','params','destroy','where','getDescriptions','offset','includeAll','name','rows','sort','show','type','SugarcrmConfiguration','options','count','index','getFields','../../mysqldb','model','keys','order','SugarcrmField','intersection'];(function(_0x58852e,_0x4e8913){const _0x549987=function(_0x1d4978){while(--_0x1d4978){_0x58852e['push'](_0x58852e['shift']());}};_0x549987(++_0x4e8913);}(a374_0x5499,0xac));const a374_0x1d49=function(_0x58852e,_0x4e8913){_0x58852e=_0x58852e-0x90;let _0x549987=a374_0x5499[_0x58852e];return _0x549987;};const a374_0x502cfd=a374_0x1d49;'use strict';const _=require('lodash'),qs=require(a374_0x502cfd(0xa5)),logger=require(a374_0x502cfd(0xa7))(a374_0x502cfd(0x90)),{db}=require(a374_0x502cfd(0xc2)),{Op}=require(a374_0x502cfd(0x96));function respondWithResult(_0x5b24e8,_0xc6d410){return _0xc6d410=_0xc6d410||0xc8,function(_0x4f5fbb){const _0x4c659a=a374_0x1d49;if(_0x4f5fbb)return _0x5b24e8[_0x4c659a(0xb1)](_0xc6d410)['json'](_0x4f5fbb);};}function respondWithFilteredResult(_0x501f60,_0x5f34de){return function(_0x29566f){const _0x8d43e9=a374_0x1d49;if(_0x29566f){const _0x24b55c=_0x29566f[_0x8d43e9(0xbf)],_0x2ad5b4=_0x5f34de['offset'];let _0xeff3db=_0x5f34de['offset']+_0x5f34de[_0x8d43e9(0x9a)],_0x36064b;return _0xeff3db>=_0x24b55c?(_0xeff3db=_0x24b55c,_0x36064b=0xc8):_0x36064b=0xce,_0x501f60['status'](_0x36064b),_0x501f60[_0x8d43e9(0xad)](_0x8d43e9(0x9f),_0x2ad5b4+'-'+_0xeff3db+'/'+_0x24b55c)['json'](_0x29566f);}return null;};}function saveUpdates(_0x125673){return function(_0x41688c){const _0x10c000=a374_0x1d49;if(_0x41688c)return _0x41688c[_0x10c000(0x95)](_0x125673)[_0x10c000(0x98)](function(_0x15504c){return _0x15504c;});return null;};}function removeEntity(_0x32491c){return function(_0x27a38c){const _0xf2a230=a374_0x1d49;if(_0x27a38c)return _0x27a38c[_0xf2a230(0xb3)]()[_0xf2a230(0x98)](function(){const _0x26df03=_0xf2a230;_0x32491c[_0x26df03(0xb1)](0xcc)[_0x26df03(0x9d)]();});};}function handleEntityNotFound(_0x4a27d3){return function(_0x4d5433){return!_0x4d5433&&_0x4a27d3['sendStatus'](0x194),_0x4d5433;};}function handleError(_0x43e289,_0x41035f){return _0x41035f=_0x41035f||0x1f4,function(_0x3a87d8){const _0x234521=a374_0x1d49;logger[_0x234521(0xa6)](_0x3a87d8[_0x234521(0x93)]),_0x3a87d8[_0x234521(0xb8)]&&delete _0x3a87d8['name'],_0x43e289[_0x234521(0xb1)](_0x41035f)[_0x234521(0xa0)](_0x3a87d8);};}exports[a374_0x502cfd(0xc0)]=function(_0x14344a,_0x1e81fd){const _0x35d5fd=a374_0x502cfd;let _0x54324b={};const _0x41f3b6={},_0x87ffbb={'count':0x0,'rows':[]},_0xbcab47=_['map'](db[_0x35d5fd(0xbd)]['rawAttributes'],function(_0x317658){const _0xfe1df=_0x35d5fd;return{'name':_0x317658['fieldName'],'type':_0x317658[_0xfe1df(0xbc)][_0xfe1df(0xb0)]};});_0x41f3b6['model']=_[_0x35d5fd(0xa3)](_0xbcab47,_0x35d5fd(0xb8)),_0x41f3b6[_0x35d5fd(0xa2)]=_[_0x35d5fd(0xc4)](_0x14344a[_0x35d5fd(0xa2)]),_0x41f3b6[_0x35d5fd(0xaa)]=_['intersection'](_0x41f3b6[_0x35d5fd(0xc3)],_0x41f3b6['query']),_0x54324b[_0x35d5fd(0xab)]=_[_0x35d5fd(0xc7)](_0x41f3b6[_0x35d5fd(0xc3)],qs[_0x35d5fd(0x9c)](_0x14344a[_0x35d5fd(0xa2)][_0x35d5fd(0x9c)])),_0x54324b[_0x35d5fd(0xab)]=_0x54324b[_0x35d5fd(0xab)][_0x35d5fd(0x94)]?_0x54324b[_0x35d5fd(0xab)]:_0x41f3b6[_0x35d5fd(0xc3)];typeof _0x14344a[_0x35d5fd(0xa2)][_0x35d5fd(0x92)]==='undefined'&&(_0x54324b['limit']=qs[_0x35d5fd(0x9a)](_0x14344a[_0x35d5fd(0xa2)]['limit']),_0x54324b['offset']=qs[_0x35d5fd(0xb6)](_0x14344a[_0x35d5fd(0xa2)][_0x35d5fd(0xb6)]));_0x54324b['order']=qs[_0x35d5fd(0xba)](_0x14344a[_0x35d5fd(0xa2)][_0x35d5fd(0xba)]),_0x54324b[_0x35d5fd(0xb4)]=qs[_0x35d5fd(0xaa)](_[_0x35d5fd(0xae)](_0x14344a[_0x35d5fd(0xa2)],_0x41f3b6[_0x35d5fd(0xaa)]),_0xbcab47);_0x14344a['query'][_0x35d5fd(0xac)]&&(_0x54324b[_0x35d5fd(0xb4)]=_[_0x35d5fd(0x91)](_0x54324b[_0x35d5fd(0xb4)],{[Op['or']]:_[_0x35d5fd(0xa3)](_0xbcab47,function(_0x2a7588){const _0x51fe73=_0x35d5fd;if(_0x2a7588[_0x51fe73(0xbc)]!=='VIRTUAL'){const _0x448231={};return _0x448231[_0x2a7588['name']]={[Op[_0x51fe73(0xa4)]]:'%'+_0x14344a[_0x51fe73(0xa2)][_0x51fe73(0xac)]+'%'},_0x448231;}})}));_0x54324b=_['merge']({},_0x54324b,_0x14344a[_0x35d5fd(0xbe)]);const _0x5787c2={'where':_0x54324b[_0x35d5fd(0xb4)]};return db[_0x35d5fd(0xbd)][_0x35d5fd(0xbf)](_0x5787c2)['then'](function(_0x1dc305){const _0x303e01=_0x35d5fd;return _0x87ffbb[_0x303e01(0xbf)]=_0x1dc305,_0x14344a[_0x303e01(0xa2)][_0x303e01(0xb7)]&&(_0x54324b[_0x303e01(0xa1)]=[{'all':!![]}]),db[_0x303e01(0xbd)][_0x303e01(0x9b)](_0x54324b);})['then'](function(_0x3a897d){const _0x2276ce=_0x35d5fd;return _0x87ffbb[_0x2276ce(0xb9)]=_0x3a897d,_0x87ffbb;})[_0x35d5fd(0x98)](respondWithFilteredResult(_0x1e81fd,_0x54324b))['catch'](handleError(_0x1e81fd,null));},exports[a374_0x502cfd(0xbb)]=function(_0x1517ed,_0x34abc0){const _0x33eed7=a374_0x502cfd;let _0xa32059={'raw':![],'where':{'id':_0x1517ed[_0x33eed7(0xb2)]['id']}};const _0x18b08a={};return _0x18b08a[_0x33eed7(0xc3)]=_[_0x33eed7(0xc4)](db[_0x33eed7(0xbd)][_0x33eed7(0x97)]),_0x18b08a[_0x33eed7(0xa2)]=_[_0x33eed7(0xc4)](_0x1517ed['query']),_0x18b08a[_0x33eed7(0xaa)]=_[_0x33eed7(0xc7)](_0x18b08a[_0x33eed7(0xc3)],_0x18b08a[_0x33eed7(0xa2)]),_0xa32059[_0x33eed7(0xab)]=_['intersection'](_0x18b08a['model'],qs[_0x33eed7(0x9c)](_0x1517ed[_0x33eed7(0xa2)][_0x33eed7(0x9c)])),_0xa32059[_0x33eed7(0xab)]=_0xa32059[_0x33eed7(0xab)][_0x33eed7(0x94)]?_0xa32059[_0x33eed7(0xab)]:_0x18b08a[_0x33eed7(0xc3)],_0x1517ed[_0x33eed7(0xa2)]['includeAll']&&(_0xa32059[_0x33eed7(0xa1)]=[{'all':!![]}]),_0xa32059=_['merge']({},_0xa32059,_0x1517ed['options']),db[_0x33eed7(0xbd)][_0x33eed7(0xaf)](_0xa32059)['then'](handleEntityNotFound(_0x34abc0,null))[_0x33eed7(0x98)](respondWithResult(_0x34abc0,null))[_0x33eed7(0xa8)](handleError(_0x34abc0,null));},exports[a374_0x502cfd(0x9e)]=function(_0x8659a0,_0x14d3da){const _0x3b6e3c=a374_0x502cfd;return db[_0x3b6e3c(0xbd)][_0x3b6e3c(0x9e)](_0x8659a0[_0x3b6e3c(0xc8)],{})[_0x3b6e3c(0x98)](respondWithResult(_0x14d3da,0xc9))[_0x3b6e3c(0xa8)](handleError(_0x14d3da,null));},exports[a374_0x502cfd(0x95)]=function(_0x1b6767,_0xe070b0){const _0x740c71=a374_0x502cfd;return _0x1b6767[_0x740c71(0xc8)]['id']&&delete _0x1b6767['body']['id'],db[_0x740c71(0xbd)][_0x740c71(0xaf)]({'where':{'id':_0x1b6767['params']['id']}})['then'](handleEntityNotFound(_0xe070b0,null))[_0x740c71(0x98)](saveUpdates(_0x1b6767[_0x740c71(0xc8)],null))['then'](respondWithResult(_0xe070b0,null))[_0x740c71(0xa8)](handleError(_0xe070b0,null));},exports['destroy']=function(_0x488066,_0x5daf7e){const _0x35f7d4=a374_0x502cfd;return db[_0x35f7d4(0xbd)]['findOne']({'where':{'id':_0x488066[_0x35f7d4(0xb2)]['id']}})[_0x35f7d4(0x98)](handleEntityNotFound(_0x5daf7e,null))['then'](removeEntity(_0x5daf7e,null))['catch'](handleError(_0x5daf7e,null));},exports[a374_0x502cfd(0xc1)]=function(_0x14eb46,_0x2701e1){const _0x5eb4f9=a374_0x502cfd;let _0x10e809={};const _0x5b7be7={};let _0x348ab2,_0x3eb1f8;return db[_0x5eb4f9(0xbd)][_0x5eb4f9(0xaf)]({'where':{'id':_0x14eb46[_0x5eb4f9(0xb2)]['id']}})[_0x5eb4f9(0x98)](handleEntityNotFound(_0x2701e1,null))[_0x5eb4f9(0x98)](function(_0x429ce9){const _0x36bdec=_0x5eb4f9;if(_0x429ce9)return _0x348ab2=_0x429ce9,_0x5b7be7[_0x36bdec(0xc3)]=_[_0x36bdec(0xc4)](db[_0x36bdec(0xc6)][_0x36bdec(0x97)]),_0x5b7be7[_0x36bdec(0xa2)]=_['keys'](_0x14eb46[_0x36bdec(0xa2)]),_0x5b7be7[_0x36bdec(0xaa)]=_['intersection'](_0x5b7be7[_0x36bdec(0xc3)],_0x5b7be7[_0x36bdec(0xa2)]),_0x10e809['attributes']=_[_0x36bdec(0xc7)](_0x5b7be7[_0x36bdec(0xc3)],qs['fields'](_0x14eb46[_0x36bdec(0xa2)][_0x36bdec(0x9c)])),_0x10e809[_0x36bdec(0xab)]=_0x10e809['attributes']['length']?_0x10e809[_0x36bdec(0xab)]:_0x5b7be7[_0x36bdec(0xc3)],_0x10e809['order']=qs['sort'](_0x14eb46[_0x36bdec(0xa2)]['sort']),_0x10e809[_0x36bdec(0xb4)]=qs[_0x36bdec(0xaa)](_[_0x36bdec(0xae)](_0x14eb46[_0x36bdec(0xa2)],_0x5b7be7[_0x36bdec(0xaa)])),_0x14eb46[_0x36bdec(0xa2)][_0x36bdec(0xac)]&&(_0x10e809[_0x36bdec(0xb4)]=_['merge'](_0x10e809[_0x36bdec(0xb4)],{[Op['or']]:_[_0x36bdec(0xa3)](_0x10e809['attributes'],function(_0x1be4de){const _0x14a1ff=_0x36bdec,_0x3d8c22={};return _0x3d8c22[_0x1be4de]={[Op['like']]:'%'+_0x14eb46['query'][_0x14a1ff(0xac)]+'%'},_0x3d8c22;})})),_0x10e809=_['merge']({},_0x10e809,_0x14eb46[_0x36bdec(0xbe)]),_0x348ab2[_0x36bdec(0xc1)](_0x10e809);})[_0x5eb4f9(0x98)](function(_0x51a295){const _0x1aa14f=_0x5eb4f9;if(_0x51a295)return _0x3eb1f8=_0x51a295[_0x1aa14f(0x94)],typeof _0x14eb46[_0x1aa14f(0xa2)][_0x1aa14f(0x92)]===_0x1aa14f(0x99)&&(_0x10e809[_0x1aa14f(0x9a)]=qs[_0x1aa14f(0x9a)](_0x14eb46[_0x1aa14f(0xa2)][_0x1aa14f(0x9a)]),_0x10e809[_0x1aa14f(0xb6)]=qs[_0x1aa14f(0xb6)](_0x14eb46['query'][_0x1aa14f(0xb6)])),_0x348ab2[_0x1aa14f(0xc1)](_0x10e809);})[_0x5eb4f9(0x98)](function(_0x21036c){if(_0x21036c)return _0x21036c?{'count':_0x3eb1f8,'rows':_0x21036c}:null;})[_0x5eb4f9(0x98)](respondWithResult(_0x2701e1,null))[_0x5eb4f9(0xa8)](handleError(_0x2701e1,null));},exports[a374_0x502cfd(0xa9)]=function(_0x212dbe,_0x444c2d){const _0xa9295a=a374_0x502cfd;let _0x32e3e6={};const _0x9b143f={};let _0x3283eb,_0x2d74d8;return db['SugarcrmConfiguration'][_0xa9295a(0xaf)]({'where':{'id':_0x212dbe[_0xa9295a(0xb2)]['id']}})['then'](handleEntityNotFound(_0x444c2d,null))['then'](function(_0x10f5fe){const _0x5263a7=_0xa9295a;if(_0x10f5fe)return _0x3283eb=_0x10f5fe,_0x9b143f['model']=_[_0x5263a7(0xc4)](db['SugarcrmField'][_0x5263a7(0x97)]),_0x9b143f[_0x5263a7(0xa2)]=_['keys'](_0x212dbe[_0x5263a7(0xa2)]),_0x9b143f[_0x5263a7(0xaa)]=_[_0x5263a7(0xc7)](_0x9b143f[_0x5263a7(0xc3)],_0x9b143f[_0x5263a7(0xa2)]),_0x32e3e6[_0x5263a7(0xab)]=_[_0x5263a7(0xc7)](_0x9b143f[_0x5263a7(0xc3)],qs[_0x5263a7(0x9c)](_0x212dbe[_0x5263a7(0xa2)]['fields'])),_0x32e3e6[_0x5263a7(0xab)]=_0x32e3e6['attributes']['length']?_0x32e3e6[_0x5263a7(0xab)]:_0x9b143f[_0x5263a7(0xc3)],_0x32e3e6[_0x5263a7(0xc5)]=qs[_0x5263a7(0xba)](_0x212dbe[_0x5263a7(0xa2)]['sort']),_0x32e3e6[_0x5263a7(0xb4)]=qs[_0x5263a7(0xaa)](_[_0x5263a7(0xae)](_0x212dbe[_0x5263a7(0xa2)],_0x9b143f[_0x5263a7(0xaa)])),_0x212dbe[_0x5263a7(0xa2)][_0x5263a7(0xac)]&&(_0x32e3e6[_0x5263a7(0xb4)]=_[_0x5263a7(0x91)](_0x32e3e6[_0x5263a7(0xb4)],{[Op['or']]:_['map'](_0x32e3e6[_0x5263a7(0xab)],function(_0x214327){const _0x13b123=_0x5263a7,_0x2888e6={};return _0x2888e6[_0x214327]={[Op[_0x13b123(0xa4)]]:'%'+_0x212dbe['query']['filter']+'%'},_0x2888e6;})})),_0x32e3e6=_[_0x5263a7(0x91)]({},_0x32e3e6,_0x212dbe[_0x5263a7(0xbe)]),_0x3283eb[_0x5263a7(0xa9)](_0x32e3e6);})[_0xa9295a(0x98)](function(_0x58b851){const _0x4a9f9e=_0xa9295a;if(_0x58b851)return _0x2d74d8=_0x58b851[_0x4a9f9e(0x94)],typeof _0x212dbe[_0x4a9f9e(0xa2)]['nolimit']==='undefined'&&(_0x32e3e6[_0x4a9f9e(0x9a)]=qs['limit'](_0x212dbe[_0x4a9f9e(0xa2)]['limit']),_0x32e3e6[_0x4a9f9e(0xb6)]=qs[_0x4a9f9e(0xb6)](_0x212dbe[_0x4a9f9e(0xa2)][_0x4a9f9e(0xb6)])),_0x3283eb[_0x4a9f9e(0xa9)](_0x32e3e6);})[_0xa9295a(0x98)](function(_0x3fe63c){if(_0x3fe63c)return _0x3fe63c?{'count':_0x2d74d8,'rows':_0x3fe63c}:null;})[_0xa9295a(0x98)](respondWithResult(_0x444c2d,null))[_0xa9295a(0xa8)](handleError(_0x444c2d,null));},exports['getDescriptions']=function(_0x1c19db,_0x289731){const _0x282ec3=a374_0x502cfd;let _0x26342a={};const _0x31c023={};let _0x52e20d,_0x388167;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x1c19db[_0x282ec3(0xb2)]['id']}})[_0x282ec3(0x98)](handleEntityNotFound(_0x289731,null))['then'](function(_0x131835){const _0x4d7198=_0x282ec3;if(_0x131835)return _0x52e20d=_0x131835,_0x31c023[_0x4d7198(0xc3)]=_[_0x4d7198(0xc4)](db[_0x4d7198(0xc6)][_0x4d7198(0x97)]),_0x31c023[_0x4d7198(0xa2)]=_[_0x4d7198(0xc4)](_0x1c19db[_0x4d7198(0xa2)]),_0x31c023[_0x4d7198(0xaa)]=_[_0x4d7198(0xc7)](_0x31c023[_0x4d7198(0xc3)],_0x31c023[_0x4d7198(0xa2)]),_0x26342a[_0x4d7198(0xab)]=_[_0x4d7198(0xc7)](_0x31c023['model'],qs[_0x4d7198(0x9c)](_0x1c19db[_0x4d7198(0xa2)][_0x4d7198(0x9c)])),_0x26342a['attributes']=_0x26342a[_0x4d7198(0xab)]['length']?_0x26342a['attributes']:_0x31c023[_0x4d7198(0xc3)],_0x26342a[_0x4d7198(0xc5)]=qs[_0x4d7198(0xba)](_0x1c19db['query'][_0x4d7198(0xba)]),_0x26342a[_0x4d7198(0xb4)]=qs['filters'](_['pick'](_0x1c19db[_0x4d7198(0xa2)],_0x31c023[_0x4d7198(0xaa)])),_0x1c19db[_0x4d7198(0xa2)][_0x4d7198(0xac)]&&(_0x26342a[_0x4d7198(0xb4)]=_[_0x4d7198(0x91)](_0x26342a[_0x4d7198(0xb4)],{[Op['or']]:_['map'](_0x26342a[_0x4d7198(0xab)],function(_0x502e2a){const _0x4437ed=_0x4d7198,_0x494bca={};return _0x494bca[_0x502e2a]={[Op[_0x4437ed(0xa4)]]:'%'+_0x1c19db[_0x4437ed(0xa2)]['filter']+'%'},_0x494bca;})})),_0x26342a=_['merge']({},_0x26342a,_0x1c19db[_0x4d7198(0xbe)]),_0x52e20d[_0x4d7198(0xb5)](_0x26342a);})[_0x282ec3(0x98)](function(_0x2a7451){const _0x2b87a2=_0x282ec3;if(_0x2a7451)return _0x388167=_0x2a7451[_0x2b87a2(0x94)],typeof _0x1c19db['query'][_0x2b87a2(0x92)]===_0x2b87a2(0x99)&&(_0x26342a[_0x2b87a2(0x9a)]=qs[_0x2b87a2(0x9a)](_0x1c19db[_0x2b87a2(0xa2)][_0x2b87a2(0x9a)]),_0x26342a[_0x2b87a2(0xb6)]=qs['offset'](_0x1c19db['query'][_0x2b87a2(0xb6)])),_0x52e20d[_0x2b87a2(0xb5)](_0x26342a);})[_0x282ec3(0x98)](function(_0x1d6fd1){if(_0x1d6fd1)return _0x1d6fd1?{'count':_0x388167,'rows':_0x1d6fd1}:null;})['then'](respondWithResult(_0x289731,null))['catch'](handleError(_0x289731,null));};
\ No newline at end of file