Built motion from commit bf7fe19.|0.0.148
[motion.git] / server / api / mail_queue / mail_queue.controller.js
index a7d063b..def75f4 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 _0x2ba0=["\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","\x6D\x65\x72\x67\x65","\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","\x61\x67\x65\x6E\x74\x73","\x62\x6F\x64\x79","\x70\x65\x6E\x61\x6C\x74\x79","\x6E\x61\x6D\x65","\x61\x64\x64\x55\x73\x65\x72\x73","\x75\x70\x64\x61\x74\x65","\x73\x61\x76\x65","\x61\x64\x64\x41\x67\x65\x6E\x74\x73","\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"];_0x2ba0[0];var _=require(_0x2ba0[1]);var util=require(_0x2ba0[2]);var Util=require(_0x2ba0[3]);var sequelize=require(_0x2ba0[5])[_0x2ba0[4]];var MailQueue=require(_0x2ba0[5])[_0x2ba0[6]];var User=require(_0x2ba0[5])[_0x2ba0[7]];var UserHasMailQueue=require(_0x2ba0[5])[_0x2ba0[8]];exports[_0x2ba0[9]]= function(_0xf020x8,_0xf020x9){switch(_0xf020x8[_0x2ba0[17]][_0x2ba0[24]]){case _0x2ba0[17]:return User[_0x2ba0[18]](_0xf020x8[_0x2ba0[17]][_0x2ba0[16]],{attributes:[_0x2ba0[16]]})[_0x2ba0[13]](Util[_0x2ba0[15]](_0xf020x8[_0x2ba0[14]]))[_0x2ba0[13]](function(_0xf020xb){_0xf020x9[_0x2ba0[12]](200)[_0x2ba0[11]](_0xf020xb)})[_0x2ba0[10]](function(_0xf020xa){return handleError(_0xf020x9,_0xf020xa)});default:return MailQueue[_0x2ba0[23]](_0x2ba0[22])[_0x2ba0[21]](_[_0x2ba0[20]](Util[_0x2ba0[19]](_0xf020x8[_0x2ba0[14]]),{distinct:true}))[_0x2ba0[13]](function(_0xf020xb){_0xf020x9[_0x2ba0[12]](200)[_0x2ba0[11]](_0xf020xb)})[_0x2ba0[10]](function(_0xf020xa){return handleError(_0xf020x9,_0xf020xa)})}};exports[_0x2ba0[25]]= function(_0xf020x8,_0xf020x9){return MailQueue[_0x2ba0[23]](_0x2ba0[22])[_0x2ba0[18]](_0xf020x8[_0x2ba0[27]][_0x2ba0[16]])[_0x2ba0[13]](function(_0xf020xc){if(!_0xf020xc){return _0xf020x9[_0x2ba0[26]](404)};return _0xf020x9[_0x2ba0[11]](_0xf020xc)})[_0x2ba0[10]](function(_0xf020xa){return handleError(_0xf020x9,_0xf020xa)})};exports[_0x2ba0[28]]= function(_0xf020x8,_0xf020x9){var _0xf020xd;return MailQueue[_0x2ba0[28]](_0xf020x8[_0x2ba0[32]])[_0x2ba0[13]](function(_0xf020xc){_0xf020xd= _0xf020xc;if(_0xf020x8[_0x2ba0[32]][_0x2ba0[31]]){return _0xf020xd[_0x2ba0[35]](_0xf020x8[_0x2ba0[32]][_0x2ba0[31]],{penalty:_0xf020x8[_0x2ba0[32]][_0x2ba0[33]]|| 0,queue:_0xf020xd[_0x2ba0[34]]})}})[_0x2ba0[13]](function(){return _0xf020x9[_0x2ba0[12]](201)[_0x2ba0[11]](_0xf020xd)})[_0x2ba0[10]](sequelize.UniqueConstraintError,function(_0xf020xa){return Util[_0x2ba0[30]][_0x2ba0[29]](_0xf020x9,_0xf020xa)})[_0x2ba0[10]](function(_0xf020xa){return handleError(_0xf020x9,_0xf020xa)})};exports[_0x2ba0[36]]= function(_0xf020x8,_0xf020x9){if(_0xf020x8[_0x2ba0[32]][_0x2ba0[16]]){delete _0xf020x8[_0x2ba0[32]][_0x2ba0[16]]};return MailQueue[_0x2ba0[18]](_0xf020x8[_0x2ba0[27]][_0x2ba0[16]])[_0x2ba0[13]](function(_0xf020xc){if(!_0xf020xc){return _0xf020x9[_0x2ba0[26]](404)};var _0xf020xe=_[_0x2ba0[20]](_0xf020xc,_0xf020x8[_0x2ba0[32]]);return _0xf020xe[_0x2ba0[37]]()})[_0x2ba0[13]](function(_0xf020xc){return _0xf020x9[_0x2ba0[12]](200)[_0x2ba0[11]](_0xf020xc)})[_0x2ba0[10]](sequelize.UniqueConstraintError,function(_0xf020xa){return Util[_0x2ba0[30]][_0x2ba0[29]](_0xf020x9,_0xf020xa)})[_0x2ba0[10]](function(_0xf020xa){return handleError(_0xf020x9,_0xf020xa)})};exports[_0x2ba0[38]]= function(_0xf020x8,_0xf020x9,_0xf020xf){return MailQueue[_0x2ba0[18]](_0xf020x8[_0x2ba0[27]][_0x2ba0[16]])[_0x2ba0[13]](function(_0xf020xc){if(!_0xf020xc){return _0xf020x9[_0x2ba0[26]](404)};var _0xf020x10=_[_0x2ba0[39]](_0xf020x8[_0x2ba0[32]][_0x2ba0[31]],function(_0xf020x11){return {UserId:_0xf020x11,penalty:_0xf020x8[_0x2ba0[32]][_0x2ba0[33]],MailQueueId:_0xf020xc[_0x2ba0[16]],queue:_0xf020xc[_0x2ba0[34]]}});return UserHasMailQueue[_0x2ba0[40]](_0xf020x10,{individualHooks:true})})[_0x2ba0[13]](function(){return _0xf020x9[_0x2ba0[26]](200)})[_0x2ba0[10]](function(_0xf020xa){return handleError(_0xf020x9,_0xf020xa)})};exports[_0x2ba0[41]]= function(_0xf020x8,_0xf020x9){return MailQueue[_0x2ba0[18]](_0xf020x8[_0x2ba0[27]][_0x2ba0[16]])[_0x2ba0[13]](function(_0xf020x12){if(!_0xf020x12){return _0xf020x9[_0x2ba0[26]](404)};return _0xf020x12[_0x2ba0[42]](_0xf020x8[_0x2ba0[14]][_0x2ba0[31]],{individualHooks:true})})[_0x2ba0[13]](function(){return _0xf020x9[_0x2ba0[26]](200)})[_0x2ba0[10]](function(_0xf020xa){return handleError(_0xf020x9,_0xf020xa)})};exports[_0x2ba0[43]]= function(_0xf020x8,_0xf020x9){var _0xf020xd;return MailQueue[_0x2ba0[18]](_0xf020x8[_0x2ba0[27]][_0x2ba0[16]])[_0x2ba0[13]](function(_0xf020xc){_0xf020xd= _0xf020xc;if(!_0xf020xc){return _0xf020x9[_0x2ba0[26]](404)};return _0xf020xc[_0x2ba0[43]]()})[_0x2ba0[13]](function(){return _0xf020x9[_0x2ba0[26]](204)})[_0x2ba0[10]](sequelize.ForeignKeyConstraintError,function(_0xf020xa){return Util[_0x2ba0[30]][_0x2ba0[47]](_0xf020x9,_0x2ba0[46],_0xf020xd[_0x2ba0[34]],_0xf020xa)})[_0x2ba0[10]](function(_0xf020xa){console[_0x2ba0[45]](_0x2ba0[44],_0xf020xa);return handleError(_0xf020x9,_0xf020xa)})};exports[_0x2ba0[48]]= function(_0xf020x8,_0xf020x9){return MailQueue[_0x2ba0[43]]({where:{id:_0xf020x8[_0x2ba0[14]][_0x2ba0[49]]},individualHooks:true})[_0x2ba0[13]](function(){return _0xf020x9[_0x2ba0[26]](204)})[_0x2ba0[10]](function(_0xf020xa){return handleError(_0xf020x9,_0xf020xa)})};exports[_0x2ba0[50]]= function(_0xf020x8,_0xf020x9){return MailQueue[_0x2ba0[18]](_0xf020x8[_0x2ba0[27]][_0x2ba0[16]])[_0x2ba0[13]](function(_0xf020x12){if(!_0xf020x12){return _0xf020x9[_0x2ba0[26]](404)};return _0xf020x12[_0x2ba0[55]]({where:{role:_0x2ba0[52]},attributes:[_0x2ba0[16],_0x2ba0[34],_0x2ba0[53],_0x2ba0[54]]})})[_0x2ba0[13]](function(_0xf020x13){return _0xf020x9[_0x2ba0[12]](200)[_0x2ba0[11]]({rows:_0xf020x13,count:_0xf020x13[_0x2ba0[51]]})})[_0x2ba0[10]](function(_0xf020xa){return handleError(_0xf020x9,_0xf020xa)})};function handleError(_0xf020x9,_0xf020xa){return _0xf020x9[_0x2ba0[12]](500)[_0x2ba0[11]](_0xf020xa)}
\ No newline at end of file