Built motion from commit 362b9399b4d0ed5560fbb795af995925d345fc38. Version 3.0.0...
[motion-next.git] / server / api / intSalesforceField / intSalesforceField.controller.js
index 263572c..57f5c23 100644 (file)
@@ -1 +1 @@
-const a347_0x10cc=['api','type','intersection','sort','where','keys','order','include','SalesforceField','map','merge','undefined','key','options','index','count','VIRTUAL','body','query','limit','fieldName','stack','rawAttributes','set','send','fields','status','nolimit','../../components/parsers/qs','offset','model','sendStatus','update','Content-Range','length','like','findOne','../../config/logger','sequelize','json','catch','then','filters','show','findAll','end','filter','params','name','destroy','attributes','create','rows'];(function(_0xc20c57,_0x5a777a){const _0x10cc71=function(_0x4793fb){while(--_0x4793fb){_0xc20c57['push'](_0xc20c57['shift']());}};_0x10cc71(++_0x5a777a);}(a347_0x10cc,0x7b));const a347_0x4793=function(_0xc20c57,_0x5a777a){_0xc20c57=_0xc20c57-0x173;let _0x10cc71=a347_0x10cc[_0xc20c57];return _0x10cc71;};const a347_0x3400da=a347_0x4793;'use strict';const _=require('lodash'),qs=require(a347_0x3400da(0x17e)),logger=require(a347_0x3400da(0x187))(a347_0x3400da(0x197)),{db}=require('../../mysqldb'),{Op}=require(a347_0x3400da(0x188));function respondWithResult(_0x5e3896,_0x43336a){return _0x43336a=_0x43336a||0xc8,function(_0x331691){const _0x4b47b8=a347_0x4793;if(_0x331691)return _0x5e3896['status'](_0x43336a)[_0x4b47b8(0x189)](_0x331691);};}function respondWithFilteredResult(_0x881bf2,_0x693a8f){return function(_0x169953){const _0x566656=a347_0x4793;if(_0x169953){const _0x578ee0=_0x169953[_0x566656(0x1a6)],_0x4eae72=_0x693a8f[_0x566656(0x17f)];let _0x55b09d=_0x693a8f[_0x566656(0x17f)]+_0x693a8f[_0x566656(0x175)],_0x3d2a41;return _0x55b09d>=_0x578ee0?(_0x55b09d=_0x578ee0,_0x3d2a41=0xc8):_0x3d2a41=0xce,_0x881bf2['status'](_0x3d2a41),_0x881bf2[_0x566656(0x179)](_0x566656(0x183),_0x4eae72+'-'+_0x55b09d+'/'+_0x578ee0)[_0x566656(0x189)](_0x169953);}return null;};}function saveUpdates(_0x139e6b){return function(_0x5a2ccd){const _0x1bf26e=a347_0x4793;if(_0x5a2ccd)return _0x5a2ccd[_0x1bf26e(0x182)](_0x139e6b)['then'](function(_0x551ce0){return _0x551ce0;});return null;};}function removeEntity(_0x4262cd){return function(_0x303ccc){const _0x16d382=a347_0x4793;if(_0x303ccc)return _0x303ccc['destroy']()[_0x16d382(0x18b)](function(){const _0x2c5a70=_0x16d382;_0x4262cd[_0x2c5a70(0x17c)](0xcc)[_0x2c5a70(0x18f)]();});};}function handleEntityNotFound(_0x2620b7){return function(_0x346acb){const _0x446f8d=a347_0x4793;return!_0x346acb&&_0x2620b7[_0x446f8d(0x181)](0x194),_0x346acb;};}function handleError(_0x4da1b8,_0x893d3a){return _0x893d3a=_0x893d3a||0x1f4,function(_0x36bec9){const _0x4f22d8=a347_0x4793;logger['error'](_0x36bec9[_0x4f22d8(0x177)]),_0x36bec9[_0x4f22d8(0x192)]&&delete _0x36bec9[_0x4f22d8(0x192)],_0x4da1b8[_0x4f22d8(0x17c)](_0x893d3a)[_0x4f22d8(0x17a)](_0x36bec9);};}exports[a347_0x3400da(0x1a5)]=function(_0x2bdbc5,_0x2093b0){const _0x54c1d3=a347_0x3400da;let _0x387a84={};const _0x532b22={},_0x3aa5c6={'count':0x0,'rows':[]},_0x51df22=_[_0x54c1d3(0x1a0)](db['SalesforceField'][_0x54c1d3(0x178)],function(_0x2be211){const _0x58e988=_0x54c1d3;return{'name':_0x2be211[_0x58e988(0x176)],'type':_0x2be211[_0x58e988(0x198)][_0x58e988(0x1a3)]};});_0x532b22[_0x54c1d3(0x180)]=_[_0x54c1d3(0x1a0)](_0x51df22,_0x54c1d3(0x192)),_0x532b22[_0x54c1d3(0x174)]=_['keys'](_0x2bdbc5[_0x54c1d3(0x174)]),_0x532b22[_0x54c1d3(0x18c)]=_[_0x54c1d3(0x199)](_0x532b22['model'],_0x532b22[_0x54c1d3(0x174)]),_0x387a84['attributes']=_[_0x54c1d3(0x199)](_0x532b22[_0x54c1d3(0x180)],qs[_0x54c1d3(0x17b)](_0x2bdbc5['query'][_0x54c1d3(0x17b)])),_0x387a84[_0x54c1d3(0x194)]=_0x387a84['attributes']['length']?_0x387a84['attributes']:_0x532b22[_0x54c1d3(0x180)];typeof _0x2bdbc5['query'][_0x54c1d3(0x17d)]===_0x54c1d3(0x1a2)&&(_0x387a84['limit']=qs['limit'](_0x2bdbc5[_0x54c1d3(0x174)]['limit']),_0x387a84[_0x54c1d3(0x17f)]=qs[_0x54c1d3(0x17f)](_0x2bdbc5['query'][_0x54c1d3(0x17f)]));_0x387a84[_0x54c1d3(0x19d)]=qs[_0x54c1d3(0x19a)](_0x2bdbc5['query'][_0x54c1d3(0x19a)]),_0x387a84[_0x54c1d3(0x19b)]=qs['filters'](_['pick'](_0x2bdbc5[_0x54c1d3(0x174)],_0x532b22[_0x54c1d3(0x18c)]),_0x51df22);_0x2bdbc5[_0x54c1d3(0x174)][_0x54c1d3(0x190)]&&(_0x387a84[_0x54c1d3(0x19b)]=_[_0x54c1d3(0x1a1)](_0x387a84['where'],{[Op['or']]:_[_0x54c1d3(0x1a0)](_0x51df22,function(_0x2bb458){const _0x45fef2=_0x54c1d3;if(_0x2bb458['type']!==_0x45fef2(0x1a7)){const _0xdf150={};return _0xdf150[_0x2bb458[_0x45fef2(0x192)]]={[Op[_0x45fef2(0x185)]]:'%'+_0x2bdbc5[_0x45fef2(0x174)]['filter']+'%'},_0xdf150;}})}));_0x387a84=_[_0x54c1d3(0x1a1)]({},_0x387a84,_0x2bdbc5[_0x54c1d3(0x1a4)]);const _0x445d06={'where':_0x387a84[_0x54c1d3(0x19b)]};return db[_0x54c1d3(0x19f)][_0x54c1d3(0x1a6)](_0x445d06)['then'](function(_0x3cca55){const _0x4cd878=_0x54c1d3;return _0x3aa5c6['count']=_0x3cca55,_0x2bdbc5['query']['includeAll']&&(_0x387a84[_0x4cd878(0x19e)]=[{'all':!![]}]),db[_0x4cd878(0x19f)][_0x4cd878(0x18e)](_0x387a84);})[_0x54c1d3(0x18b)](function(_0x3a6022){const _0x121b67=_0x54c1d3;return _0x3aa5c6[_0x121b67(0x196)]=_0x3a6022,_0x3aa5c6;})[_0x54c1d3(0x18b)](respondWithFilteredResult(_0x2093b0,_0x387a84))[_0x54c1d3(0x18a)](handleError(_0x2093b0,null));},exports[a347_0x3400da(0x18d)]=function(_0x3433ba,_0xe420ec){const _0x137868=a347_0x3400da;let _0x3d5a21={'raw':!![],'where':{'id':_0x3433ba[_0x137868(0x191)]['id']}};const _0x3eddfd={};return _0x3eddfd[_0x137868(0x180)]=_[_0x137868(0x19c)](db[_0x137868(0x19f)][_0x137868(0x178)]),_0x3eddfd[_0x137868(0x174)]=_[_0x137868(0x19c)](_0x3433ba[_0x137868(0x174)]),_0x3eddfd[_0x137868(0x18c)]=_['intersection'](_0x3eddfd[_0x137868(0x180)],_0x3eddfd['query']),_0x3d5a21[_0x137868(0x194)]=_[_0x137868(0x199)](_0x3eddfd[_0x137868(0x180)],qs[_0x137868(0x17b)](_0x3433ba['query'][_0x137868(0x17b)])),_0x3d5a21['attributes']=_0x3d5a21[_0x137868(0x194)][_0x137868(0x184)]?_0x3d5a21[_0x137868(0x194)]:_0x3eddfd[_0x137868(0x180)],_0x3433ba[_0x137868(0x174)]['includeAll']&&(_0x3d5a21[_0x137868(0x19e)]=[{'all':!![]}]),_0x3d5a21=_[_0x137868(0x1a1)]({},_0x3d5a21,_0x3433ba['options']),db['SalesforceField'][_0x137868(0x186)](_0x3d5a21)[_0x137868(0x18b)](handleEntityNotFound(_0xe420ec,null))['then'](respondWithResult(_0xe420ec,null))[_0x137868(0x18a)](handleError(_0xe420ec,null));},exports[a347_0x3400da(0x195)]=function(_0x55a636,_0x49e928){const _0x2f0759=a347_0x3400da;return db[_0x2f0759(0x19f)][_0x2f0759(0x195)](_0x55a636[_0x2f0759(0x173)],{})['then'](respondWithResult(_0x49e928,0xc9))['catch'](handleError(_0x49e928,null));},exports[a347_0x3400da(0x182)]=function(_0x1658d7,_0xc12d7f){const _0x33ad9d=a347_0x3400da;return _0x1658d7[_0x33ad9d(0x173)]['id']&&delete _0x1658d7[_0x33ad9d(0x173)]['id'],db[_0x33ad9d(0x19f)]['findOne']({'where':{'id':_0x1658d7[_0x33ad9d(0x191)]['id']}})[_0x33ad9d(0x18b)](handleEntityNotFound(_0xc12d7f,null))[_0x33ad9d(0x18b)](saveUpdates(_0x1658d7['body'],null))[_0x33ad9d(0x18b)](respondWithResult(_0xc12d7f,null))[_0x33ad9d(0x18a)](handleError(_0xc12d7f,null));},exports[a347_0x3400da(0x193)]=function(_0x5108c6,_0x78a4f6){const _0xe9822a=a347_0x3400da;return db[_0xe9822a(0x19f)][_0xe9822a(0x186)]({'where':{'id':_0x5108c6[_0xe9822a(0x191)]['id']}})['then'](handleEntityNotFound(_0x78a4f6,null))[_0xe9822a(0x18b)](removeEntity(_0x78a4f6,null))['catch'](handleError(_0x78a4f6,null));};
\ No newline at end of file
+const a347_0xe4d7=['fieldName','map','../../config/logger','limit','model','length','catch','intersection','../../mysqldb','query','pick','send','nolimit','filters','order','params','index','json','destroy','rows','filter','update','keys','findOne','VIRTUAL','show','rawAttributes','includeAll','end','options','fields','then','sendStatus','undefined','sort','like','where','offset','type','../../components/parsers/qs','error','body','findAll','status','sequelize','merge','SalesforceField','count','stack','attributes','name','include'];(function(_0x2cc540,_0x330f6e){const _0xe4d7a0=function(_0x29e4de){while(--_0x29e4de){_0x2cc540['push'](_0x2cc540['shift']());}};_0xe4d7a0(++_0x330f6e);}(a347_0xe4d7,0x1b8));const a347_0x29e4=function(_0x2cc540,_0x330f6e){_0x2cc540=_0x2cc540-0x19b;let _0xe4d7a0=a347_0xe4d7[_0x2cc540];return _0xe4d7a0;};const a347_0x1e2303=a347_0x29e4;'use strict';const _=require('lodash'),qs=require(a347_0x1e2303(0x1aa)),logger=require(a347_0x1e2303(0x1b9))('api'),{db}=require(a347_0x1e2303(0x1bf)),{Op}=require(a347_0x1e2303(0x1af));function respondWithResult(_0x4caf80,_0x6d6c75){return _0x6d6c75=_0x6d6c75||0xc8,function(_0x3236b8){const _0x552c2d=a347_0x29e4;if(_0x3236b8)return _0x4caf80['status'](_0x6d6c75)[_0x552c2d(0x1c8)](_0x3236b8);};}function respondWithFilteredResult(_0x49b104,_0x2b9067){return function(_0x53bf73){const _0x2adc0c=a347_0x29e4;if(_0x53bf73){const _0x28ed48=_0x53bf73[_0x2adc0c(0x1b2)],_0x3b32d4=_0x2b9067[_0x2adc0c(0x1a8)];let _0x400a9=_0x2b9067['offset']+_0x2b9067[_0x2adc0c(0x1ba)],_0x3863a5;return _0x400a9>=_0x28ed48?(_0x400a9=_0x28ed48,_0x3863a5=0xc8):_0x3863a5=0xce,_0x49b104['status'](_0x3863a5),_0x49b104['set']('Content-Range',_0x3b32d4+'-'+_0x400a9+'/'+_0x28ed48)[_0x2adc0c(0x1c8)](_0x53bf73);}return null;};}function saveUpdates(_0x48d56a){return function(_0x35b67d){const _0x2abad8=a347_0x29e4;if(_0x35b67d)return _0x35b67d[_0x2abad8(0x1cc)](_0x48d56a)[_0x2abad8(0x1a2)](function(_0xc6080e){return _0xc6080e;});return null;};}function removeEntity(_0x57f0b3){return function(_0x17bbfd){const _0xb19d71=a347_0x29e4;if(_0x17bbfd)return _0x17bbfd['destroy']()[_0xb19d71(0x1a2)](function(){const _0x46f13f=_0xb19d71;_0x57f0b3[_0x46f13f(0x1ae)](0xcc)[_0x46f13f(0x19f)]();});};}function handleEntityNotFound(_0x4613ab){return function(_0x5ebf62){const _0x3b36d9=a347_0x29e4;return!_0x5ebf62&&_0x4613ab[_0x3b36d9(0x1a3)](0x194),_0x5ebf62;};}function handleError(_0xfa4059,_0x34e560){return _0x34e560=_0x34e560||0x1f4,function(_0x1c27c1){const _0x3a233d=a347_0x29e4;logger[_0x3a233d(0x1ab)](_0x1c27c1[_0x3a233d(0x1b3)]),_0x1c27c1['name']&&delete _0x1c27c1[_0x3a233d(0x1b5)],_0xfa4059[_0x3a233d(0x1ae)](_0x34e560)[_0x3a233d(0x1c2)](_0x1c27c1);};}exports[a347_0x1e2303(0x1c7)]=function(_0x16f223,_0xdf4395){const _0x4b59b9=a347_0x1e2303;let _0x1dc8d0={};const _0x3e2f67={},_0x128fb9={'count':0x0,'rows':[]},_0x10f3dd=_[_0x4b59b9(0x1b8)](db[_0x4b59b9(0x1b1)][_0x4b59b9(0x19d)],function(_0x4f90bb){const _0x5efe6a=_0x4b59b9;return{'name':_0x4f90bb[_0x5efe6a(0x1b7)],'type':_0x4f90bb['type']['key']};});_0x3e2f67[_0x4b59b9(0x1bb)]=_['map'](_0x10f3dd,'name'),_0x3e2f67[_0x4b59b9(0x1c0)]=_[_0x4b59b9(0x1cd)](_0x16f223[_0x4b59b9(0x1c0)]),_0x3e2f67[_0x4b59b9(0x1c4)]=_['intersection'](_0x3e2f67[_0x4b59b9(0x1bb)],_0x3e2f67[_0x4b59b9(0x1c0)]),_0x1dc8d0[_0x4b59b9(0x1b4)]=_[_0x4b59b9(0x1be)](_0x3e2f67[_0x4b59b9(0x1bb)],qs[_0x4b59b9(0x1a1)](_0x16f223[_0x4b59b9(0x1c0)][_0x4b59b9(0x1a1)])),_0x1dc8d0[_0x4b59b9(0x1b4)]=_0x1dc8d0['attributes'][_0x4b59b9(0x1bc)]?_0x1dc8d0[_0x4b59b9(0x1b4)]:_0x3e2f67[_0x4b59b9(0x1bb)];typeof _0x16f223[_0x4b59b9(0x1c0)][_0x4b59b9(0x1c3)]===_0x4b59b9(0x1a4)&&(_0x1dc8d0[_0x4b59b9(0x1ba)]=qs['limit'](_0x16f223[_0x4b59b9(0x1c0)][_0x4b59b9(0x1ba)]),_0x1dc8d0[_0x4b59b9(0x1a8)]=qs['offset'](_0x16f223[_0x4b59b9(0x1c0)][_0x4b59b9(0x1a8)]));_0x1dc8d0[_0x4b59b9(0x1c5)]=qs[_0x4b59b9(0x1a5)](_0x16f223[_0x4b59b9(0x1c0)]['sort']),_0x1dc8d0['where']=qs[_0x4b59b9(0x1c4)](_[_0x4b59b9(0x1c1)](_0x16f223['query'],_0x3e2f67[_0x4b59b9(0x1c4)]),_0x10f3dd);_0x16f223[_0x4b59b9(0x1c0)]['filter']&&(_0x1dc8d0[_0x4b59b9(0x1a7)]=_[_0x4b59b9(0x1b0)](_0x1dc8d0['where'],{[Op['or']]:_[_0x4b59b9(0x1b8)](_0x10f3dd,function(_0x51f079){const _0x12f38b=_0x4b59b9;if(_0x51f079[_0x12f38b(0x1a9)]!==_0x12f38b(0x19b)){const _0x22d079={};return _0x22d079[_0x51f079[_0x12f38b(0x1b5)]]={[Op[_0x12f38b(0x1a6)]]:'%'+_0x16f223[_0x12f38b(0x1c0)][_0x12f38b(0x1cb)]+'%'},_0x22d079;}})}));_0x1dc8d0=_[_0x4b59b9(0x1b0)]({},_0x1dc8d0,_0x16f223[_0x4b59b9(0x1a0)]);const _0x17b4d2={'where':_0x1dc8d0[_0x4b59b9(0x1a7)]};return db[_0x4b59b9(0x1b1)][_0x4b59b9(0x1b2)](_0x17b4d2)[_0x4b59b9(0x1a2)](function(_0x4362ba){const _0x2b61e1=_0x4b59b9;return _0x128fb9['count']=_0x4362ba,_0x16f223[_0x2b61e1(0x1c0)][_0x2b61e1(0x19e)]&&(_0x1dc8d0[_0x2b61e1(0x1b6)]=[{'all':!![]}]),db[_0x2b61e1(0x1b1)][_0x2b61e1(0x1ad)](_0x1dc8d0);})['then'](function(_0x7aa7b3){const _0x1fded3=_0x4b59b9;return _0x128fb9[_0x1fded3(0x1ca)]=_0x7aa7b3,_0x128fb9;})[_0x4b59b9(0x1a2)](respondWithFilteredResult(_0xdf4395,_0x1dc8d0))[_0x4b59b9(0x1bd)](handleError(_0xdf4395,null));},exports[a347_0x1e2303(0x19c)]=function(_0x21e7b2,_0x3e1048){const _0x3a2a9=a347_0x1e2303;let _0x45dca4={'raw':!![],'where':{'id':_0x21e7b2[_0x3a2a9(0x1c6)]['id']}};const _0xab343d={};return _0xab343d[_0x3a2a9(0x1bb)]=_['keys'](db[_0x3a2a9(0x1b1)][_0x3a2a9(0x19d)]),_0xab343d[_0x3a2a9(0x1c0)]=_[_0x3a2a9(0x1cd)](_0x21e7b2[_0x3a2a9(0x1c0)]),_0xab343d[_0x3a2a9(0x1c4)]=_[_0x3a2a9(0x1be)](_0xab343d[_0x3a2a9(0x1bb)],_0xab343d['query']),_0x45dca4[_0x3a2a9(0x1b4)]=_[_0x3a2a9(0x1be)](_0xab343d['model'],qs[_0x3a2a9(0x1a1)](_0x21e7b2[_0x3a2a9(0x1c0)][_0x3a2a9(0x1a1)])),_0x45dca4[_0x3a2a9(0x1b4)]=_0x45dca4[_0x3a2a9(0x1b4)][_0x3a2a9(0x1bc)]?_0x45dca4[_0x3a2a9(0x1b4)]:_0xab343d['model'],_0x21e7b2[_0x3a2a9(0x1c0)][_0x3a2a9(0x19e)]&&(_0x45dca4['include']=[{'all':!![]}]),_0x45dca4=_[_0x3a2a9(0x1b0)]({},_0x45dca4,_0x21e7b2['options']),db[_0x3a2a9(0x1b1)]['findOne'](_0x45dca4)[_0x3a2a9(0x1a2)](handleEntityNotFound(_0x3e1048,null))[_0x3a2a9(0x1a2)](respondWithResult(_0x3e1048,null))['catch'](handleError(_0x3e1048,null));},exports['create']=function(_0x297b51,_0xd1e84b){const _0x1e7ea7=a347_0x1e2303;return db[_0x1e7ea7(0x1b1)]['create'](_0x297b51[_0x1e7ea7(0x1ac)],{})[_0x1e7ea7(0x1a2)](respondWithResult(_0xd1e84b,0xc9))[_0x1e7ea7(0x1bd)](handleError(_0xd1e84b,null));},exports[a347_0x1e2303(0x1cc)]=function(_0x282550,_0x5234c1){const _0x8e04ae=a347_0x1e2303;return _0x282550[_0x8e04ae(0x1ac)]['id']&&delete _0x282550[_0x8e04ae(0x1ac)]['id'],db[_0x8e04ae(0x1b1)][_0x8e04ae(0x1ce)]({'where':{'id':_0x282550['params']['id']}})[_0x8e04ae(0x1a2)](handleEntityNotFound(_0x5234c1,null))['then'](saveUpdates(_0x282550['body'],null))[_0x8e04ae(0x1a2)](respondWithResult(_0x5234c1,null))[_0x8e04ae(0x1bd)](handleError(_0x5234c1,null));},exports[a347_0x1e2303(0x1c9)]=function(_0x326c5e,_0x5429b3){const _0x1ad6ce=a347_0x1e2303;return db[_0x1ad6ce(0x1b1)][_0x1ad6ce(0x1ce)]({'where':{'id':_0x326c5e[_0x1ad6ce(0x1c6)]['id']}})[_0x1ad6ce(0x1a2)](handleEntityNotFound(_0x5429b3,null))[_0x1ad6ce(0x1a2)](removeEntity(_0x5429b3,null))['catch'](handleError(_0x5429b3,null));};
\ No newline at end of file