Built motion from commit f861bcb808219e66da88ba48b61bddb35224a65e. Version 3.0.0...
[motion-next.git] / server / api / intSalesforceAccount / intSalesforceAccount.controller.js
index 7ac27b1..4b740f6 100644 (file)
@@ -1 +1 @@
-'use strict';const a336_0x56d3=['fields','show','getFields','sort','destroy','undefined','api','merge','count','112127uhboSE','Status','Type','name','jsforce','CallDurationInSeconds','substring','@components/parsers/qs','attributes','@components/integrations/configuration','remoteUri','SalesforceConfiguration','sobject','stringify','create','True','isNil','getConfigurations','channel','custom','@config/logger','159389zGutnm','label','offset','boolean','False','ticketType','SuppliedCompany','sendStatus','securityToken','rawAttributes','where','type','send','Wrong\x20credentials','username','Priority','Origin','statusCode','options','getFields,\x20%s,\x20%s,\x20%s','AccountId','update','getDescriptions','body','then','SalesforceField','value','Connection','describe','clientId','2530167Vmnrbm','limit','Subjects','keys','params','457673OOkSOm','pick','password','remove','picklistValues','error','764131kFaVoP','199bbDuGG','catch','@mysqldb','filters','filter','Reason','SalesforceAccount','key','true','length','include','concat','includeAll','stack','query','Content-Range','CallObject','json','end','4167vxaWIS','intersection','IsArchived','@utils/filter-attributes','lodash','7SEdrgl','319226YXCSIM','map','CallType','findOne','nolimit','clientSecret','login','IsEscalated','lastIndexOf','set','status','Task','model'];const a336_0x2100=function(_0x2f4540,_0x1b6a48){_0x2f4540=_0x2f4540-0xa6;let _0x56d34e=a336_0x56d3[_0x2f4540];return _0x56d34e;};const a336_0x358d48=a336_0x2100;(function(_0x15709d,_0x42b5fe){const _0x4752e2=a336_0x2100;while(!![]){try{const _0x3854cb=-parseInt(_0x4752e2(0x110))+parseInt(_0x4752e2(0xcb))+parseInt(_0x4752e2(0xc5))+parseInt(_0x4752e2(0xe5))+-parseInt(_0x4752e2(0xe4))*-parseInt(_0x4752e2(0xfb))+parseInt(_0x4752e2(0xdf))*parseInt(_0x4752e2(0xcc))+-parseInt(_0x4752e2(0xc0));if(_0x3854cb===_0x42b5fe)break;else _0x15709d['push'](_0x15709d['shift']());}catch(_0x2d8a78){_0x15709d['push'](_0x15709d['shift']());}}}(a336_0x56d3,0x71abc));const _=require(a336_0x358d48(0xe3)),jsforce=require(a336_0x358d48(0xff)),qs=require(a336_0x358d48(0x102)),logger=require(a336_0x358d48(0x10f))(a336_0x358d48(0xf8)),{db}=require(a336_0x358d48(0xce)),{filterAttributes}=require(a336_0x358d48(0xe2)),integrations=require(a336_0x358d48(0x104));function respondWithResult(_0x2835ad,_0x234080){return _0x234080=_0x234080||0xc8,function(_0x4e3a81){const _0xb461ae=a336_0x2100;if(_0x4e3a81)return _0x2835ad[_0xb461ae(0xef)](_0x234080)[_0xb461ae(0xdd)](_0x4e3a81);};}function respondWithFilteredResult(_0x5ea7e2,_0x556d3d){return function(_0x118f6f){const _0xb7964d=a336_0x2100;if(_0x118f6f){const _0x4c7c6a=_0x118f6f['count'],_0x1fb7b2=_0x556d3d['offset'];let _0x395a12=_0x556d3d['offset']+_0x556d3d[_0xb7964d(0xc1)],_0x5f3a89;return _0x395a12>=_0x4c7c6a?(_0x395a12=_0x4c7c6a,_0x5f3a89=0xc8):_0x5f3a89=0xce,_0x5ea7e2[_0xb7964d(0xef)](_0x5f3a89),_0x5ea7e2[_0xb7964d(0xee)](_0xb7964d(0xdb),_0x1fb7b2+'-'+_0x395a12+'/'+_0x4c7c6a)['json'](_0x118f6f);}return null;};}function saveUpdates(_0x28710b){return function(_0x172343){const _0x10c06c=a336_0x2100;if(_0x172343)return _0x172343[_0x10c06c(0xb7)](_0x28710b)[_0x10c06c(0xba)](function(_0x2c5481){return _0x2c5481;});return null;};}function removeEntity(_0xd8cdb9){return function(_0x5445cc){const _0xa27cb6=a336_0x2100;if(_0x5445cc)return _0x5445cc[_0xa27cb6(0xf6)]()[_0xa27cb6(0xba)](function(){const _0x1bbd72=_0xa27cb6;_0xd8cdb9[_0x1bbd72(0xef)](0xcc)[_0x1bbd72(0xde)]();});};}function handleEntityNotFound(_0x5a8385){return function(_0x1a51fa){const _0x5f367f=a336_0x2100;return!_0x1a51fa&&_0x5a8385[_0x5f367f(0xa9)](0x194),_0x1a51fa;};}function handleError(_0xe115b6,_0x488159){return _0x488159=_0x488159||0x1f4,function(_0x2023bf){const _0x36b73f=a336_0x2100;logger[_0x36b73f(0xca)](_0x2023bf[_0x36b73f(0xd9)]),_0x2023bf[_0x36b73f(0xfe)]&&delete _0x2023bf[_0x36b73f(0xfe)],_0xe115b6[_0x36b73f(0xef)](_0x488159)[_0x36b73f(0xae)](_0x2023bf);};}exports['index']=function(_0x445ffc,_0x4de713){const _0x6d657=a336_0x358d48;let _0x45d420={};const _0x3e1026={},_0x198035={'count':0x0,'rows':[]},_0x2576bb=_[_0x6d657(0xe6)](db[_0x6d657(0xd2)][_0x6d657(0xab)],function(_0x442143){const _0x1593c4=_0x6d657;return{'name':_0x442143['fieldName'],'type':_0x442143['type'][_0x1593c4(0xd3)]};});_0x3e1026['model']=_['map'](_0x2576bb,_0x6d657(0xfe)),_0x3e1026[_0x6d657(0xda)]=_[_0x6d657(0xc3)](_0x445ffc[_0x6d657(0xda)]),_0x3e1026['filters']=_[_0x6d657(0xe0)](_0x3e1026[_0x6d657(0xf1)],_0x3e1026[_0x6d657(0xda)]),_0x45d420[_0x6d657(0x103)]=_[_0x6d657(0xe0)](_0x3e1026[_0x6d657(0xf1)],qs[_0x6d657(0xf2)](_0x445ffc[_0x6d657(0xda)][_0x6d657(0xf2)])),_0x45d420[_0x6d657(0x103)]=_0x45d420['attributes'][_0x6d657(0xd5)]?_0x45d420[_0x6d657(0x103)]:_0x3e1026[_0x6d657(0xf1)];typeof _0x445ffc[_0x6d657(0xda)]['nolimit']===_0x6d657(0xf7)&&(_0x45d420[_0x6d657(0xc1)]=qs[_0x6d657(0xc1)](_0x445ffc[_0x6d657(0xda)][_0x6d657(0xc1)]),_0x45d420[_0x6d657(0x112)]=qs[_0x6d657(0x112)](_0x445ffc['query']['offset']));_0x45d420['order']=qs['sort'](_0x445ffc[_0x6d657(0xda)]['sort']),_0x45d420[_0x6d657(0xac)]=qs[_0x6d657(0xcf)](_['pick'](_0x445ffc[_0x6d657(0xda)],_0x3e1026['filters']),_0x2576bb),_0x45d420=filterAttributes(_0x45d420,_0x445ffc['query'][_0x6d657(0xd0)],_0x2576bb,_0x445ffc[_0x6d657(0xb4)]);const _0x2ac82d={'where':_0x45d420[_0x6d657(0xac)]};return db[_0x6d657(0xd2)]['count'](_0x2ac82d)[_0x6d657(0xba)](function(_0x6d1f78){const _0x18360b=_0x6d657;return _0x198035[_0x18360b(0xfa)]=_0x6d1f78,_0x445ffc['query'][_0x18360b(0xd8)]&&(_0x45d420[_0x18360b(0xd6)]=[{'all':!![]}]),db[_0x18360b(0xd2)]['findAll'](_0x45d420);})[_0x6d657(0xba)](function(_0x1938c6){return _0x198035['rows']=_0x1938c6,_0x198035;})[_0x6d657(0xba)](respondWithFilteredResult(_0x4de713,_0x45d420))[_0x6d657(0xcd)](handleError(_0x4de713,null));},exports[a336_0x358d48(0xf3)]=function(_0x407792,_0xc2749b){const _0x1ff269=a336_0x358d48;let _0x21da4d={'raw':![],'where':{'id':_0x407792[_0x1ff269(0xc4)]['id']}};const _0x520302={};return _0x520302[_0x1ff269(0xf1)]=_[_0x1ff269(0xc3)](db[_0x1ff269(0xd2)][_0x1ff269(0xab)]),_0x520302['query']=_[_0x1ff269(0xc3)](_0x407792[_0x1ff269(0xda)]),_0x520302[_0x1ff269(0xcf)]=_['intersection'](_0x520302[_0x1ff269(0xf1)],_0x520302[_0x1ff269(0xda)]),_0x21da4d['attributes']=_['intersection'](_0x520302['model'],qs[_0x1ff269(0xf2)](_0x407792[_0x1ff269(0xda)][_0x1ff269(0xf2)])),_0x21da4d[_0x1ff269(0x103)]=_0x21da4d[_0x1ff269(0x103)]['length']?_0x21da4d[_0x1ff269(0x103)]:_0x520302[_0x1ff269(0xf1)],_0x407792[_0x1ff269(0xda)][_0x1ff269(0xd8)]&&(_0x21da4d['include']=[{'all':!![]}]),_0x21da4d=_[_0x1ff269(0xf9)]({},_0x21da4d,_0x407792['options']),db[_0x1ff269(0xd2)][_0x1ff269(0xe8)](_0x21da4d)[_0x1ff269(0xba)](handleEntityNotFound(_0xc2749b,null))[_0x1ff269(0xba)](respondWithResult(_0xc2749b,null))['catch'](handleError(_0xc2749b,null));},exports[a336_0x358d48(0x109)]=function(_0x35228c,_0x60097f){const _0x55c946=a336_0x358d48;return db['SalesforceAccount'][_0x55c946(0x109)](_0x35228c[_0x55c946(0xb9)],{})[_0x55c946(0xba)](respondWithResult(_0x60097f,0xc9))[_0x55c946(0xcd)](handleError(_0x60097f,null));},exports['update']=function(_0x4c9af7,_0x3abd84){const _0x4dbde7=a336_0x358d48;return _0x4c9af7['body']['id']&&delete _0x4c9af7['body']['id'],db[_0x4dbde7(0xd2)][_0x4dbde7(0xe8)]({'where':{'id':_0x4c9af7['params']['id']}})[_0x4dbde7(0xba)](handleEntityNotFound(_0x3abd84,null))[_0x4dbde7(0xba)](saveUpdates(_0x4c9af7[_0x4dbde7(0xb9)],null))[_0x4dbde7(0xba)](respondWithResult(_0x3abd84,null))[_0x4dbde7(0xcd)](handleError(_0x3abd84,null));},exports[a336_0x358d48(0xf6)]=function(_0x5cee57,_0x2c80c4){const _0xff6cf8=a336_0x358d48;return db['SalesforceAccount'][_0xff6cf8(0xe8)]({'where':{'id':_0x5cee57[_0xff6cf8(0xc4)]['id']}})['then'](handleEntityNotFound(_0x2c80c4,null))[_0xff6cf8(0xba)](removeEntity(_0x2c80c4,null))[_0xff6cf8(0xcd)](handleError(_0x2c80c4,null));},exports[a336_0x358d48(0x10c)]=function(_0x3f4be4,_0x3f6773){const _0x3c9bb6=a336_0x358d48;let _0x202738={};const _0x271b88={};let _0x53c86d,_0xbb0d83;return db[_0x3c9bb6(0xd2)][_0x3c9bb6(0xe8)]({'where':{'id':_0x3f4be4[_0x3c9bb6(0xc4)]['id']}})[_0x3c9bb6(0xba)](handleEntityNotFound(_0x3f6773,null))['then'](function(_0x5e89ae){const _0x2b604b=_0x3c9bb6;if(_0x5e89ae)return _0x53c86d=_0x5e89ae,_0x271b88[_0x2b604b(0xf1)]=_['keys'](db['SalesforceConfiguration'][_0x2b604b(0xab)]),_0x271b88[_0x2b604b(0xda)]=_[_0x2b604b(0xc3)](_0x3f4be4[_0x2b604b(0xda)]),_0x271b88[_0x2b604b(0xcf)]=_[_0x2b604b(0xe0)](_0x271b88[_0x2b604b(0xf1)],_0x271b88[_0x2b604b(0xda)]),_0x202738[_0x2b604b(0x103)]=_[_0x2b604b(0xe0)](_0x271b88[_0x2b604b(0xf1)],qs['fields'](_0x3f4be4[_0x2b604b(0xda)][_0x2b604b(0xf2)])),_0x202738[_0x2b604b(0x103)]=_0x202738[_0x2b604b(0x103)]['length']?_0x202738[_0x2b604b(0x103)]:_0x271b88[_0x2b604b(0xf1)],_0x202738['order']=qs[_0x2b604b(0xf5)](_0x3f4be4[_0x2b604b(0xda)][_0x2b604b(0xf5)]),_0x202738[_0x2b604b(0xac)]=qs[_0x2b604b(0xcf)](_[_0x2b604b(0xc6)](_0x3f4be4[_0x2b604b(0xda)],_0x271b88[_0x2b604b(0xcf)])),_0x202738=filterAttributes(_0x202738,_0x3f4be4[_0x2b604b(0xda)][_0x2b604b(0xd0)],_0x202738[_0x2b604b(0x103)],_0x3f4be4[_0x2b604b(0xb4)],![]),_0x53c86d[_0x2b604b(0x10c)](_0x202738);})[_0x3c9bb6(0xba)](function(_0x30949a){const _0x495160=_0x3c9bb6;if(_0x30949a)return _0xbb0d83=_0x30949a[_0x495160(0xd5)],typeof _0x3f4be4[_0x495160(0xda)][_0x495160(0xe9)]===_0x495160(0xf7)&&(_0x202738[_0x495160(0xc1)]=qs[_0x495160(0xc1)](_0x3f4be4[_0x495160(0xda)][_0x495160(0xc1)]),_0x202738['offset']=qs[_0x495160(0x112)](_0x3f4be4[_0x495160(0xda)][_0x495160(0x112)])),_0x53c86d[_0x495160(0x10c)](_0x202738);})['then'](function(_0x49ffde){if(_0x49ffde)return _0x49ffde?{'count':_0xbb0d83,'rows':_0x49ffde}:null;})[_0x3c9bb6(0xba)](respondWithResult(_0x3f6773,null))[_0x3c9bb6(0xcd)](handleError(_0x3f6773,null));},exports['addConfiguration']=function(_0x47fb5d,_0x553cb2){const _0x50034e=a336_0x358d48;return _0x47fb5d['body']['id']&&delete _0x47fb5d['body']['id'],db['SalesforceAccount'][_0x50034e(0xe8)]({'where':{'id':_0x47fb5d[_0x50034e(0xc4)]['id']}})[_0x50034e(0xba)](handleEntityNotFound(_0x553cb2,null))['then'](function(_0x235a6c){const _0xb55893=_0x50034e;if(_0x235a6c)return _0x47fb5d[_0xb55893(0xb9)][_0xb55893(0xb6)]=_0x235a6c['id'],_0x47fb5d[_0xb55893(0xb9)][_0xb55893(0xc2)]=integrations['getSubjects'](_0x47fb5d[_0xb55893(0xb9)]['channel'],_0x47fb5d[_0xb55893(0xb9)]['type']),_0x47fb5d[_0xb55893(0xb9)]['Descriptions']=integrations[_0xb55893(0xb8)](_0x47fb5d['body'][_0xb55893(0x10d)],_0x47fb5d[_0xb55893(0xb9)]['type']),db[_0xb55893(0x106)][_0xb55893(0x109)](_0x47fb5d[_0xb55893(0xb9)],{'include':[{'model':db['SalesforceField'],'as':_0xb55893(0xc2)},{'model':db[_0xb55893(0xbb)],'as':'Descriptions'}]});return null;})[_0x50034e(0xba)](respondWithResult(_0x553cb2,null))[_0x50034e(0xcd)](handleError(_0x553cb2,null));},exports['getFields']=function(_0x4c4ad9,_0x26ea18){const _0x12af95=a336_0x358d48;let _0x453e8f,_0x4f19ae='',_0x1be1a2=_0x12af95(0xf0);return db['SalesforceAccount'][_0x12af95(0xe8)]({'where':{'id':_0x4c4ad9['params']['id']},'attributes':['id',_0x12af95(0x105),_0x12af95(0xbf),_0x12af95(0xea),_0x12af95(0xb0),_0x12af95(0xc7),_0x12af95(0xaa)]})[_0x12af95(0xba)](handleEntityNotFound(_0x26ea18,null))[_0x12af95(0xba)](function(_0x2da3af){const _0x4f08e0=_0x12af95;if(_0x2da3af){_0x4f19ae=_0x2da3af['remoteUri'];const _0x12f2b0=_0x4f19ae['slice'](-0x1);return _0x12f2b0==='/'&&(_0x4f19ae=_0x4f19ae[_0x4f08e0(0x101)](0x0,_0x4f19ae[_0x4f08e0(0xed)](_0x12f2b0))),_0x453e8f=new jsforce[(_0x4f08e0(0xbd))]({'oauth2':{'loginUrl':_0x4f19ae,'clientId':_0x2da3af['clientId'],'clientSecret':_0x2da3af[_0x4f08e0(0xea)]}}),_0x453e8f[_0x4f08e0(0xeb)](_0x2da3af[_0x4f08e0(0xb0)],_0x2da3af[_0x4f08e0(0xc7)][_0x4f08e0(0xd7)](_0x2da3af['securityToken']));}})[_0x12af95(0xba)](function(_0xb67618){const _0x32d2bd=_0x12af95;if(_0xb67618)return!_[_0x32d2bd(0x10b)](_0x4c4ad9[_0x32d2bd(0xda)]['ticketType'])&&(_0x1be1a2=_0x4c4ad9[_0x32d2bd(0xda)]['ticketType']),_0x453e8f[_0x32d2bd(0x107)](_0x1be1a2)[_0x32d2bd(0xbe)]();})[_0x12af95(0xba)](function(_0xa6290b){const _0xd29d98=_0x12af95;let _0x2dcfb8=['CallDisposition',_0xd29d98(0x100),_0xd29d98(0xdc),_0xd29d98(0xe7),_0xd29d98(0xe1),_0xd29d98(0xb1),_0xd29d98(0xfc),_0xd29d98(0xfd)];!_[_0xd29d98(0x10b)](_0x4c4ad9['query'][_0xd29d98(0xa7)])&&_0x4c4ad9[_0xd29d98(0xda)]['ticketType']==='Case'&&(_0x2dcfb8=[_0xd29d98(0xfd),_0xd29d98(0xb2),_0xd29d98(0xd1),'Status',_0xd29d98(0xb1),_0xd29d98(0xec),'SuppliedName',_0xd29d98(0xa8)]);if(_0xa6290b)return _[_0xd29d98(0xc8)](_0xa6290b[_0xd29d98(0xf2)],function(_0x22957c){const _0x472b10=_0xd29d98;return _0x22957c[_0x472b10(0x10e)]===![]&&!_0x2dcfb8['includes'](_0x22957c[_0x472b10(0xfe)]);}),{'count':_0xa6290b['fields'][_0xd29d98(0xd5)],'rows':_[_0xd29d98(0xe6)](_0xa6290b[_0xd29d98(0xf2)],function(_0x3b29e5){const _0x353040=_0xd29d98;return{'id':_0x3b29e5[_0x353040(0xfe)],'name':_0x3b29e5[_0x353040(0x111)],'custom':_0x3b29e5['custom'],'options':_0x3b29e5['picklistValues'][_0x353040(0xd5)]>0x0?_[_0x353040(0xe6)](_0x3b29e5[_0x353040(0xc9)],function(_0x4a8b95){const _0x2bc84f=_0x353040;return{'name':_0x4a8b95['label'],'value':_0x4a8b95[_0x2bc84f(0xbc)]};}):_0x3b29e5[_0x353040(0xad)]==_0x353040(0x113)?[{'name':_0x353040(0x10a),'value':_0x353040(0xd4)},{'name':_0x353040(0xa6),'value':'false'}]:[]};})};})[_0x12af95(0xba)](respondWithResult(_0x26ea18,null))['catch'](function(_0x4644e7){const _0x230287=_0x12af95;let _0x4fde3c=_0x4c4ad9['query']['test']?0x1f4:_0x4644e7[_0x230287(0xb3)]||0x1f4;logger[_0x230287(0xca)](_0x230287(0xb5),_0x230287(0xf4),_0x4fde3c,JSON[_0x230287(0x108)](_0x4644e7)),delete _0x4644e7[_0x230287(0xfe)],_0x4fde3c===0x191&&(_0x4fde3c=0x190),_0x26ea18[_0x230287(0xef)](_0x4fde3c)[_0x230287(0xae)](_0x4c4ad9['query']['test']?{'message':_0x230287(0xaf),'statusCode':_0x4644e7[_0x230287(0xb3)]}:_0x4644e7);});};
\ No newline at end of file
+'use strict';const a336_0x3169=['include','params','findAll','attributes','slice','getSubjects','false','addConfiguration','send','key','1681526rYgmpY','order','True','options','ticketType','picklist','pick','limit','False','rows','19028hbQqxL','channel','destroy','keys','3eYmHVl','IsReminderSet','end','rawAttributes','login','883472SzfbFd','email','query','111CRaRGW','ActivityDate','username','securityToken','type','stringify','int','password','Wrong\x20credentials','sort','Subjects','show','getDescriptions','927633QLiQyT','api','picklistValues','clientId','error','Task','map','fields','7484sulnRh','remoteUri','includeAll','test','clientSecret','filters','phone','SalesforceAccount','create','filter','status','getFields','boolean','Content-Range','1034939SeVoGu','where','count','merge','json','set','nolimit','true','getFields,\x20%s,\x20%s,\x20%s','Connection','@config/logger','1KRofZe','substring','SalesforceConfiguration','includes','isNil','index','@components/parsers/qs','length','SalesforceField','getConfigurations','intersection','678407VntTUo','body','update','statusCode','stack','@mysqldb','Descriptions','undefined','then','offset','catch','lastIndexOf','label','lodash','custom','model','findOne','Subject','describe','textarea','Description','name','sobject','string'];const a336_0x5ebb=function(_0x575e84,_0x5c9647){_0x575e84=_0x575e84-0x156;let _0x31695e=a336_0x3169[_0x575e84];return _0x31695e;};const a336_0x2125f5=a336_0x5ebb;(function(_0xdf2413,_0xff84d0){const _0x65b2fb=a336_0x5ebb;while(!![]){try{const _0x2bbfcd=parseInt(_0x65b2fb(0x156))+-parseInt(_0x65b2fb(0x1b2))*-parseInt(_0x65b2fb(0x1ae))+-parseInt(_0x65b2fb(0x177))*-parseInt(_0x65b2fb(0x182))+-parseInt(_0x65b2fb(0x16c))+parseInt(_0x65b2fb(0x15e))*-parseInt(_0x65b2fb(0x1ba))+-parseInt(_0x65b2fb(0x1b7))+parseInt(_0x65b2fb(0x1a4));if(_0x2bbfcd===_0xff84d0)break;else _0xdf2413['push'](_0xdf2413['shift']());}catch(_0x508043){_0xdf2413['push'](_0xdf2413['shift']());}}}(a336_0x3169,0x9163b));const _=require(a336_0x2125f5(0x18f)),jsforce=require('jsforce'),qs=require(a336_0x2125f5(0x17d)),logger=require(a336_0x2125f5(0x176))(a336_0x2125f5(0x157)),{db}=require(a336_0x2125f5(0x187)),{filterAttributes}=require('@utils/filter-attributes'),integrations=require('@components/integrations/configuration');function respondWithResult(_0x16d167,_0x47ac9d){return _0x47ac9d=_0x47ac9d||0xc8,function(_0x3fe600){const _0x1e990c=a336_0x5ebb;if(_0x3fe600)return _0x16d167[_0x1e990c(0x168)](_0x47ac9d)[_0x1e990c(0x170)](_0x3fe600);};}function respondWithFilteredResult(_0x5ecf14,_0x1d8fbd){return function(_0x18fc49){const _0x54bc49=a336_0x5ebb;if(_0x18fc49){const _0x28857e=_0x18fc49[_0x54bc49(0x16e)],_0x530267=_0x1d8fbd[_0x54bc49(0x18b)];let _0x919390=_0x1d8fbd[_0x54bc49(0x18b)]+_0x1d8fbd[_0x54bc49(0x1ab)],_0x4e0d12;return _0x919390>=_0x28857e?(_0x919390=_0x28857e,_0x4e0d12=0xc8):_0x4e0d12=0xce,_0x5ecf14['status'](_0x4e0d12),_0x5ecf14[_0x54bc49(0x171)](_0x54bc49(0x16b),_0x530267+'-'+_0x919390+'/'+_0x28857e)[_0x54bc49(0x170)](_0x18fc49);}return null;};}function saveUpdates(_0x17af5c){return function(_0x2dd72b){const _0x2a959c=a336_0x5ebb;if(_0x2dd72b)return _0x2dd72b[_0x2a959c(0x184)](_0x17af5c)[_0x2a959c(0x18a)](function(_0x1d5b30){return _0x1d5b30;});return null;};}function removeEntity(_0x37805a){return function(_0x38d258){const _0x3410b0=a336_0x5ebb;if(_0x38d258)return _0x38d258[_0x3410b0(0x1b0)]()[_0x3410b0(0x18a)](function(){const _0x4f51c0=_0x3410b0;_0x37805a[_0x4f51c0(0x168)](0xcc)[_0x4f51c0(0x1b4)]();});};}function handleEntityNotFound(_0x45b4e0){return function(_0x36b1d3){return!_0x36b1d3&&_0x45b4e0['sendStatus'](0x194),_0x36b1d3;};}function handleError(_0x1b1bf4,_0x6eb124){return _0x6eb124=_0x6eb124||0x1f4,function(_0xc5ca3){const _0xb923d9=a336_0x5ebb;logger[_0xb923d9(0x15a)](_0xc5ca3[_0xb923d9(0x186)]),_0xc5ca3[_0xb923d9(0x197)]&&delete _0xc5ca3['name'],_0x1b1bf4[_0xb923d9(0x168)](_0x6eb124)[_0xb923d9(0x1a2)](_0xc5ca3);};}exports[a336_0x2125f5(0x17c)]=function(_0x45184d,_0x2e42b6){const _0x387e55=a336_0x2125f5;let _0x302335={};const _0x4cc21a={},_0x40ff29={'count':0x0,'rows':[]},_0x5d3631=_[_0x387e55(0x15c)](db[_0x387e55(0x165)][_0x387e55(0x1b5)],function(_0x5df166){const _0x283774=_0x387e55;return{'name':_0x5df166['fieldName'],'type':_0x5df166[_0x283774(0x1be)][_0x283774(0x1a3)]};});_0x4cc21a[_0x387e55(0x191)]=_[_0x387e55(0x15c)](_0x5d3631,'name'),_0x4cc21a[_0x387e55(0x1b9)]=_[_0x387e55(0x1b1)](_0x45184d[_0x387e55(0x1b9)]),_0x4cc21a[_0x387e55(0x163)]=_[_0x387e55(0x181)](_0x4cc21a[_0x387e55(0x191)],_0x4cc21a[_0x387e55(0x1b9)]),_0x302335[_0x387e55(0x19d)]=_[_0x387e55(0x181)](_0x4cc21a['model'],qs[_0x387e55(0x15d)](_0x45184d[_0x387e55(0x1b9)][_0x387e55(0x15d)])),_0x302335[_0x387e55(0x19d)]=_0x302335[_0x387e55(0x19d)][_0x387e55(0x17e)]?_0x302335[_0x387e55(0x19d)]:_0x4cc21a[_0x387e55(0x191)];typeof _0x45184d[_0x387e55(0x1b9)]['nolimit']===_0x387e55(0x189)&&(_0x302335['limit']=qs[_0x387e55(0x1ab)](_0x45184d[_0x387e55(0x1b9)][_0x387e55(0x1ab)]),_0x302335[_0x387e55(0x18b)]=qs[_0x387e55(0x18b)](_0x45184d[_0x387e55(0x1b9)][_0x387e55(0x18b)]));_0x302335[_0x387e55(0x1a5)]=qs['sort'](_0x45184d[_0x387e55(0x1b9)][_0x387e55(0x1c3)]),_0x302335[_0x387e55(0x16d)]=qs[_0x387e55(0x163)](_[_0x387e55(0x1aa)](_0x45184d[_0x387e55(0x1b9)],_0x4cc21a[_0x387e55(0x163)]),_0x5d3631),_0x302335=filterAttributes(_0x302335,_0x45184d[_0x387e55(0x1b9)][_0x387e55(0x167)],_0x5d3631,_0x45184d['options']);const _0x392504={'where':_0x302335[_0x387e55(0x16d)]};return db[_0x387e55(0x165)]['count'](_0x392504)['then'](function(_0xd72383){const _0x114490=_0x387e55;return _0x40ff29[_0x114490(0x16e)]=_0xd72383,_0x45184d[_0x114490(0x1b9)][_0x114490(0x160)]&&(_0x302335[_0x114490(0x19a)]=[{'all':!![]}]),db[_0x114490(0x165)][_0x114490(0x19c)](_0x302335);})['then'](function(_0x3eb9a5){const _0x4fab98=_0x387e55;return _0x40ff29[_0x4fab98(0x1ad)]=_0x3eb9a5,_0x40ff29;})[_0x387e55(0x18a)](respondWithFilteredResult(_0x2e42b6,_0x302335))[_0x387e55(0x18c)](handleError(_0x2e42b6,null));},exports[a336_0x2125f5(0x1c5)]=function(_0x40ec3e,_0x296a2c){const _0x183f54=a336_0x2125f5;let _0x361305={'raw':![],'where':{'id':_0x40ec3e['params']['id']}};const _0x358b14={};return _0x358b14[_0x183f54(0x191)]=_[_0x183f54(0x1b1)](db[_0x183f54(0x165)][_0x183f54(0x1b5)]),_0x358b14[_0x183f54(0x1b9)]=_['keys'](_0x40ec3e['query']),_0x358b14[_0x183f54(0x163)]=_[_0x183f54(0x181)](_0x358b14[_0x183f54(0x191)],_0x358b14[_0x183f54(0x1b9)]),_0x361305['attributes']=_['intersection'](_0x358b14['model'],qs['fields'](_0x40ec3e[_0x183f54(0x1b9)][_0x183f54(0x15d)])),_0x361305[_0x183f54(0x19d)]=_0x361305[_0x183f54(0x19d)][_0x183f54(0x17e)]?_0x361305[_0x183f54(0x19d)]:_0x358b14[_0x183f54(0x191)],_0x40ec3e[_0x183f54(0x1b9)][_0x183f54(0x160)]&&(_0x361305[_0x183f54(0x19a)]=[{'all':!![]}]),_0x361305=_[_0x183f54(0x16f)]({},_0x361305,_0x40ec3e[_0x183f54(0x1a7)]),db[_0x183f54(0x165)][_0x183f54(0x192)](_0x361305)[_0x183f54(0x18a)](handleEntityNotFound(_0x296a2c,null))[_0x183f54(0x18a)](respondWithResult(_0x296a2c,null))[_0x183f54(0x18c)](handleError(_0x296a2c,null));},exports['create']=function(_0x4958d4,_0x13758e){const _0xa1adb5=a336_0x2125f5;return db[_0xa1adb5(0x165)][_0xa1adb5(0x166)](_0x4958d4[_0xa1adb5(0x183)],{})[_0xa1adb5(0x18a)](respondWithResult(_0x13758e,0xc9))['catch'](handleError(_0x13758e,null));},exports[a336_0x2125f5(0x184)]=function(_0x587b77,_0x17f207){const _0x1340ae=a336_0x2125f5;return _0x587b77[_0x1340ae(0x183)]['id']&&delete _0x587b77[_0x1340ae(0x183)]['id'],db[_0x1340ae(0x165)][_0x1340ae(0x192)]({'where':{'id':_0x587b77['params']['id']}})[_0x1340ae(0x18a)](handleEntityNotFound(_0x17f207,null))['then'](saveUpdates(_0x587b77['body'],null))[_0x1340ae(0x18a)](respondWithResult(_0x17f207,null))[_0x1340ae(0x18c)](handleError(_0x17f207,null));},exports[a336_0x2125f5(0x1b0)]=function(_0x4c52bf,_0x50b105){const _0x191ef0=a336_0x2125f5;return db[_0x191ef0(0x165)][_0x191ef0(0x192)]({'where':{'id':_0x4c52bf[_0x191ef0(0x19b)]['id']}})[_0x191ef0(0x18a)](handleEntityNotFound(_0x50b105,null))[_0x191ef0(0x18a)](removeEntity(_0x50b105,null))['catch'](handleError(_0x50b105,null));},exports['getConfigurations']=function(_0x20b9ed,_0x24c3d1){const _0x2bf7ac=a336_0x2125f5;let _0x204a1b={};const _0xb73ad0={};let _0x261434,_0x3273b2;return db[_0x2bf7ac(0x165)][_0x2bf7ac(0x192)]({'where':{'id':_0x20b9ed[_0x2bf7ac(0x19b)]['id']}})[_0x2bf7ac(0x18a)](handleEntityNotFound(_0x24c3d1,null))[_0x2bf7ac(0x18a)](function(_0x4de825){const _0x52cb6c=_0x2bf7ac;if(_0x4de825)return _0x261434=_0x4de825,_0xb73ad0[_0x52cb6c(0x191)]=_[_0x52cb6c(0x1b1)](db[_0x52cb6c(0x179)][_0x52cb6c(0x1b5)]),_0xb73ad0['query']=_[_0x52cb6c(0x1b1)](_0x20b9ed['query']),_0xb73ad0[_0x52cb6c(0x163)]=_['intersection'](_0xb73ad0['model'],_0xb73ad0[_0x52cb6c(0x1b9)]),_0x204a1b[_0x52cb6c(0x19d)]=_[_0x52cb6c(0x181)](_0xb73ad0[_0x52cb6c(0x191)],qs[_0x52cb6c(0x15d)](_0x20b9ed[_0x52cb6c(0x1b9)][_0x52cb6c(0x15d)])),_0x204a1b['attributes']=_0x204a1b[_0x52cb6c(0x19d)][_0x52cb6c(0x17e)]?_0x204a1b[_0x52cb6c(0x19d)]:_0xb73ad0[_0x52cb6c(0x191)],_0x204a1b[_0x52cb6c(0x1a5)]=qs[_0x52cb6c(0x1c3)](_0x20b9ed['query'][_0x52cb6c(0x1c3)]),_0x204a1b[_0x52cb6c(0x16d)]=qs[_0x52cb6c(0x163)](_[_0x52cb6c(0x1aa)](_0x20b9ed[_0x52cb6c(0x1b9)],_0xb73ad0[_0x52cb6c(0x163)])),_0x204a1b=filterAttributes(_0x204a1b,_0x20b9ed[_0x52cb6c(0x1b9)][_0x52cb6c(0x167)],_0x204a1b['attributes'],_0x20b9ed['options'],![]),_0x261434['getConfigurations'](_0x204a1b);})['then'](function(_0x4ff16a){const _0x3353ed=_0x2bf7ac;if(_0x4ff16a)return _0x3273b2=_0x4ff16a['length'],typeof _0x20b9ed['query'][_0x3353ed(0x172)]==='undefined'&&(_0x204a1b[_0x3353ed(0x1ab)]=qs['limit'](_0x20b9ed[_0x3353ed(0x1b9)]['limit']),_0x204a1b[_0x3353ed(0x18b)]=qs['offset'](_0x20b9ed[_0x3353ed(0x1b9)][_0x3353ed(0x18b)])),_0x261434[_0x3353ed(0x180)](_0x204a1b);})['then'](function(_0x3eaff6){if(_0x3eaff6)return _0x3eaff6?{'count':_0x3273b2,'rows':_0x3eaff6}:null;})['then'](respondWithResult(_0x24c3d1,null))[_0x2bf7ac(0x18c)](handleError(_0x24c3d1,null));},exports[a336_0x2125f5(0x1a1)]=function(_0x4d4a21,_0xe1b385){const _0x41e3ce=a336_0x2125f5;return _0x4d4a21[_0x41e3ce(0x183)]['id']&&delete _0x4d4a21[_0x41e3ce(0x183)]['id'],db[_0x41e3ce(0x165)][_0x41e3ce(0x192)]({'where':{'id':_0x4d4a21['params']['id']}})['then'](handleEntityNotFound(_0xe1b385,null))['then'](function(_0x3b7333){const _0x4ca003=_0x41e3ce;if(_0x3b7333)return _0x4d4a21[_0x4ca003(0x183)]['AccountId']=_0x3b7333['id'],_0x4d4a21[_0x4ca003(0x183)]['Subjects']=integrations[_0x4ca003(0x19f)](_0x4d4a21['body'][_0x4ca003(0x1af)],_0x4d4a21[_0x4ca003(0x183)][_0x4ca003(0x1be)]),_0x4d4a21[_0x4ca003(0x183)][_0x4ca003(0x188)]=integrations[_0x4ca003(0x1c6)](_0x4d4a21[_0x4ca003(0x183)][_0x4ca003(0x1af)],_0x4d4a21[_0x4ca003(0x183)]['type']),db[_0x4ca003(0x179)][_0x4ca003(0x166)](_0x4d4a21['body'],{'include':[{'model':db['SalesforceField'],'as':_0x4ca003(0x1c4)},{'model':db[_0x4ca003(0x17f)],'as':_0x4ca003(0x188)}]});return null;})[_0x41e3ce(0x18a)](respondWithResult(_0xe1b385,null))[_0x41e3ce(0x18c)](handleError(_0xe1b385,null));},exports[a336_0x2125f5(0x169)]=function(_0x2a1b25,_0x13062b){const _0x29fccc=a336_0x2125f5;let _0x18a51b,_0x4c2beb='',_0x2cb93f=_0x29fccc(0x15b);return db['SalesforceAccount']['findOne']({'where':{'id':_0x2a1b25[_0x29fccc(0x19b)]['id']},'attributes':['id',_0x29fccc(0x15f),'clientId',_0x29fccc(0x162),_0x29fccc(0x1bc),_0x29fccc(0x1c1),_0x29fccc(0x1bd)]})[_0x29fccc(0x18a)](handleEntityNotFound(_0x13062b,null))[_0x29fccc(0x18a)](function(_0x2b46e7){const _0x204aa0=_0x29fccc;if(_0x2b46e7){_0x4c2beb=_0x2b46e7[_0x204aa0(0x15f)];const _0x1ae6e5=_0x4c2beb[_0x204aa0(0x19e)](-0x1);return _0x1ae6e5==='/'&&(_0x4c2beb=_0x4c2beb[_0x204aa0(0x178)](0x0,_0x4c2beb[_0x204aa0(0x18d)](_0x1ae6e5))),_0x18a51b=new jsforce[(_0x204aa0(0x175))]({'oauth2':{'loginUrl':_0x4c2beb,'clientId':_0x2b46e7[_0x204aa0(0x159)],'clientSecret':_0x2b46e7[_0x204aa0(0x162)]}}),_0x18a51b[_0x204aa0(0x1b6)](_0x2b46e7[_0x204aa0(0x1bc)],_0x2b46e7[_0x204aa0(0x1c1)]['concat'](_0x2b46e7[_0x204aa0(0x1bd)]));}})['then'](function(_0x696246){const _0x25d4f3=_0x29fccc;if(_0x696246)return!_[_0x25d4f3(0x17b)](_0x2a1b25[_0x25d4f3(0x1b9)][_0x25d4f3(0x1a8)])&&(_0x2cb93f=_0x2a1b25[_0x25d4f3(0x1b9)][_0x25d4f3(0x1a8)]),_0x18a51b[_0x25d4f3(0x198)](_0x2cb93f)[_0x25d4f3(0x194)]();})['then'](function(_0x2b68a2){const _0x6d963c=_0x29fccc,_0x624948=['OwnerId',_0x6d963c(0x1bb),_0x6d963c(0x1b3),'IsRecurrence',_0x6d963c(0x193),_0x6d963c(0x196)],_0x1ac117=[_0x6d963c(0x199),_0x6d963c(0x1c0),_0x6d963c(0x1a9),'boolean',_0x6d963c(0x1b8),_0x6d963c(0x195),_0x6d963c(0x164)];if(_0x2b68a2)return _['remove'](_0x2b68a2[_0x6d963c(0x15d)],function(_0x4a3e04){const _0xf056b2=_0x6d963c;return _0x624948[_0xf056b2(0x17a)](_0x4a3e04[_0xf056b2(0x197)])||!_0x1ac117[_0xf056b2(0x17a)](_0x4a3e04[_0xf056b2(0x1be)]);}),{'count':_0x2b68a2[_0x6d963c(0x15d)][_0x6d963c(0x17e)],'rows':_[_0x6d963c(0x15c)](_0x2b68a2[_0x6d963c(0x15d)],function(_0x13e4f3){const _0x99f9ba=_0x6d963c;return{'id':_0x13e4f3['name'],'name':_0x13e4f3[_0x99f9ba(0x18e)],'custom':_0x13e4f3[_0x99f9ba(0x190)],'options':_0x13e4f3[_0x99f9ba(0x158)]['length']>0x0?_['map'](_0x13e4f3[_0x99f9ba(0x158)],function(_0x4513e7){return{'name':_0x4513e7['label'],'value':_0x4513e7['value']};}):_0x13e4f3[_0x99f9ba(0x1be)]===_0x99f9ba(0x16a)?[{'name':_0x99f9ba(0x1a6),'value':_0x99f9ba(0x173)},{'name':_0x99f9ba(0x1ac),'value':_0x99f9ba(0x1a0)}]:[]};})};})[_0x29fccc(0x18a)](respondWithResult(_0x13062b,null))['catch'](function(_0xff9d1e){const _0x3b7469=_0x29fccc;let _0x4565fe=_0x2a1b25[_0x3b7469(0x1b9)][_0x3b7469(0x161)]?0x1f4:_0xff9d1e[_0x3b7469(0x185)]||0x1f4;logger[_0x3b7469(0x15a)](_0x3b7469(0x174),_0x3b7469(0x169),_0x4565fe,JSON[_0x3b7469(0x1bf)](_0xff9d1e)),delete _0xff9d1e[_0x3b7469(0x197)],_0x4565fe===0x191&&(_0x4565fe=0x190),_0x13062b[_0x3b7469(0x168)](_0x4565fe)['send'](_0x2a1b25[_0x3b7469(0x1b9)][_0x3b7469(0x161)]?{'message':_0x3b7469(0x1c2),'statusCode':_0xff9d1e[_0x3b7469(0x185)]}:_0xff9d1e);});};
\ No newline at end of file