Built motion from commit 52def3a.|0.0.67
[motion.git] / server / api / agent / agent.controller.js
1 var _0x311f=["\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"];_0x311f[0];var _=require(_0x311f[1]);var sequelize=require(_0x311f[3])[_0x311f[2]];var Util=require(_0x311f[4]);var Agent=require(_0x311f[3])[_0x311f[5]];var Team=require(_0x311f[3])[_0x311f[6]];var MailRoom=require(_0x311f[3])[_0x311f[7]];exports[_0x311f[8]]=function(_0x5f42x7,_0x5f42x8,_0x5f42x9){return Agent[_0x311f[23]](_0x311f[17],{method:[_0x311f[18],_0x5f42x7[_0x311f[14]]]},{method:[_0x311f[19],_0x5f42x7[_0x311f[14]]]},{method:[_0x311f[20],_0x5f42x7[_0x311f[14]]]},{method:[_0x311f[21],_0x5f42x7[_0x311f[14]]]},_0x311f[22])[_0x311f[16]](Util[_0x311f[15]](_0x5f42x7[_0x311f[14]]))[_0x311f[13]](function(_0x5f42xb){return _0x5f42x8[_0x311f[12]](200)[_0x311f[11]](_0x5f42xb)})[_0x311f[10]](function(_0x5f42xa){console[_0x311f[9]](_0x5f42xa);return handleError(_0x5f42x8,_0x5f42xa)})};exports[_0x311f[24]]=function(_0x5f42x7,_0x5f42x8){return Agent[_0x311f[23]](_0x311f[17])[_0x311f[28]](_0x5f42x7[_0x311f[27]][_0x311f[26]])[_0x311f[13]](function(_0x5f42xc){if(!_0x5f42xc){return _0x5f42x8[_0x311f[25]](404)};return _0x5f42x8[_0x311f[11]](_0x5f42xc)})[_0x311f[10]](function(_0x5f42xa){return handleError(_0x5f42x8,_0x5f42xa)})};exports[_0x311f[29]]=function(_0x5f42x7,_0x5f42x8){var _0x5f42xd;return Agent[_0x311f[23]](_0x311f[17])[_0x311f[29]](_0x5f42x7[_0x311f[34]])[_0x311f[13]](function(_0x5f42xc){_0x5f42xd=_0x5f42xc;return Team[_0x311f[33]]({where:{defaultEntry:true}})})[_0x311f[13]](function(_0x5f42xe){return _0x5f42xe[_0x311f[32]](_0x5f42xd[_0x311f[26]])})[_0x311f[13]](function(){return _0x5f42x8[_0x311f[12]](201)[_0x311f[11]](_0x5f42xd)})[_0x311f[10]](sequelize.UniqueConstraintError,function(_0x5f42xa){return Util[_0x311f[31]][_0x311f[30]](_0x5f42x8,_0x5f42xa)})[_0x311f[10]](function(_0x5f42xa){return handleError(_0x5f42x8,_0x5f42xa)})};exports[_0x311f[35]]=function(_0x5f42x7,_0x5f42x8){if(_0x5f42x7[_0x311f[34]][_0x311f[26]]){delete _0x5f42x7[_0x311f[34]][_0x311f[26]]};return Agent[_0x311f[28]](_0x5f42x7[_0x311f[27]][_0x311f[26]])[_0x311f[13]](function(_0x5f42xc){if(!_0x5f42xc){return _0x5f42x8[_0x311f[25]](404)};var _0x5f42xf=_[_0x311f[36]](_0x5f42xc,_0x5f42x7[_0x311f[34]]);return _0x5f42xf[_0x311f[37]]()})[_0x311f[13]](function(_0x5f42xc){return _0x5f42x8[_0x311f[12]](200)[_0x311f[11]](_0x5f42xc)})[_0x311f[10]](sequelize.UniqueConstraintError,function(_0x5f42xa){return Util[_0x311f[31]][_0x311f[30]](_0x5f42x8,_0x5f42xa)})[_0x311f[10]](function(_0x5f42xa){return handleError(_0x5f42x8,_0x5f42xa)})};exports[_0x311f[38]]=function(_0x5f42x7,_0x5f42x8){var _0x5f42xd;return Agent[_0x311f[28]](_0x5f42x7[_0x311f[27]][_0x311f[26]])[_0x311f[13]](function(_0x5f42xc){_0x5f42xd=_0x5f42xc;if(!_0x5f42xc){return _0x5f42x8[_0x311f[25]](404)};return _0x5f42xc[_0x311f[38]]()})[_0x311f[13]](function(){return _0x5f42x8[_0x311f[25]](204)})[_0x311f[10]](sequelize.ForeignKeyConstraintError,function(_0x5f42xa){return Util[_0x311f[31]][_0x311f[40]](_0x5f42x8,_0x311f[17],_0x5f42xd[_0x311f[39]],_0x5f42xa)})[_0x311f[10]](function(_0x5f42xa){return handleError(_0x5f42x8,_0x5f42xa)})};exports[_0x311f[41]]=function(_0x5f42x7,_0x5f42x8){return Agent[_0x311f[38]]({where:{id:_0x5f42x7[_0x311f[14]][_0x311f[42]]},individualHooks:true})[_0x311f[13]](function(){return _0x5f42x8[_0x311f[25]](204)})[_0x311f[10]](function(_0x5f42xa){return handleError(_0x5f42x8,_0x5f42xa)})};function handleError(_0x5f42x8,_0x5f42xa){return _0x5f42x8[_0x311f[12]](500)[_0x311f[11]](_0x5f42xa)}