Built motion from commit 2239aeb.|0.0.113
[motion.git] / server / api / mail_queue / mail_queue.controller.js
index a7d063b..f766a1c 100644 (file)
@@ -1 +1 @@
-var _0xab0b=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x4D\x61\x69\x6C\x51\x75\x65\x75\x65","\x69\x6E\x64\x65\x78","\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","\x64\x65\x66\x61\x75\x6C\x74","\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","\x62\x6F\x64\x79","\x75\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x61\x64\x64\x41\x67\x65\x6E\x74\x73","\x61\x67\x65\x6E\x74\x73","\x70\x65\x6E\x61\x6C\x74\x79","\x6E\x61\x6D\x65","\x61\x64\x64\x55\x73\x65\x72\x73","\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x72\x65\x6D\x6F\x76\x65\x41\x67\x65\x6E\x74\x73","\x72\x65\x6D\x6F\x76\x65\x55\x73\x65\x72\x73","\x64\x65\x73\x74\x72\x6F\x79","\x65\x72\x72","\x65\x72\x72\x6F\x72","\x71\x75\x65\x75\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","\x73\x68\x6F\x77\x41\x67\x65\x6E\x74\x73","\x61\x67\x65\x6E\x74","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x67\x65\x74\x55\x73\x65\x72\x73","\x72\x65\x6D\x6F\x76\x65\x55\x73\x65\x72"];_0xab0b[0];var _=require(_0xab0b[1]);var util=require(_0xab0b[2]);var Util=require(_0xab0b[3]);var sequelize=require(_0xab0b[5])[_0xab0b[4]];var MailQueue=require(_0xab0b[5])[_0xab0b[6]];exports[_0xab0b[7]]=function(_0x6eccx6,_0x6eccx7){return MailQueue[_0xab0b[16]](_0xab0b[15])[_0xab0b[14]](Util[_0xab0b[13]](_0x6eccx6[_0xab0b[12]]))[_0xab0b[11]](function(_0x6eccx9){_0x6eccx7[_0xab0b[10]](200)[_0xab0b[9]](_0x6eccx9)})[_0xab0b[8]](function(_0x6eccx8){return handleError(_0x6eccx7,_0x6eccx8)})};exports[_0xab0b[17]]=function(_0x6eccx6,_0x6eccx7){return MailQueue[_0xab0b[16]](_0xab0b[15])[_0xab0b[21]](_0x6eccx6[_0xab0b[20]][_0xab0b[19]])[_0xab0b[11]](function(_0x6eccxa){if(!_0x6eccxa){return _0x6eccx7[_0xab0b[18]](404)};return _0x6eccx7[_0xab0b[9]](_0x6eccxa)})[_0xab0b[8]](function(_0x6eccx8){return handleError(_0x6eccx7,_0x6eccx8)})};exports[_0xab0b[22]]=function(_0x6eccx6,_0x6eccx7){return MailQueue[_0xab0b[22]](_0x6eccx6[_0xab0b[25]])[_0xab0b[11]](function(_0x6eccxa){return _0x6eccx7[_0xab0b[10]](201)[_0xab0b[9]](_0x6eccxa)})[_0xab0b[8]](sequelize.UniqueConstraintError,function(_0x6eccx8){return Util[_0xab0b[24]][_0xab0b[23]](_0x6eccx7,_0x6eccx8)})[_0xab0b[8]](function(_0x6eccx8){return handleError(_0x6eccx7,_0x6eccx8)})};exports[_0xab0b[26]]=function(_0x6eccx6,_0x6eccx7){if(_0x6eccx6[_0xab0b[25]][_0xab0b[19]]){delete _0x6eccx6[_0xab0b[25]][_0xab0b[19]]};return MailQueue[_0xab0b[21]](_0x6eccx6[_0xab0b[20]][_0xab0b[19]])[_0xab0b[11]](function(_0x6eccxa){if(!_0x6eccxa){return _0x6eccx7[_0xab0b[18]](404)};var _0x6eccxb=_[_0xab0b[27]](_0x6eccxa,_0x6eccx6[_0xab0b[25]]);return _0x6eccxb[_0xab0b[28]]()})[_0xab0b[11]](function(_0x6eccxa){return _0x6eccx7[_0xab0b[10]](200)[_0xab0b[9]](_0x6eccxa)})[_0xab0b[8]](sequelize.UniqueConstraintError,function(_0x6eccx8){return Util[_0xab0b[24]][_0xab0b[23]](_0x6eccx7,_0x6eccx8)})[_0xab0b[8]](function(_0x6eccx8){return handleError(_0x6eccx7,_0x6eccx8)})};exports[_0xab0b[29]]=function(_0x6eccx6,_0x6eccx7,_0x6eccxc){return MailQueue[_0xab0b[21]](_0x6eccx6[_0xab0b[20]][_0xab0b[19]])[_0xab0b[11]](function(_0x6eccxa){if(_0x6eccxa){return _0x6eccxa[_0xab0b[33]](_0x6eccx6[_0xab0b[25]][_0xab0b[30]],{penalty:_0x6eccx6[_0xab0b[25]][_0xab0b[31]],queue:_0x6eccxa[_0xab0b[32]]},{individualHooks:true})}else {throw  new Error(_0xab0b[34])}})[_0xab0b[11]](function(){return _0x6eccx7[_0xab0b[18]](200)})[_0xab0b[8]](function(_0x6eccx8){return handleError(_0x6eccx7,_0x6eccx8)})};exports[_0xab0b[35]]=function(_0x6eccx6,_0x6eccx7){return MailQueue[_0xab0b[21]](_0x6eccx6[_0xab0b[20]][_0xab0b[19]])[_0xab0b[11]](function(_0x6eccxa){if(_0x6eccxa){return _0x6eccxa[_0xab0b[36]](_0x6eccx6[_0xab0b[25]][_0xab0b[30]],{individualHooks:true})}else {throw  new Error(_0xab0b[34])}})[_0xab0b[11]](function(){return _0x6eccx7[_0xab0b[18]](200)})[_0xab0b[8]](function(_0x6eccx8){return handleError(_0x6eccx7,_0x6eccx8)})};exports[_0xab0b[37]]=function(_0x6eccx6,_0x6eccx7){var _0x6eccxd;return MailQueue[_0xab0b[21]](_0x6eccx6[_0xab0b[20]][_0xab0b[19]])[_0xab0b[11]](function(_0x6eccxa){_0x6eccxd=_0x6eccxa;if(!_0x6eccxa){return _0x6eccx7[_0xab0b[18]](404)};return _0x6eccxa[_0xab0b[37]]()})[_0xab0b[11]](function(){return _0x6eccx7[_0xab0b[18]](204)})[_0xab0b[8]](sequelize.ForeignKeyConstraintError,function(_0x6eccx8){return Util[_0xab0b[24]][_0xab0b[41]](_0x6eccx7,_0xab0b[40],_0x6eccxd[_0xab0b[32]],_0x6eccx8)})[_0xab0b[8]](function(_0x6eccx8){console[_0xab0b[39]](_0xab0b[38],_0x6eccx8);return handleError(_0x6eccx7,_0x6eccx8)})};exports[_0xab0b[42]]=function(_0x6eccx6,_0x6eccx7){return MailQueue[_0xab0b[37]]({where:{id:_0x6eccx6[_0xab0b[12]][_0xab0b[43]]},individualHooks:true})[_0xab0b[11]](function(){return _0x6eccx7[_0xab0b[18]](204)})[_0xab0b[8]](function(_0x6eccx8){return handleError(_0x6eccx7,_0x6eccx8)})};exports[_0xab0b[44]]=function(_0x6eccx6,_0x6eccx7){return MailQueue[_0xab0b[21]](_0x6eccx6[_0xab0b[20]][_0xab0b[19]])[_0xab0b[11]](function(_0x6eccxf){if(!_0x6eccxf){return _0x6eccx7[_0xab0b[18]](404)};return _0x6eccxf[_0xab0b[48]]({where:{role:_0xab0b[45]},attributes:[_0xab0b[19],_0xab0b[32],_0xab0b[46],_0xab0b[47]]})})[_0xab0b[11]](function(_0x6eccxe){return _0x6eccx7[_0xab0b[10]](200)[_0xab0b[9]](_0x6eccxe)})[_0xab0b[8]](function(_0x6eccx8){return handleError(_0x6eccx7,_0x6eccx8)})};exports[_0xab0b[35]]=function(_0x6eccx6,_0x6eccx7,_0x6eccxc){return MailQueue[_0xab0b[21]](_0x6eccx6[_0xab0b[20]][_0xab0b[19]])[_0xab0b[11]](function(_0x6eccxf){if(!_0x6eccxf){return _0x6eccx7[_0xab0b[18]](404)};return _0x6eccxf[_0xab0b[49]](_0x6eccx6[_0xab0b[12]][_0xab0b[30]])})[_0xab0b[11]](function(){return _0x6eccx7[_0xab0b[18]](202)})[_0xab0b[8]](function(_0x6eccx8){return _0x6eccxc(_0x6eccx8)})};function handleError(_0x6eccx7,_0x6eccx8){return _0x6eccx7[_0xab0b[10]](500)[_0xab0b[9]](_0x6eccx8)}
\ No newline at end of file
+var _0x5966=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x4D\x61\x69\x6C\x51\x75\x65\x75\x65","\x55\x73\x65\x72","\x55\x73\x65\x72\x48\x61\x73\x4D\x61\x69\x6C\x51\x75\x65\x75\x65","\x69\x6E\x64\x65\x78","\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\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x69\x64","\x75\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x64\x65\x66\x61\x75\x6C\x74","\x73\x63\x6F\x70\x65","\x72\x6F\x6C\x65","\x73\x68\x6F\x77","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x70\x61\x72\x61\x6D\x73","\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","\x62\x6F\x64\x79","\x75\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x61\x64\x64\x41\x67\x65\x6E\x74\x73","\x61\x67\x65\x6E\x74\x73","\x70\x65\x6E\x61\x6C\x74\x79","\x6E\x61\x6D\x65","\x6D\x61\x70","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x72\x65\x6D\x6F\x76\x65\x41\x67\x65\x6E\x74\x73","\x72\x65\x6D\x6F\x76\x65\x55\x73\x65\x72\x73","\x64\x65\x73\x74\x72\x6F\x79","\x65\x72\x72","\x65\x72\x72\x6F\x72","\x71\x75\x65\x75\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","\x73\x68\x6F\x77\x41\x67\x65\x6E\x74\x73","\x6C\x65\x6E\x67\x74\x68","\x61\x67\x65\x6E\x74","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x67\x65\x74\x55\x73\x65\x72\x73"];_0x5966[0];var _=require(_0x5966[1]);var util=require(_0x5966[2]);var Util=require(_0x5966[3]);var sequelize=require(_0x5966[5])[_0x5966[4]];var MailQueue=require(_0x5966[5])[_0x5966[6]];var User=require(_0x5966[5])[_0x5966[7]];var UserHasMailQueue=require(_0x5966[5])[_0x5966[8]];exports[_0x5966[9]]= function(_0xe5e7x8,_0xe5e7x9){switch(_0xe5e7x8[_0x5966[17]][_0x5966[23]]){case _0x5966[17]:return User[_0x5966[18]](_0xe5e7x8[_0x5966[17]][_0x5966[16]],{attributes:[_0x5966[16]]})[_0x5966[13]](Util[_0x5966[15]](_0xe5e7x8[_0x5966[14]]))[_0x5966[13]](function(_0xe5e7xb){_0xe5e7x9[_0x5966[12]](200)[_0x5966[11]](_0xe5e7xb)})[_0x5966[10]](function(_0xe5e7xa){return handleError(_0xe5e7x9,_0xe5e7xa)});default:return MailQueue[_0x5966[22]](_0x5966[21])[_0x5966[20]](Util[_0x5966[19]](_0xe5e7x8[_0x5966[14]]))[_0x5966[13]](function(_0xe5e7xb){_0xe5e7x9[_0x5966[12]](200)[_0x5966[11]](_0xe5e7xb)})[_0x5966[10]](function(_0xe5e7xa){return handleError(_0xe5e7x9,_0xe5e7xa)})}};exports[_0x5966[24]]= function(_0xe5e7x8,_0xe5e7x9){return MailQueue[_0x5966[22]](_0x5966[21])[_0x5966[18]](_0xe5e7x8[_0x5966[26]][_0x5966[16]])[_0x5966[13]](function(_0xe5e7xc){if(!_0xe5e7xc){return _0xe5e7x9[_0x5966[25]](404)};return _0xe5e7x9[_0x5966[11]](_0xe5e7xc)})[_0x5966[10]](function(_0xe5e7xa){return handleError(_0xe5e7x9,_0xe5e7xa)})};exports[_0x5966[27]]= function(_0xe5e7x8,_0xe5e7x9){return MailQueue[_0x5966[27]](_0xe5e7x8[_0x5966[30]])[_0x5966[13]](function(_0xe5e7xc){return _0xe5e7x9[_0x5966[12]](201)[_0x5966[11]](_0xe5e7xc)})[_0x5966[10]](sequelize.UniqueConstraintError,function(_0xe5e7xa){return Util[_0x5966[29]][_0x5966[28]](_0xe5e7x9,_0xe5e7xa)})[_0x5966[10]](function(_0xe5e7xa){return handleError(_0xe5e7x9,_0xe5e7xa)})};exports[_0x5966[31]]= function(_0xe5e7x8,_0xe5e7x9){if(_0xe5e7x8[_0x5966[30]][_0x5966[16]]){delete _0xe5e7x8[_0x5966[30]][_0x5966[16]]};return MailQueue[_0x5966[18]](_0xe5e7x8[_0x5966[26]][_0x5966[16]])[_0x5966[13]](function(_0xe5e7xc){if(!_0xe5e7xc){return _0xe5e7x9[_0x5966[25]](404)};var _0xe5e7xd=_[_0x5966[32]](_0xe5e7xc,_0xe5e7x8[_0x5966[30]]);return _0xe5e7xd[_0x5966[33]]()})[_0x5966[13]](function(_0xe5e7xc){return _0xe5e7x9[_0x5966[12]](200)[_0x5966[11]](_0xe5e7xc)})[_0x5966[10]](sequelize.UniqueConstraintError,function(_0xe5e7xa){return Util[_0x5966[29]][_0x5966[28]](_0xe5e7x9,_0xe5e7xa)})[_0x5966[10]](function(_0xe5e7xa){return handleError(_0xe5e7x9,_0xe5e7xa)})};exports[_0x5966[34]]= function(_0xe5e7x8,_0xe5e7x9,_0xe5e7xe){return MailQueue[_0x5966[18]](_0xe5e7x8[_0x5966[26]][_0x5966[16]])[_0x5966[13]](function(_0xe5e7xc){if(!_0xe5e7xc){return _0xe5e7x9[_0x5966[25]](404)};var _0xe5e7xf=_[_0x5966[38]](_0xe5e7x8[_0x5966[30]][_0x5966[35]],function(_0xe5e7x10){return {UserId:_0xe5e7x10,penalty:_0xe5e7x8[_0x5966[30]][_0x5966[36]],MailQueueId:_0xe5e7xc[_0x5966[16]],queue:_0xe5e7xc[_0x5966[37]]}});return UserHasMailQueue[_0x5966[39]](_0xe5e7xf,{individualHooks:true})})[_0x5966[13]](function(){return _0xe5e7x9[_0x5966[25]](200)})[_0x5966[10]](function(_0xe5e7xa){return handleError(_0xe5e7x9,_0xe5e7xa)})};exports[_0x5966[40]]= function(_0xe5e7x8,_0xe5e7x9){return MailQueue[_0x5966[18]](_0xe5e7x8[_0x5966[26]][_0x5966[16]])[_0x5966[13]](function(_0xe5e7x11){if(!_0xe5e7x11){return _0xe5e7x9[_0x5966[25]](404)};return _0xe5e7x11[_0x5966[41]](_0xe5e7x8[_0x5966[14]][_0x5966[35]],{individualHooks:true})})[_0x5966[13]](function(){return _0xe5e7x9[_0x5966[25]](200)})[_0x5966[10]](function(_0xe5e7xa){return handleError(_0xe5e7x9,_0xe5e7xa)})};exports[_0x5966[42]]= function(_0xe5e7x8,_0xe5e7x9){var _0xe5e7x12;return MailQueue[_0x5966[18]](_0xe5e7x8[_0x5966[26]][_0x5966[16]])[_0x5966[13]](function(_0xe5e7xc){_0xe5e7x12= _0xe5e7xc;if(!_0xe5e7xc){return _0xe5e7x9[_0x5966[25]](404)};return _0xe5e7xc[_0x5966[42]]()})[_0x5966[13]](function(){return _0xe5e7x9[_0x5966[25]](204)})[_0x5966[10]](sequelize.ForeignKeyConstraintError,function(_0xe5e7xa){return Util[_0x5966[29]][_0x5966[46]](_0xe5e7x9,_0x5966[45],_0xe5e7x12[_0x5966[37]],_0xe5e7xa)})[_0x5966[10]](function(_0xe5e7xa){console[_0x5966[44]](_0x5966[43],_0xe5e7xa);return handleError(_0xe5e7x9,_0xe5e7xa)})};exports[_0x5966[47]]= function(_0xe5e7x8,_0xe5e7x9){return MailQueue[_0x5966[42]]({where:{id:_0xe5e7x8[_0x5966[14]][_0x5966[48]]},individualHooks:true})[_0x5966[13]](function(){return _0xe5e7x9[_0x5966[25]](204)})[_0x5966[10]](function(_0xe5e7xa){return handleError(_0xe5e7x9,_0xe5e7xa)})};exports[_0x5966[49]]= function(_0xe5e7x8,_0xe5e7x9){return MailQueue[_0x5966[18]](_0xe5e7x8[_0x5966[26]][_0x5966[16]])[_0x5966[13]](function(_0xe5e7x11){if(!_0xe5e7x11){return _0xe5e7x9[_0x5966[25]](404)};return _0xe5e7x11[_0x5966[54]]({where:{role:_0x5966[51]},attributes:[_0x5966[16],_0x5966[37],_0x5966[52],_0x5966[53]]})})[_0x5966[13]](function(_0xe5e7x13){return _0xe5e7x9[_0x5966[12]](200)[_0x5966[11]]({rows:_0xe5e7x13,count:_0xe5e7x13[_0x5966[50]]})})[_0x5966[10]](function(_0xe5e7xa){return handleError(_0xe5e7x9,_0xe5e7xa)})};function handleError(_0xe5e7x9,_0xe5e7xa){return _0xe5e7x9[_0x5966[12]](500)[_0x5966[11]](_0xe5e7xa)}
\ No newline at end of file