Built motion from commit f861bcb808219e66da88ba48b61bddb35224a65e. Version 3.0.0...
[motion-next.git] / server / api / intSalesforceConfiguration / intSalesforceConfiguration.controller.js
index 2d8276d..e51a9f2 100644 (file)
@@ -1 +1 @@
-'use strict';const a342_0x1a64=['SalesforceConfiguration','limit','keys','offset','69799HpPAOP','2NjYqUH','error','merge','@mysqldb','catch','create','name','show','rawAttributes','body','update','487plClUZ','fields','map','@config/logger','query','then','findOne','attributes','index','destroy','pick','406984EjBCRa','lodash','getDescriptions','@components/parsers/qs','include','filter','sort','getFields','length','1348FKYsin','258073eUfywE','intersection','includeAll','@utils/filter-attributes','model','fieldName','filters','params','331389HkpjAh','nolimit','where','api','status','62677QmHlcE','end','options','order','Content-Range','1RuvkoV','SalesforceField','getSubjects','json','type','47930DAqSnH','undefined','stack','count'];const a342_0x31ac=function(_0x2be0e8,_0x2d8425){_0x2be0e8=_0x2be0e8-0x18b;let _0x1a64be=a342_0x1a64[_0x2be0e8];return _0x1a64be;};const a342_0x17dfa4=a342_0x31ac;(function(_0x9587e1,_0x4e7fc3){const _0x52c371=a342_0x31ac;while(!![]){try{const _0x1e380f=-parseInt(_0x52c371(0x1c2))*parseInt(_0x52c371(0x1c7))+-parseInt(_0x52c371(0x18c))+parseInt(_0x52c371(0x195))*-parseInt(_0x52c371(0x194))+-parseInt(_0x52c371(0x1bd))+-parseInt(_0x52c371(0x1b5))+parseInt(_0x52c371(0x1ab))+parseInt(_0x52c371(0x1a0))*parseInt(_0x52c371(0x1b4));if(_0x1e380f===_0x4e7fc3)break;else _0x9587e1['push'](_0x9587e1['shift']());}catch(_0x5be642){_0x9587e1['push'](_0x9587e1['shift']());}}}(a342_0x1a64,0x36a31));const _=require(a342_0x17dfa4(0x1ac)),qs=require(a342_0x17dfa4(0x1ae)),logger=require(a342_0x17dfa4(0x1a3))(a342_0x17dfa4(0x1c0)),{db}=require(a342_0x17dfa4(0x198)),{filterAttributes}=require(a342_0x17dfa4(0x1b8));function respondWithResult(_0x4e974b,_0x520440){return _0x520440=_0x520440||0xc8,function(_0x3b61b4){const _0x4289af=a342_0x31ac;if(_0x3b61b4)return _0x4e974b[_0x4289af(0x1c1)](_0x520440)['json'](_0x3b61b4);};}function respondWithFilteredResult(_0x3cfbd9,_0x2fb483){return function(_0x16c5a3){const _0x53faa6=a342_0x31ac;if(_0x16c5a3){const _0x3abe8b=_0x16c5a3['count'],_0x233887=_0x2fb483[_0x53faa6(0x193)];let _0x17e5c8=_0x2fb483['offset']+_0x2fb483[_0x53faa6(0x191)],_0x457c93;return _0x17e5c8>=_0x3abe8b?(_0x17e5c8=_0x3abe8b,_0x457c93=0xc8):_0x457c93=0xce,_0x3cfbd9[_0x53faa6(0x1c1)](_0x457c93),_0x3cfbd9['set'](_0x53faa6(0x1c6),_0x233887+'-'+_0x17e5c8+'/'+_0x3abe8b)[_0x53faa6(0x1ca)](_0x16c5a3);}return null;};}function saveUpdates(_0x4d5d60){return function(_0x4e7d7c){const _0x16c6cb=a342_0x31ac;if(_0x4e7d7c)return _0x4e7d7c[_0x16c6cb(0x19f)](_0x4d5d60)[_0x16c6cb(0x1a5)](function(_0x27e2a9){return _0x27e2a9;});return null;};}function removeEntity(_0x1489bc){return function(_0x512409){const _0x2a863d=a342_0x31ac;if(_0x512409)return _0x512409[_0x2a863d(0x1a9)]()[_0x2a863d(0x1a5)](function(){const _0x561b4f=_0x2a863d;_0x1489bc[_0x561b4f(0x1c1)](0xcc)[_0x561b4f(0x1c3)]();});};}function handleEntityNotFound(_0x3ee413){return function(_0x239e2d){return!_0x239e2d&&_0x3ee413['sendStatus'](0x194),_0x239e2d;};}function handleError(_0x4516ca,_0x20ea7e){return _0x20ea7e=_0x20ea7e||0x1f4,function(_0x2f5d39){const _0x5e11ba=a342_0x31ac;logger[_0x5e11ba(0x196)](_0x2f5d39[_0x5e11ba(0x18e)]),_0x2f5d39[_0x5e11ba(0x19b)]&&delete _0x2f5d39[_0x5e11ba(0x19b)],_0x4516ca[_0x5e11ba(0x1c1)](_0x20ea7e)['send'](_0x2f5d39);};}exports[a342_0x17dfa4(0x1a8)]=function(_0x38cd66,_0x452841){const _0x5e6bff=a342_0x17dfa4;let _0xc46760={};const _0x361ce3={},_0x211379={'count':0x0,'rows':[]},_0x5c56c4=_[_0x5e6bff(0x1a2)](db['SalesforceConfiguration'][_0x5e6bff(0x19d)],function(_0x23bff8){const _0xdd264=_0x5e6bff;return{'name':_0x23bff8[_0xdd264(0x1ba)],'type':_0x23bff8[_0xdd264(0x18b)]['key']};});_0x361ce3[_0x5e6bff(0x1b9)]=_[_0x5e6bff(0x1a2)](_0x5c56c4,_0x5e6bff(0x19b)),_0x361ce3[_0x5e6bff(0x1a4)]=_['keys'](_0x38cd66[_0x5e6bff(0x1a4)]),_0x361ce3[_0x5e6bff(0x1bb)]=_[_0x5e6bff(0x1b6)](_0x361ce3[_0x5e6bff(0x1b9)],_0x361ce3['query']),_0xc46760[_0x5e6bff(0x1a7)]=_[_0x5e6bff(0x1b6)](_0x361ce3['model'],qs[_0x5e6bff(0x1a1)](_0x38cd66['query'][_0x5e6bff(0x1a1)])),_0xc46760[_0x5e6bff(0x1a7)]=_0xc46760['attributes'][_0x5e6bff(0x1b3)]?_0xc46760[_0x5e6bff(0x1a7)]:_0x361ce3['model'];typeof _0x38cd66[_0x5e6bff(0x1a4)][_0x5e6bff(0x1be)]===_0x5e6bff(0x18d)&&(_0xc46760[_0x5e6bff(0x191)]=qs['limit'](_0x38cd66[_0x5e6bff(0x1a4)]['limit']),_0xc46760[_0x5e6bff(0x193)]=qs[_0x5e6bff(0x193)](_0x38cd66['query'][_0x5e6bff(0x193)]));_0xc46760[_0x5e6bff(0x1c5)]=qs[_0x5e6bff(0x1b1)](_0x38cd66[_0x5e6bff(0x1a4)][_0x5e6bff(0x1b1)]),_0xc46760[_0x5e6bff(0x1bf)]=qs[_0x5e6bff(0x1bb)](_[_0x5e6bff(0x1aa)](_0x38cd66[_0x5e6bff(0x1a4)],_0x361ce3[_0x5e6bff(0x1bb)]),_0x5c56c4),_0xc46760=filterAttributes(_0xc46760,_0x38cd66[_0x5e6bff(0x1a4)][_0x5e6bff(0x1b0)],_0x5c56c4,_0x38cd66[_0x5e6bff(0x1c4)]);const _0x18e77c={'where':_0xc46760[_0x5e6bff(0x1bf)]};return db[_0x5e6bff(0x190)][_0x5e6bff(0x18f)](_0x18e77c)[_0x5e6bff(0x1a5)](function(_0x5cc8b3){const _0x459d56=_0x5e6bff;return _0x211379['count']=_0x5cc8b3,_0x38cd66[_0x459d56(0x1a4)]['includeAll']&&(_0xc46760[_0x459d56(0x1af)]=[{'all':!![]}]),db[_0x459d56(0x190)]['findAll'](_0xc46760);})['then'](function(_0x1673a1){return _0x211379['rows']=_0x1673a1,_0x211379;})['then'](respondWithFilteredResult(_0x452841,_0xc46760))[_0x5e6bff(0x199)](handleError(_0x452841,null));},exports[a342_0x17dfa4(0x19c)]=function(_0x2a1396,_0x37e17a){const _0x1e5403=a342_0x17dfa4;let _0x3fdc5c={'raw':![],'where':{'id':_0x2a1396[_0x1e5403(0x1bc)]['id']}};const _0x37b408={};return _0x37b408[_0x1e5403(0x1b9)]=_[_0x1e5403(0x192)](db[_0x1e5403(0x190)]['rawAttributes']),_0x37b408[_0x1e5403(0x1a4)]=_['keys'](_0x2a1396['query']),_0x37b408[_0x1e5403(0x1bb)]=_['intersection'](_0x37b408[_0x1e5403(0x1b9)],_0x37b408[_0x1e5403(0x1a4)]),_0x3fdc5c[_0x1e5403(0x1a7)]=_[_0x1e5403(0x1b6)](_0x37b408['model'],qs['fields'](_0x2a1396['query'][_0x1e5403(0x1a1)])),_0x3fdc5c[_0x1e5403(0x1a7)]=_0x3fdc5c[_0x1e5403(0x1a7)][_0x1e5403(0x1b3)]?_0x3fdc5c[_0x1e5403(0x1a7)]:_0x37b408[_0x1e5403(0x1b9)],_0x2a1396[_0x1e5403(0x1a4)][_0x1e5403(0x1b7)]&&(_0x3fdc5c[_0x1e5403(0x1af)]=[{'all':!![]}]),_0x3fdc5c=_[_0x1e5403(0x197)]({},_0x3fdc5c,_0x2a1396[_0x1e5403(0x1c4)]),db[_0x1e5403(0x190)][_0x1e5403(0x1a6)](_0x3fdc5c)[_0x1e5403(0x1a5)](handleEntityNotFound(_0x37e17a,null))['then'](respondWithResult(_0x37e17a,null))[_0x1e5403(0x199)](handleError(_0x37e17a,null));},exports[a342_0x17dfa4(0x19a)]=function(_0x437042,_0x3da45e){const _0x1dd2a6=a342_0x17dfa4;return db['SalesforceConfiguration']['create'](_0x437042[_0x1dd2a6(0x19e)],{})[_0x1dd2a6(0x1a5)](respondWithResult(_0x3da45e,0xc9))['catch'](handleError(_0x3da45e,null));},exports[a342_0x17dfa4(0x19f)]=function(_0x4c6564,_0x6e9daf){const _0x51220f=a342_0x17dfa4;return _0x4c6564[_0x51220f(0x19e)]['id']&&delete _0x4c6564[_0x51220f(0x19e)]['id'],db[_0x51220f(0x190)]['findOne']({'where':{'id':_0x4c6564[_0x51220f(0x1bc)]['id']}})['then'](handleEntityNotFound(_0x6e9daf,null))[_0x51220f(0x1a5)](saveUpdates(_0x4c6564['body'],null))['then'](respondWithResult(_0x6e9daf,null))['catch'](handleError(_0x6e9daf,null));},exports[a342_0x17dfa4(0x1a9)]=function(_0x4914b4,_0x414f3e){const _0x1010a7=a342_0x17dfa4;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x4914b4[_0x1010a7(0x1bc)]['id']}})[_0x1010a7(0x1a5)](handleEntityNotFound(_0x414f3e,null))[_0x1010a7(0x1a5)](removeEntity(_0x414f3e,null))[_0x1010a7(0x199)](handleError(_0x414f3e,null));},exports['getFields']=function(_0x3fb283,_0x4a9105){const _0x5b4b24=a342_0x17dfa4;let _0x5b81ff={};const _0x23d2f0={};let _0x2e9516,_0x401ddd;return db['SalesforceConfiguration'][_0x5b4b24(0x1a6)]({'where':{'id':_0x3fb283[_0x5b4b24(0x1bc)]['id']}})[_0x5b4b24(0x1a5)](handleEntityNotFound(_0x4a9105,null))[_0x5b4b24(0x1a5)](function(_0x434632){const _0x189310=_0x5b4b24;if(_0x434632)return _0x2e9516=_0x434632,_0x23d2f0[_0x189310(0x1b9)]=_[_0x189310(0x192)](db['SalesforceField']['rawAttributes']),_0x23d2f0[_0x189310(0x1a4)]=_['keys'](_0x3fb283[_0x189310(0x1a4)]),_0x23d2f0[_0x189310(0x1bb)]=_[_0x189310(0x1b6)](_0x23d2f0['model'],_0x23d2f0[_0x189310(0x1a4)]),_0x5b81ff[_0x189310(0x1a7)]=_[_0x189310(0x1b6)](_0x23d2f0[_0x189310(0x1b9)],qs[_0x189310(0x1a1)](_0x3fb283[_0x189310(0x1a4)][_0x189310(0x1a1)])),_0x5b81ff[_0x189310(0x1a7)]=_0x5b81ff[_0x189310(0x1a7)][_0x189310(0x1b3)]?_0x5b81ff[_0x189310(0x1a7)]:_0x23d2f0[_0x189310(0x1b9)],_0x5b81ff['order']=qs['sort'](_0x3fb283[_0x189310(0x1a4)][_0x189310(0x1b1)]),_0x5b81ff['where']=qs[_0x189310(0x1bb)](_[_0x189310(0x1aa)](_0x3fb283['query'],_0x23d2f0[_0x189310(0x1bb)])),_0x5b81ff=filterAttributes(_0x5b81ff,_0x3fb283[_0x189310(0x1a4)]['filter'],_0x5b81ff[_0x189310(0x1a7)],_0x3fb283[_0x189310(0x1c4)],![]),_0x2e9516[_0x189310(0x1b2)](_0x5b81ff);})['then'](function(_0x483192){const _0x1468b6=_0x5b4b24;if(_0x483192)return _0x401ddd=_0x483192[_0x1468b6(0x1b3)],typeof _0x3fb283['query'][_0x1468b6(0x1be)]==='undefined'&&(_0x5b81ff[_0x1468b6(0x191)]=qs[_0x1468b6(0x191)](_0x3fb283[_0x1468b6(0x1a4)][_0x1468b6(0x191)]),_0x5b81ff[_0x1468b6(0x193)]=qs[_0x1468b6(0x193)](_0x3fb283['query']['offset'])),_0x2e9516[_0x1468b6(0x1b2)](_0x5b81ff);})['then'](function(_0x3c6cb1){if(_0x3c6cb1)return _0x3c6cb1?{'count':_0x401ddd,'rows':_0x3c6cb1}:null;})[_0x5b4b24(0x1a5)](respondWithResult(_0x4a9105,null))['catch'](handleError(_0x4a9105,null));},exports[a342_0x17dfa4(0x1c9)]=function(_0x3d7650,_0x175c7e){const _0x924a9c=a342_0x17dfa4;let _0x20aa5c={};const _0x19d5d5={};let _0x3d1fb0,_0x573b68;return db[_0x924a9c(0x190)][_0x924a9c(0x1a6)]({'where':{'id':_0x3d7650[_0x924a9c(0x1bc)]['id']}})[_0x924a9c(0x1a5)](handleEntityNotFound(_0x175c7e,null))['then'](function(_0x111c8f){const _0x39798c=_0x924a9c;if(_0x111c8f)return _0x3d1fb0=_0x111c8f,_0x19d5d5[_0x39798c(0x1b9)]=_[_0x39798c(0x192)](db[_0x39798c(0x1c8)][_0x39798c(0x19d)]),_0x19d5d5[_0x39798c(0x1a4)]=_[_0x39798c(0x192)](_0x3d7650['query']),_0x19d5d5['filters']=_['intersection'](_0x19d5d5[_0x39798c(0x1b9)],_0x19d5d5[_0x39798c(0x1a4)]),_0x20aa5c[_0x39798c(0x1a7)]=_['intersection'](_0x19d5d5[_0x39798c(0x1b9)],qs['fields'](_0x3d7650[_0x39798c(0x1a4)][_0x39798c(0x1a1)])),_0x20aa5c[_0x39798c(0x1a7)]=_0x20aa5c[_0x39798c(0x1a7)][_0x39798c(0x1b3)]?_0x20aa5c[_0x39798c(0x1a7)]:_0x19d5d5['model'],_0x20aa5c[_0x39798c(0x1c5)]=qs[_0x39798c(0x1b1)](_0x3d7650[_0x39798c(0x1a4)][_0x39798c(0x1b1)]),_0x20aa5c[_0x39798c(0x1bf)]=qs[_0x39798c(0x1bb)](_['pick'](_0x3d7650[_0x39798c(0x1a4)],_0x19d5d5['filters'])),_0x20aa5c=filterAttributes(_0x20aa5c,_0x3d7650[_0x39798c(0x1a4)][_0x39798c(0x1b0)],_0x20aa5c['attributes'],_0x3d7650[_0x39798c(0x1c4)],![]),_0x3d1fb0['getSubjects'](_0x20aa5c);})[_0x924a9c(0x1a5)](function(_0x45955b){const _0x384e57=_0x924a9c;if(_0x45955b)return _0x573b68=_0x45955b[_0x384e57(0x1b3)],typeof _0x3d7650[_0x384e57(0x1a4)][_0x384e57(0x1be)]===_0x384e57(0x18d)&&(_0x20aa5c[_0x384e57(0x191)]=qs[_0x384e57(0x191)](_0x3d7650[_0x384e57(0x1a4)]['limit']),_0x20aa5c[_0x384e57(0x193)]=qs[_0x384e57(0x193)](_0x3d7650[_0x384e57(0x1a4)][_0x384e57(0x193)])),_0x3d1fb0['getSubjects'](_0x20aa5c);})['then'](function(_0x42b9c3){if(_0x42b9c3)return _0x42b9c3?{'count':_0x573b68,'rows':_0x42b9c3}:null;})['then'](respondWithResult(_0x175c7e,null))[_0x924a9c(0x199)](handleError(_0x175c7e,null));},exports[a342_0x17dfa4(0x1ad)]=function(_0xf44c04,_0x11d8d5){const _0x302000=a342_0x17dfa4;let _0x1cbe49={};const _0x238d4c={};let _0x442b45,_0x3ceaaf;return db[_0x302000(0x190)][_0x302000(0x1a6)]({'where':{'id':_0xf44c04[_0x302000(0x1bc)]['id']}})['then'](handleEntityNotFound(_0x11d8d5,null))[_0x302000(0x1a5)](function(_0x35dfef){const _0x448f08=_0x302000;if(_0x35dfef)return _0x442b45=_0x35dfef,_0x238d4c[_0x448f08(0x1b9)]=_[_0x448f08(0x192)](db[_0x448f08(0x1c8)][_0x448f08(0x19d)]),_0x238d4c[_0x448f08(0x1a4)]=_[_0x448f08(0x192)](_0xf44c04[_0x448f08(0x1a4)]),_0x238d4c['filters']=_[_0x448f08(0x1b6)](_0x238d4c[_0x448f08(0x1b9)],_0x238d4c['query']),_0x1cbe49['attributes']=_[_0x448f08(0x1b6)](_0x238d4c[_0x448f08(0x1b9)],qs[_0x448f08(0x1a1)](_0xf44c04[_0x448f08(0x1a4)][_0x448f08(0x1a1)])),_0x1cbe49['attributes']=_0x1cbe49[_0x448f08(0x1a7)][_0x448f08(0x1b3)]?_0x1cbe49['attributes']:_0x238d4c[_0x448f08(0x1b9)],_0x1cbe49[_0x448f08(0x1c5)]=qs[_0x448f08(0x1b1)](_0xf44c04[_0x448f08(0x1a4)][_0x448f08(0x1b1)]),_0x1cbe49[_0x448f08(0x1bf)]=qs['filters'](_[_0x448f08(0x1aa)](_0xf44c04[_0x448f08(0x1a4)],_0x238d4c['filters'])),_0x1cbe49=filterAttributes(_0x1cbe49,_0xf44c04[_0x448f08(0x1a4)][_0x448f08(0x1b0)],_0x1cbe49['attributes'],_0xf44c04['options'],![]),_0x442b45[_0x448f08(0x1ad)](_0x1cbe49);})[_0x302000(0x1a5)](function(_0x57d2af){const _0x24768=_0x302000;if(_0x57d2af)return _0x3ceaaf=_0x57d2af[_0x24768(0x1b3)],typeof _0xf44c04[_0x24768(0x1a4)][_0x24768(0x1be)]==='undefined'&&(_0x1cbe49[_0x24768(0x191)]=qs[_0x24768(0x191)](_0xf44c04[_0x24768(0x1a4)][_0x24768(0x191)]),_0x1cbe49['offset']=qs[_0x24768(0x193)](_0xf44c04['query'][_0x24768(0x193)])),_0x442b45[_0x24768(0x1ad)](_0x1cbe49);})[_0x302000(0x1a5)](function(_0x3e0e09){if(_0x3e0e09)return _0x3e0e09?{'count':_0x3ceaaf,'rows':_0x3e0e09}:null;})[_0x302000(0x1a5)](respondWithResult(_0x11d8d5,null))[_0x302000(0x199)](handleError(_0x11d8d5,null));};
\ No newline at end of file
+'use strict';const a342_0x292f=['attributes','status','params','then','findAll','options','update','165jnOkpe','filter','rows','undefined','key','getSubjects','api','3074xbUyIY','count','map','limit','stack','merge','order','send','fields','680413RcaONj','SalesforceField','11480nWqCEV','model','@config/logger','includeAll','179022OnIhGQ','SalesforceConfiguration','26lUTFOY','1sDipEJ','show','json','include','166861jDEjII','index','destroy','101666uzNuRs','name','rawAttributes','pick','where','body','type','offset','452347CSocLU','nolimit','intersection','create','4TXCAmt','@components/parsers/qs','getFields','filters','5rXTGEE','query','sort','catch','keys','length','1WOZXfw','end','getDescriptions','findOne'];const a342_0x5658=function(_0x50c612,_0x2131a8){_0x50c612=_0x50c612-0x164;let _0x292f8e=a342_0x292f[_0x50c612];return _0x292f8e;};const a342_0x30c70c=a342_0x5658;(function(_0x251519,_0x23dac2){const _0xb9bf5b=a342_0x5658;while(!![]){try{const _0x513062=-parseInt(_0xb9bf5b(0x1a3))*parseInt(_0xb9bf5b(0x19a))+parseInt(_0xb9bf5b(0x19c))+parseInt(_0xb9bf5b(0x18a))*parseInt(_0xb9bf5b(0x191))+parseInt(_0xb9bf5b(0x17f))*-parseInt(_0xb9bf5b(0x171))+-parseInt(_0xb9bf5b(0x1a0))*parseInt(_0xb9bf5b(0x175))+-parseInt(_0xb9bf5b(0x179))*parseInt(_0xb9bf5b(0x166))+parseInt(_0xb9bf5b(0x169))*parseInt(_0xb9bf5b(0x1a2));if(_0x513062===_0x23dac2)break;else _0x251519['push'](_0x251519['shift']());}catch(_0x483402){_0x251519['push'](_0x251519['shift']());}}}(a342_0x292f,0x74e85));const _=require('lodash'),qs=require(a342_0x30c70c(0x176)),logger=require(a342_0x30c70c(0x19e))(a342_0x30c70c(0x190)),{db}=require('@mysqldb'),{filterAttributes}=require('@utils/filter-attributes');function respondWithResult(_0x439e00,_0x31e7dc){return _0x31e7dc=_0x31e7dc||0xc8,function(_0x51a8a8){const _0x510c05=a342_0x5658;if(_0x51a8a8)return _0x439e00[_0x510c05(0x184)](_0x31e7dc)['json'](_0x51a8a8);};}function respondWithFilteredResult(_0x54a267,_0x2d693a){return function(_0x4b0d64){const _0x27fe07=a342_0x5658;if(_0x4b0d64){const _0x24a81f=_0x4b0d64[_0x27fe07(0x192)],_0x587aad=_0x2d693a[_0x27fe07(0x170)];let _0x5a9755=_0x2d693a['offset']+_0x2d693a[_0x27fe07(0x194)],_0x1ca8d3;return _0x5a9755>=_0x24a81f?(_0x5a9755=_0x24a81f,_0x1ca8d3=0xc8):_0x1ca8d3=0xce,_0x54a267[_0x27fe07(0x184)](_0x1ca8d3),_0x54a267['set']('Content-Range',_0x587aad+'-'+_0x5a9755+'/'+_0x24a81f)[_0x27fe07(0x164)](_0x4b0d64);}return null;};}function saveUpdates(_0x58ec58){return function(_0x2d1a00){const _0x4e79da=a342_0x5658;if(_0x2d1a00)return _0x2d1a00[_0x4e79da(0x189)](_0x58ec58)[_0x4e79da(0x186)](function(_0x2985e7){return _0x2985e7;});return null;};}function removeEntity(_0x348042){return function(_0x14c3a3){const _0x2861df=a342_0x5658;if(_0x14c3a3)return _0x14c3a3[_0x2861df(0x168)]()['then'](function(){const _0x4096cd=_0x2861df;_0x348042['status'](0xcc)[_0x4096cd(0x180)]();});};}function handleEntityNotFound(_0x1b5d1){return function(_0xbaddf3){return!_0xbaddf3&&_0x1b5d1['sendStatus'](0x194),_0xbaddf3;};}function handleError(_0x55945f,_0x24c102){return _0x24c102=_0x24c102||0x1f4,function(_0xb4f107){const _0x5da975=a342_0x5658;logger['error'](_0xb4f107[_0x5da975(0x195)]),_0xb4f107[_0x5da975(0x16a)]&&delete _0xb4f107[_0x5da975(0x16a)],_0x55945f[_0x5da975(0x184)](_0x24c102)[_0x5da975(0x198)](_0xb4f107);};}exports[a342_0x30c70c(0x167)]=function(_0x17c53c,_0x11a0e0){const _0x3cfde5=a342_0x30c70c;let _0x9636fc={};const _0x504545={},_0x5558d6={'count':0x0,'rows':[]},_0x1b083c=_[_0x3cfde5(0x193)](db[_0x3cfde5(0x1a1)][_0x3cfde5(0x16b)],function(_0x4a2467){const _0x96f24e=_0x3cfde5;return{'name':_0x4a2467['fieldName'],'type':_0x4a2467[_0x96f24e(0x16f)][_0x96f24e(0x18e)]};});_0x504545[_0x3cfde5(0x19d)]=_[_0x3cfde5(0x193)](_0x1b083c,_0x3cfde5(0x16a)),_0x504545['query']=_['keys'](_0x17c53c[_0x3cfde5(0x17a)]),_0x504545[_0x3cfde5(0x178)]=_[_0x3cfde5(0x173)](_0x504545['model'],_0x504545['query']),_0x9636fc[_0x3cfde5(0x183)]=_[_0x3cfde5(0x173)](_0x504545[_0x3cfde5(0x19d)],qs[_0x3cfde5(0x199)](_0x17c53c['query'][_0x3cfde5(0x199)])),_0x9636fc[_0x3cfde5(0x183)]=_0x9636fc[_0x3cfde5(0x183)][_0x3cfde5(0x17e)]?_0x9636fc[_0x3cfde5(0x183)]:_0x504545[_0x3cfde5(0x19d)];typeof _0x17c53c['query'][_0x3cfde5(0x172)]===_0x3cfde5(0x18d)&&(_0x9636fc[_0x3cfde5(0x194)]=qs['limit'](_0x17c53c[_0x3cfde5(0x17a)]['limit']),_0x9636fc[_0x3cfde5(0x170)]=qs[_0x3cfde5(0x170)](_0x17c53c[_0x3cfde5(0x17a)][_0x3cfde5(0x170)]));_0x9636fc['order']=qs[_0x3cfde5(0x17b)](_0x17c53c[_0x3cfde5(0x17a)][_0x3cfde5(0x17b)]),_0x9636fc[_0x3cfde5(0x16d)]=qs[_0x3cfde5(0x178)](_[_0x3cfde5(0x16c)](_0x17c53c[_0x3cfde5(0x17a)],_0x504545[_0x3cfde5(0x178)]),_0x1b083c),_0x9636fc=filterAttributes(_0x9636fc,_0x17c53c[_0x3cfde5(0x17a)][_0x3cfde5(0x18b)],_0x1b083c,_0x17c53c[_0x3cfde5(0x188)]);const _0x289d95={'where':_0x9636fc[_0x3cfde5(0x16d)]};return db[_0x3cfde5(0x1a1)][_0x3cfde5(0x192)](_0x289d95)[_0x3cfde5(0x186)](function(_0x3ba968){const _0x351222=_0x3cfde5;return _0x5558d6[_0x351222(0x192)]=_0x3ba968,_0x17c53c[_0x351222(0x17a)][_0x351222(0x19f)]&&(_0x9636fc['include']=[{'all':!![]}]),db[_0x351222(0x1a1)][_0x351222(0x187)](_0x9636fc);})[_0x3cfde5(0x186)](function(_0x3af35f){const _0x5d6bc4=_0x3cfde5;return _0x5558d6[_0x5d6bc4(0x18c)]=_0x3af35f,_0x5558d6;})[_0x3cfde5(0x186)](respondWithFilteredResult(_0x11a0e0,_0x9636fc))[_0x3cfde5(0x17c)](handleError(_0x11a0e0,null));},exports[a342_0x30c70c(0x1a4)]=function(_0x1cfe39,_0x2c757f){const _0x23281c=a342_0x30c70c;let _0xc81962={'raw':![],'where':{'id':_0x1cfe39[_0x23281c(0x185)]['id']}};const _0x1d5017={};return _0x1d5017['model']=_[_0x23281c(0x17d)](db['SalesforceConfiguration']['rawAttributes']),_0x1d5017[_0x23281c(0x17a)]=_['keys'](_0x1cfe39[_0x23281c(0x17a)]),_0x1d5017[_0x23281c(0x178)]=_[_0x23281c(0x173)](_0x1d5017[_0x23281c(0x19d)],_0x1d5017[_0x23281c(0x17a)]),_0xc81962[_0x23281c(0x183)]=_[_0x23281c(0x173)](_0x1d5017[_0x23281c(0x19d)],qs[_0x23281c(0x199)](_0x1cfe39[_0x23281c(0x17a)][_0x23281c(0x199)])),_0xc81962[_0x23281c(0x183)]=_0xc81962[_0x23281c(0x183)][_0x23281c(0x17e)]?_0xc81962['attributes']:_0x1d5017[_0x23281c(0x19d)],_0x1cfe39[_0x23281c(0x17a)]['includeAll']&&(_0xc81962[_0x23281c(0x165)]=[{'all':!![]}]),_0xc81962=_[_0x23281c(0x196)]({},_0xc81962,_0x1cfe39[_0x23281c(0x188)]),db['SalesforceConfiguration'][_0x23281c(0x182)](_0xc81962)[_0x23281c(0x186)](handleEntityNotFound(_0x2c757f,null))[_0x23281c(0x186)](respondWithResult(_0x2c757f,null))[_0x23281c(0x17c)](handleError(_0x2c757f,null));},exports[a342_0x30c70c(0x174)]=function(_0x3a5d8f,_0xe5df7e){const _0x254ab7=a342_0x30c70c;return db[_0x254ab7(0x1a1)][_0x254ab7(0x174)](_0x3a5d8f['body'],{})['then'](respondWithResult(_0xe5df7e,0xc9))[_0x254ab7(0x17c)](handleError(_0xe5df7e,null));},exports[a342_0x30c70c(0x189)]=function(_0x2efec5,_0x4b5b28){const _0x3fb4bb=a342_0x30c70c;return _0x2efec5[_0x3fb4bb(0x16e)]['id']&&delete _0x2efec5[_0x3fb4bb(0x16e)]['id'],db[_0x3fb4bb(0x1a1)][_0x3fb4bb(0x182)]({'where':{'id':_0x2efec5[_0x3fb4bb(0x185)]['id']}})[_0x3fb4bb(0x186)](handleEntityNotFound(_0x4b5b28,null))['then'](saveUpdates(_0x2efec5[_0x3fb4bb(0x16e)],null))[_0x3fb4bb(0x186)](respondWithResult(_0x4b5b28,null))['catch'](handleError(_0x4b5b28,null));},exports[a342_0x30c70c(0x168)]=function(_0x3da65c,_0x5e389c){const _0x3aa658=a342_0x30c70c;return db[_0x3aa658(0x1a1)][_0x3aa658(0x182)]({'where':{'id':_0x3da65c[_0x3aa658(0x185)]['id']}})[_0x3aa658(0x186)](handleEntityNotFound(_0x5e389c,null))[_0x3aa658(0x186)](removeEntity(_0x5e389c,null))[_0x3aa658(0x17c)](handleError(_0x5e389c,null));},exports['getFields']=function(_0x286c06,_0x40ad00){const _0x40a42d=a342_0x30c70c;let _0xe695ec={};const _0x3c1eb9={};let _0x53b35e,_0x4dfdbc;return db[_0x40a42d(0x1a1)][_0x40a42d(0x182)]({'where':{'id':_0x286c06[_0x40a42d(0x185)]['id']}})[_0x40a42d(0x186)](handleEntityNotFound(_0x40ad00,null))[_0x40a42d(0x186)](function(_0x1c2624){const _0x13bd39=_0x40a42d;if(_0x1c2624)return _0x53b35e=_0x1c2624,_0x3c1eb9[_0x13bd39(0x19d)]=_['keys'](db[_0x13bd39(0x19b)][_0x13bd39(0x16b)]),_0x3c1eb9[_0x13bd39(0x17a)]=_['keys'](_0x286c06[_0x13bd39(0x17a)]),_0x3c1eb9['filters']=_['intersection'](_0x3c1eb9[_0x13bd39(0x19d)],_0x3c1eb9['query']),_0xe695ec[_0x13bd39(0x183)]=_['intersection'](_0x3c1eb9[_0x13bd39(0x19d)],qs['fields'](_0x286c06[_0x13bd39(0x17a)][_0x13bd39(0x199)])),_0xe695ec[_0x13bd39(0x183)]=_0xe695ec['attributes']['length']?_0xe695ec[_0x13bd39(0x183)]:_0x3c1eb9[_0x13bd39(0x19d)],_0xe695ec['order']=qs[_0x13bd39(0x17b)](_0x286c06[_0x13bd39(0x17a)][_0x13bd39(0x17b)]),_0xe695ec['where']=qs[_0x13bd39(0x178)](_[_0x13bd39(0x16c)](_0x286c06[_0x13bd39(0x17a)],_0x3c1eb9[_0x13bd39(0x178)])),_0xe695ec=filterAttributes(_0xe695ec,_0x286c06['query'][_0x13bd39(0x18b)],_0xe695ec[_0x13bd39(0x183)],_0x286c06['options'],![]),_0x53b35e[_0x13bd39(0x177)](_0xe695ec);})[_0x40a42d(0x186)](function(_0x564088){const _0x1f7db3=_0x40a42d;if(_0x564088)return _0x4dfdbc=_0x564088[_0x1f7db3(0x17e)],typeof _0x286c06[_0x1f7db3(0x17a)][_0x1f7db3(0x172)]==='undefined'&&(_0xe695ec['limit']=qs[_0x1f7db3(0x194)](_0x286c06[_0x1f7db3(0x17a)][_0x1f7db3(0x194)]),_0xe695ec[_0x1f7db3(0x170)]=qs['offset'](_0x286c06[_0x1f7db3(0x17a)][_0x1f7db3(0x170)])),_0x53b35e[_0x1f7db3(0x177)](_0xe695ec);})[_0x40a42d(0x186)](function(_0x514c7b){if(_0x514c7b)return _0x514c7b?{'count':_0x4dfdbc,'rows':_0x514c7b}:null;})[_0x40a42d(0x186)](respondWithResult(_0x40ad00,null))[_0x40a42d(0x17c)](handleError(_0x40ad00,null));},exports['getSubjects']=function(_0x5965de,_0x1527c7){const _0x4c4b93=a342_0x30c70c;let _0x53ac11={};const _0x368fac={};let _0xa4c624,_0x38e82c;return db[_0x4c4b93(0x1a1)][_0x4c4b93(0x182)]({'where':{'id':_0x5965de[_0x4c4b93(0x185)]['id']}})[_0x4c4b93(0x186)](handleEntityNotFound(_0x1527c7,null))[_0x4c4b93(0x186)](function(_0x4af5c0){const _0x1794d7=_0x4c4b93;if(_0x4af5c0)return _0xa4c624=_0x4af5c0,_0x368fac['model']=_['keys'](db[_0x1794d7(0x19b)][_0x1794d7(0x16b)]),_0x368fac[_0x1794d7(0x17a)]=_[_0x1794d7(0x17d)](_0x5965de['query']),_0x368fac[_0x1794d7(0x178)]=_[_0x1794d7(0x173)](_0x368fac['model'],_0x368fac[_0x1794d7(0x17a)]),_0x53ac11[_0x1794d7(0x183)]=_[_0x1794d7(0x173)](_0x368fac[_0x1794d7(0x19d)],qs[_0x1794d7(0x199)](_0x5965de[_0x1794d7(0x17a)][_0x1794d7(0x199)])),_0x53ac11['attributes']=_0x53ac11[_0x1794d7(0x183)][_0x1794d7(0x17e)]?_0x53ac11[_0x1794d7(0x183)]:_0x368fac[_0x1794d7(0x19d)],_0x53ac11[_0x1794d7(0x197)]=qs[_0x1794d7(0x17b)](_0x5965de[_0x1794d7(0x17a)][_0x1794d7(0x17b)]),_0x53ac11[_0x1794d7(0x16d)]=qs[_0x1794d7(0x178)](_[_0x1794d7(0x16c)](_0x5965de[_0x1794d7(0x17a)],_0x368fac['filters'])),_0x53ac11=filterAttributes(_0x53ac11,_0x5965de[_0x1794d7(0x17a)][_0x1794d7(0x18b)],_0x53ac11[_0x1794d7(0x183)],_0x5965de['options'],![]),_0xa4c624[_0x1794d7(0x18f)](_0x53ac11);})[_0x4c4b93(0x186)](function(_0x263ef1){const _0x28b76d=_0x4c4b93;if(_0x263ef1)return _0x38e82c=_0x263ef1[_0x28b76d(0x17e)],typeof _0x5965de['query'][_0x28b76d(0x172)]===_0x28b76d(0x18d)&&(_0x53ac11[_0x28b76d(0x194)]=qs[_0x28b76d(0x194)](_0x5965de[_0x28b76d(0x17a)][_0x28b76d(0x194)]),_0x53ac11[_0x28b76d(0x170)]=qs['offset'](_0x5965de[_0x28b76d(0x17a)][_0x28b76d(0x170)])),_0xa4c624[_0x28b76d(0x18f)](_0x53ac11);})[_0x4c4b93(0x186)](function(_0x4f6726){if(_0x4f6726)return _0x4f6726?{'count':_0x38e82c,'rows':_0x4f6726}:null;})[_0x4c4b93(0x186)](respondWithResult(_0x1527c7,null))[_0x4c4b93(0x17c)](handleError(_0x1527c7,null));},exports[a342_0x30c70c(0x181)]=function(_0x4307b8,_0x2a270f){const _0x1e526f=a342_0x30c70c;let _0x1bcac8={};const _0x133315={};let _0x3e65c2,_0x59a0da;return db[_0x1e526f(0x1a1)][_0x1e526f(0x182)]({'where':{'id':_0x4307b8[_0x1e526f(0x185)]['id']}})[_0x1e526f(0x186)](handleEntityNotFound(_0x2a270f,null))[_0x1e526f(0x186)](function(_0x3b06d0){const _0x174b38=_0x1e526f;if(_0x3b06d0)return _0x3e65c2=_0x3b06d0,_0x133315[_0x174b38(0x19d)]=_[_0x174b38(0x17d)](db[_0x174b38(0x19b)][_0x174b38(0x16b)]),_0x133315[_0x174b38(0x17a)]=_[_0x174b38(0x17d)](_0x4307b8[_0x174b38(0x17a)]),_0x133315[_0x174b38(0x178)]=_['intersection'](_0x133315['model'],_0x133315[_0x174b38(0x17a)]),_0x1bcac8['attributes']=_[_0x174b38(0x173)](_0x133315[_0x174b38(0x19d)],qs[_0x174b38(0x199)](_0x4307b8[_0x174b38(0x17a)][_0x174b38(0x199)])),_0x1bcac8['attributes']=_0x1bcac8[_0x174b38(0x183)][_0x174b38(0x17e)]?_0x1bcac8[_0x174b38(0x183)]:_0x133315[_0x174b38(0x19d)],_0x1bcac8[_0x174b38(0x197)]=qs[_0x174b38(0x17b)](_0x4307b8[_0x174b38(0x17a)][_0x174b38(0x17b)]),_0x1bcac8[_0x174b38(0x16d)]=qs['filters'](_[_0x174b38(0x16c)](_0x4307b8[_0x174b38(0x17a)],_0x133315[_0x174b38(0x178)])),_0x1bcac8=filterAttributes(_0x1bcac8,_0x4307b8['query']['filter'],_0x1bcac8[_0x174b38(0x183)],_0x4307b8[_0x174b38(0x188)],![]),_0x3e65c2[_0x174b38(0x181)](_0x1bcac8);})['then'](function(_0x2f71f1){const _0x510c4b=_0x1e526f;if(_0x2f71f1)return _0x59a0da=_0x2f71f1[_0x510c4b(0x17e)],typeof _0x4307b8[_0x510c4b(0x17a)][_0x510c4b(0x172)]===_0x510c4b(0x18d)&&(_0x1bcac8[_0x510c4b(0x194)]=qs[_0x510c4b(0x194)](_0x4307b8[_0x510c4b(0x17a)][_0x510c4b(0x194)]),_0x1bcac8[_0x510c4b(0x170)]=qs[_0x510c4b(0x170)](_0x4307b8[_0x510c4b(0x17a)][_0x510c4b(0x170)])),_0x3e65c2['getDescriptions'](_0x1bcac8);})[_0x1e526f(0x186)](function(_0x529c14){if(_0x529c14)return _0x529c14?{'count':_0x59a0da,'rows':_0x529c14}:null;})[_0x1e526f(0x186)](respondWithResult(_0x2a270f,null))[_0x1e526f(0x17c)](handleError(_0x2a270f,null));};
\ No newline at end of file