Built motion from commit a81f050.|0.0.71
[motion.git] / server / api / agent / agent.controller.js
1 var _0x1389=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x55\x73\x65\x72","\x54\x65\x61\x6D","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x69\x6E\x64\x65\x78","\x6C\x6F\x67","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x61\x67\x65\x6E\x74","\x63\x68\x65\x63\x6B\x50\x61\x75\x73\x65\x53\x74\x61\x74\x75\x73","\x63\x68\x65\x63\x6B\x51\x75\x65\x75\x65\x53\x74\x61\x74\x75\x73","\x63\x68\x65\x63\x6B\x4F\x6E\x6C\x69\x6E\x65\x53\x74\x61\x74\x75\x73","\x63\x68\x65\x63\x6B\x53\x69\x70\x53\x74\x61\x74\x75\x73","\x71\x75\x65\x75\x65\x73","\x73\x63\x6F\x70\x65","\x73\x68\x6F\x77","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x63\x72\x65\x61\x74\x65","\x68\x61\x6E\x64\x6C\x65\x55\x6E\x69\x71\x75\x65\x43\x6F\x6E\x73\x74\x72\x61\x69\x6E\x74\x45\x72\x72\x6F\x72","\x65\x72\x72\x6F\x72\x4D\x61\x6E\x61\x67\x65\x72","\x61\x64\x64\x55\x73\x65\x72","\x66\x69\x6E\x64\x4F\x6E\x65","\x62\x6F\x64\x79","\x75\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x64\x65\x73\x74\x72\x6F\x79","\x6E\x61\x6D\x65","\x68\x61\x6E\x64\x6C\x65\x46\x6F\x72\x65\x69\x67\x6E\x4B\x65\x79\x43\x6F\x6E\x73\x74\x72\x61\x69\x6E\x74\x45\x72\x72\x6F\x72","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73"];_0x1389[0];var _=require(_0x1389[1]);var sequelize=require(_0x1389[3])[_0x1389[2]];var Util=require(_0x1389[4]);var Agent=require(_0x1389[3])[_0x1389[5]];var Team=require(_0x1389[3])[_0x1389[6]];var MailRoom=require(_0x1389[3])[_0x1389[7]];exports[_0x1389[8]]=function(_0x6125x7,_0x6125x8,_0x6125x9){return Agent[_0x1389[23]](_0x1389[17],{method:[_0x1389[18],_0x6125x7[_0x1389[14]]]},{method:[_0x1389[19],_0x6125x7[_0x1389[14]]]},{method:[_0x1389[20],_0x6125x7[_0x1389[14]]]},{method:[_0x1389[21],_0x6125x7[_0x1389[14]]]},_0x1389[22])[_0x1389[16]](Util[_0x1389[15]](_0x6125x7[_0x1389[14]]))[_0x1389[13]](function(_0x6125xb){return _0x6125x8[_0x1389[12]](200)[_0x1389[11]](_0x6125xb)})[_0x1389[10]](function(_0x6125xa){console[_0x1389[9]](_0x6125xa);return handleError(_0x6125x8,_0x6125xa)})};exports[_0x1389[24]]=function(_0x6125x7,_0x6125x8){return Agent[_0x1389[23]](_0x1389[17])[_0x1389[28]](_0x6125x7[_0x1389[27]][_0x1389[26]])[_0x1389[13]](function(_0x6125xc){if(!_0x6125xc){return _0x6125x8[_0x1389[25]](404)};return _0x6125x8[_0x1389[11]](_0x6125xc)})[_0x1389[10]](function(_0x6125xa){return handleError(_0x6125x8,_0x6125xa)})};exports[_0x1389[29]]=function(_0x6125x7,_0x6125x8){var _0x6125xd;return Agent[_0x1389[23]](_0x1389[17])[_0x1389[29]](_0x6125x7[_0x1389[34]])[_0x1389[13]](function(_0x6125xc){_0x6125xd=_0x6125xc;return Team[_0x1389[33]]({where:{defaultEntry:true}})})[_0x1389[13]](function(_0x6125xe){return _0x6125xe[_0x1389[32]](_0x6125xd[_0x1389[26]])})[_0x1389[13]](function(){return _0x6125x8[_0x1389[12]](201)[_0x1389[11]](_0x6125xd)})[_0x1389[10]](sequelize.UniqueConstraintError,function(_0x6125xa){return Util[_0x1389[31]][_0x1389[30]](_0x6125x8,_0x6125xa)})[_0x1389[10]](function(_0x6125xa){return handleError(_0x6125x8,_0x6125xa)})};exports[_0x1389[35]]=function(_0x6125x7,_0x6125x8){if(_0x6125x7[_0x1389[34]][_0x1389[26]]){delete _0x6125x7[_0x1389[34]][_0x1389[26]]};return Agent[_0x1389[28]](_0x6125x7[_0x1389[27]][_0x1389[26]])[_0x1389[13]](function(_0x6125xc){if(!_0x6125xc){return _0x6125x8[_0x1389[25]](404)};var _0x6125xf=_[_0x1389[36]](_0x6125xc,_0x6125x7[_0x1389[34]]);return _0x6125xf[_0x1389[37]]()})[_0x1389[13]](function(_0x6125xc){return _0x6125x8[_0x1389[12]](200)[_0x1389[11]](_0x6125xc)})[_0x1389[10]](sequelize.UniqueConstraintError,function(_0x6125xa){return Util[_0x1389[31]][_0x1389[30]](_0x6125x8,_0x6125xa)})[_0x1389[10]](function(_0x6125xa){return handleError(_0x6125x8,_0x6125xa)})};exports[_0x1389[38]]=function(_0x6125x7,_0x6125x8){var _0x6125xd;return Agent[_0x1389[28]](_0x6125x7[_0x1389[27]][_0x1389[26]])[_0x1389[13]](function(_0x6125xc){_0x6125xd=_0x6125xc;if(!_0x6125xc){return _0x6125x8[_0x1389[25]](404)};return _0x6125xc[_0x1389[38]]()})[_0x1389[13]](function(){return _0x6125x8[_0x1389[25]](204)})[_0x1389[10]](sequelize.ForeignKeyConstraintError,function(_0x6125xa){return Util[_0x1389[31]][_0x1389[40]](_0x6125x8,_0x1389[17],_0x6125xd[_0x1389[39]],_0x6125xa)})[_0x1389[10]](function(_0x6125xa){return handleError(_0x6125x8,_0x6125xa)})};exports[_0x1389[41]]=function(_0x6125x7,_0x6125x8){return Agent[_0x1389[38]]({where:{id:_0x6125x7[_0x1389[14]][_0x1389[42]]},individualHooks:true})[_0x1389[13]](function(){return _0x6125x8[_0x1389[25]](204)})[_0x1389[10]](function(_0x6125xa){return handleError(_0x6125x8,_0x6125xa)})};function handleError(_0x6125x8,_0x6125xa){return _0x6125x8[_0x1389[12]](500)[_0x1389[11]](_0x6125xa)}