ad13db2d3c5d4de2e2686a842c4d9912a6b11457
[motion.git] / server / api / sugarcrm_configuration / sugarcrm_configuration.controller.js
1 var _0xe612=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x53\x75\x67\x61\x72\x63\x72\x6D\x43\x6F\x6E\x66\x69\x67\x75\x72\x61\x74\x69\x6F\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x53\x75\x67\x61\x72\x63\x72\x6D\x46\x69\x65\x6C\x64","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x6A\x73\x6F\x6E","\x65\x6E\x64","\x74\x68\x65\x6E","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x64\x65\x73\x74\x72\x6F\x79","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x71\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6C\x6C","\x73\x68\x6F\x77","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x53\x75\x62\x6A\x65\x63\x74","\x44\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x46\x69\x65\x6C\x64","\x66\x69\x6E\x64","\x63\x72\x65\x61\x74\x65","\x62\x6F\x64\x79","\x75\x70\x64\x61\x74\x65","\x66\x69\x6E\x64\x42\x79\x49\x64","\x61\x64\x64\x43\x6F\x6E\x66\x69\x67\x75\x72\x61\x74\x69\x6F\x6E\x46\x69\x65\x6C\x64","\x73\x70\x72\x65\x61\x64","\x61\x64\x64\x53\x75\x62\x6A\x65\x63\x74","\x73\x75\x62\x6A\x65\x63\x74","\x61\x64\x64\x44\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x61\x64\x64\x46\x69\x65\x6C\x64","\x66\x69\x65\x6C\x64","\x74\x79\x70\x65"];_0xe612[0];var _=require(_0xe612[1]);var logger=require(_0xe612[3])(_0xe612[2]);var SugarcrmConfiguration=require(_0xe612[5])[_0xe612[4]];var SugarcrmField=require(_0xe612[5])[_0xe612[6]];function handleError(_0x33cex6,_0x33cex7){_0x33cex7= _0x33cex7|| 500;return function(_0x33cex8){logger[_0xe612[8]](_0x33cex8[_0xe612[7]]);_0x33cex6[_0xe612[10]](_0x33cex7)[_0xe612[9]](_0x33cex8)}}function responseWithResult(_0x33cex6,_0x33cex7){_0x33cex7= _0x33cex7|| 200;return function(_0x33cexa){if(_0x33cexa){_0x33cex6[_0xe612[10]](_0x33cex7)[_0xe612[11]](_0x33cexa)}}}function handleEntityNotFound(_0x33cex6){return function(_0x33cexa){if(!_0x33cexa){_0x33cex6[_0xe612[10]](404)[_0xe612[12]]();return null};return _0x33cexa}}function saveUpdates(_0x33cexd){return function(_0x33cexa){return _0x33cexa[_0xe612[14]](_0x33cexd)[_0xe612[13]](function(_0x33cexe){return _0x33cexe})}}function removeEntity(_0x33cex6){return function(_0x33cexa){if(_0x33cexa){return _0x33cexa[_0xe612[15]]()[_0xe612[13]](function(){_0x33cex6[_0xe612[10]](204)[_0xe612[12]]()})}}}exports[_0xe612[16]]= function(_0x33cex10,_0x33cex6){SugarcrmConfiguration[_0xe612[19]]({where:_0x33cex10[_0xe612[18]]})[_0xe612[13]](responseWithResult(_0x33cex6))[_0xe612[17]](handleError(_0x33cex6))};exports[_0xe612[20]]= function(_0x33cex10,_0x33cex6){SugarcrmConfiguration[_0xe612[26]]({where:{id:_0x33cex10[_0xe612[22]][_0xe612[21]]},include:[{model:SugarcrmField,as:_0xe612[23]},{model:SugarcrmField,as:_0xe612[24]},{model:SugarcrmField,as:_0xe612[25]}]})[_0xe612[13]](handleEntityNotFound(_0x33cex6))[_0xe612[13]](responseWithResult(_0x33cex6))[_0xe612[17]](handleError(_0x33cex6))};exports[_0xe612[27]]= function(_0x33cex10,_0x33cex6){SugarcrmConfiguration[_0xe612[27]](_0x33cex10[_0xe612[28]])[_0xe612[13]](responseWithResult(_0x33cex6,201))[_0xe612[17]](handleError(_0x33cex6))};exports[_0xe612[29]]= function(_0x33cex10,_0x33cex6){if(_0x33cex10[_0xe612[28]][_0xe612[21]]){delete _0x33cex10[_0xe612[28]][_0xe612[21]]};SugarcrmConfiguration[_0xe612[30]](_0x33cex10[_0xe612[22]][_0xe612[21]])[_0xe612[13]](handleEntityNotFound(_0x33cex6))[_0xe612[13]](saveUpdates(_0x33cex10[_0xe612[28]]))[_0xe612[13]](responseWithResult(_0x33cex6))[_0xe612[17]](handleError(_0x33cex6))};exports[_0xe612[15]]= function(_0x33cex10,_0x33cex6){SugarcrmConfiguration[_0xe612[30]](_0x33cex10[_0xe612[22]][_0xe612[21]])[_0xe612[13]](handleEntityNotFound(_0x33cex6))[_0xe612[13]](removeEntity(_0x33cex6))[_0xe612[17]](handleError(_0x33cex6))};exports[_0xe612[31]]= function(_0x33cex10,_0x33cex6,_0x33cex11){var _0x33cex12;SugarcrmConfiguration[_0xe612[30]](_0x33cex10[_0xe612[22]][_0xe612[21]])[_0xe612[13]](handleEntityNotFound(_0x33cex6))[_0xe612[13]](function(_0x33cex15){_0x33cex12= _0x33cex15;return SugarcrmField[_0xe612[27]](_0x33cex10[_0xe612[28]])})[_0xe612[13]](function(_0x33cex14){switch(_0x33cex10[_0xe612[22]][_0xe612[39]]){case _0xe612[34]:return [_0x33cex12[_0xe612[33]](_0x33cex14),_0x33cex14];case _0xe612[36]:return [_0x33cex12[_0xe612[35]](_0x33cex14),_0x33cex14];case _0xe612[38]:return [_0x33cex12[_0xe612[37]](_0x33cex14),_0x33cex14]}})[_0xe612[32]](function(_0x33cex13,_0x33cex14){return _0x33cex6[_0xe612[10]](201)[_0xe612[11]](_0x33cex14)})[_0xe612[17]](handleError(_0x33cex6))}