Built motion from commit fa8c70b.|0.0.144
[motion.git] / server / api / mail_room / mail_room.controller.js
index c984a68..2cf7114 100644 (file)
@@ -1 +1 @@
-var _0xad07=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x68\x74\x6D\x6C\x2D\x74\x6F\x2D\x74\x65\x78\x74","\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","\x55\x73\x65\x72","\x43\x6F\x6E\x74\x61\x63\x74","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\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","\x69\x6E\x62\x6F\x78","\x65\x72\x72\x6F\x72","\x53\x45\x4C\x45\x43\x54\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x69\x64\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x73\x75\x62\x6A\x65\x63\x74\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x66\x72\x6F\x6D\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x61\x63\x63\x6F\x75\x6E\x74\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x73\x74\x61\x74\x75\x73\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x6C\x61\x73\x74\x45\x76\x65\x6E\x74\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x75\x70\x64\x61\x74\x65\x64\x41\x74\x60\x20\x46\x52\x4F\x4D\x20\x60\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x41\x53\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x20\x4C\x45\x46\x54\x20\x4F\x55\x54\x45\x52\x20\x4A\x4F\x49\x4E\x20\x28\x60\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x41\x53\x20\x60\x55\x73\x65\x72\x73\x2E\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x49\x4E\x4E\x45\x52\x20\x4A\x4F\x49\x4E\x20\x60\x75\x73\x65\x72\x73\x60\x20\x41\x53\x20\x60\x55\x73\x65\x72\x73\x60\x20\x4F\x4E\x20\x60\x55\x73\x65\x72\x73\x60\x2E\x60\x69\x64\x60\x20\x3D\x20\x60\x55\x73\x65\x72\x73\x2E\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x2E\x60\x55\x73\x65\x72\x49\x64\x60\x29\x20\x4F\x4E\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x69\x64\x60\x20\x3D\x20\x60\x55\x73\x65\x72\x73\x2E\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x2E\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x49\x64\x60\x20\x57\x48\x45\x52\x45\x20\x28\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x64\x65\x6C\x65\x74\x65\x64\x41\x74\x60\x20\x49\x53\x20\x4E\x55\x4C\x4C\x20\x41\x4E\x44\x20\x28\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x73\x74\x61\x74\x75\x73\x60\x20\x3D\x20\x3A\x73\x74\x61\x74\x75\x73\x20\x4F\x52\x20\x60\x55\x73\x65\x72\x73\x60\x2E\x60\x69\x64\x60\x20\x3D\x20\x3A\x69\x64\x29\x29","\x55\x4E\x4D\x41\x4E\x41\x47\x45\x44","\x69\x64","\x75\x73\x65\x72","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x61\x67\x65\x6E\x74","\x53\x45\x4C\x45\x43\x54\x20\x60\x69\x64\x60\x2C\x20\x60\x73\x75\x62\x6A\x65\x63\x74\x60\x2C\x20\x60\x66\x72\x6F\x6D\x60\x2C\x20\x60\x61\x63\x63\x6F\x75\x6E\x74\x60\x2C\x20\x60\x73\x74\x61\x74\x75\x73\x60\x2C\x20\x60\x6C\x61\x73\x74\x45\x76\x65\x6E\x74\x60\x20\x2C\x60\x75\x70\x64\x61\x74\x65\x64\x41\x74\x60\x20\x46\x52\x4F\x4D\x20\x60\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x57\x48\x45\x52\x45\x20\x60\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x2E\x60\x64\x65\x6C\x65\x74\x65\x64\x41\x74\x60\x20\x49\x53\x20\x4E\x55\x4C\x4C","\x72\x6F\x6C\x65","\x61\x67\x65\x6E\x74\x49\x6E\x64\x65\x78","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x41\x6C\x6C","\x6F\x70\x65\x6E","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x61\x64\x64\x55\x73\x65\x72","\x4F\x50\x45\x4E","\x75\x70\x64\x61\x74\x65","\x66\x69\x6E\x64\x42\x79\x49\x64","\x67\x65\x74\x52\x6F\x6F\x6D\x42\x79\x4D\x65\x73\x73\x61\x67\x65","\x6E\x61\x6D\x65","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x67\x65\x74\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x73\x68\x6F\x77","\x73\x68\x6F\x77\x41\x67\x65\x6E\x74\x73","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x67\x65\x74\x55\x73\x65\x72\x73","\x63\x72\x65\x61\x74\x65","\x62\x6F\x64\x79","\x63\x72\x65\x61\x74\x65\x4D\x65\x73\x73\x61\x67\x65","\x55\x73\x65\x72\x49\x64","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x49\x64","\x61\x74\x74\x61\x63\x68\x6D\x65\x6E\x74","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x73","\x6C\x65\x6E\x67\x74\x68","\x74\x65\x78\x74","\x68\x74\x6D\x6C","\x66\x72\x6F\x6D\x53\x74\x72\x69\x6E\x67","\x75\x70\x64\x61\x74\x65\x50\x61\x74\x63\x68","\x74\x61\x67\x73","\x2C","\x73\x70\x6C\x69\x74","\x75\x70\x64\x61\x74\x65\x41\x67\x65\x6E\x74\x73","\x61\x67\x65\x6E\x74\x73","\x73\x65\x74\x55\x73\x65\x72\x73","\x64\x65\x73\x74\x72\x6F\x79","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73"];_0xad07[0];var _=require(_0xad07[1]);var util=require(_0xad07[2]);var htmlToText=require(_0xad07[3]);var Util=require(_0xad07[4]);var sequelize=require(_0xad07[6])[_0xad07[5]];var User=require(_0xad07[6])[_0xad07[7]];var Agent=require(_0xad07[6])[_0xad07[7]];var Contact=require(_0xad07[6])[_0xad07[8]];var MailRoom=require(_0xad07[6])[_0xad07[9]];var MailMessage=require(_0xad07[6])[_0xad07[10]];var MailAccount=require(_0xad07[6])[_0xad07[11]];var MailAttachment=require(_0xad07[6])[_0xad07[12]];var ReportMailRoom=require(_0xad07[6])[_0xad07[13]];exports[_0xad07[14]]=function(_0x49f9xe,_0x49f9xf,_0x49f9x10){return MailRoom[_0xad07[23]](_0xad07[22])[_0xad07[21]](Util[_0xad07[20]](_0x49f9xe[_0xad07[19]]))[_0xad07[18]](function(_0x49f9x12){return _0x49f9xf[_0xad07[17]](200)[_0xad07[16]](_0x49f9x12)})[_0xad07[15]](function(_0x49f9x11){return handleError(_0x49f9xf,_0x49f9x11)})};exports[_0xad07[24]]=function(_0x49f9xe,_0x49f9xf,_0x49f9x10){switch(_0x49f9xe[_0xad07[29]][_0xad07[34]]){case _0xad07[32]:return sequelize[_0xad07[19]](_0xad07[26],{replacements:{status:_0xad07[27],id:_0x49f9xe[_0xad07[29]][_0xad07[28]]},type:sequelize[_0xad07[31]][_0xad07[30]]})[_0xad07[18]](function(_0x49f9x12){return _0x49f9xf[_0xad07[17]](200)[_0xad07[16]](_0x49f9x12)})[_0xad07[15]](function(_0x49f9x11){console[_0xad07[25]](_0x49f9x11);return handleError(_0x49f9xf,_0x49f9x11)});default:return sequelize[_0xad07[19]](_0xad07[33],{replacements:{status:_0xad07[27],id:_0x49f9xe[_0xad07[29]][_0xad07[28]]},type:sequelize[_0xad07[31]][_0xad07[30]]})[_0xad07[18]](function(_0x49f9x12){return _0x49f9xf[_0xad07[17]](200)[_0xad07[16]](_0x49f9x12)})[_0xad07[15]](function(_0x49f9x11){return handleError(_0x49f9xf,_0x49f9x11)})}};exports[_0xad07[35]]=function(_0x49f9xe,_0x49f9xf,_0x49f9x10){return MailRoom[_0xad07[37]]({where:{UserId:_0x49f9xe[_0xad07[36]][_0xad07[28]]},include:[{all:true}]})[_0xad07[18]](function(_0x49f9x13){return _0x49f9xf[_0xad07[17]](200)[_0xad07[16]](_0x49f9x13)})[_0xad07[15]](function(_0x49f9x11){return handleError(_0x49f9xf,_0x49f9x11)})};exports[_0xad07[38]]=function(_0x49f9xe,_0x49f9xf,_0x49f9x10){var _0x49f9x14;if(_0x49f9xe[_0xad07[29]][_0xad07[34]]===_0xad07[32]){return MailRoom[_0xad07[43]](_0x49f9xe[_0xad07[36]][_0xad07[28]])[_0xad07[18]](function(_0x49f9x15){_0x49f9x14=_0x49f9x15;if(!_0x49f9x14){return _0x49f9xf[_0xad07[39]](404)};return _0x49f9x14[_0xad07[42]]({status:_0xad07[41]},{userId:_0x49f9xe[_0xad07[29]][_0xad07[28]]})})[_0xad07[18]](function(){return _0x49f9x14[_0xad07[40]](_0x49f9xe[_0xad07[29]][_0xad07[28]])})[_0xad07[18]](function(){return _0x49f9xf[_0xad07[39]](200)})[_0xad07[15]](function(_0x49f9x11){return handleError(_0x49f9xf,_0x49f9x11)})}};exports[_0xad07[44]]=function(_0x49f9xe,_0x49f9xf,_0x49f9x10){return MailMessage[_0xad07[43]](_0x49f9xe[_0xad07[36]][_0xad07[28]])[_0xad07[18]](function(_0x49f9x16){return _0x49f9x16[_0xad07[48]]({include:[{model:MailAccount},{model:MailMessage,include:[{model:MailAttachment},{model:User,attributes:[_0xad07[28],_0xad07[45],_0xad07[46],_0xad07[47]]}]},{model:User,attributes:[_0xad07[28],_0xad07[45],_0xad07[46],_0xad07[47]]}]})})[_0xad07[18]](function(_0x49f9x15){return _0x49f9xf[_0xad07[16]](_0x49f9x15)})[_0xad07[15]](function(_0x49f9x11){return handleError(_0x49f9xf,_0x49f9x11)})};exports[_0xad07[49]]=function(_0x49f9xe,_0x49f9xf,_0x49f9x10){return MailRoom[_0xad07[23]](_0xad07[22])[_0xad07[43]](_0x49f9xe[_0xad07[36]][_0xad07[28]])[_0xad07[18]](function(_0x49f9x15){if(!_0x49f9x15){return _0x49f9xf[_0xad07[39]](404)};return _0x49f9xf[_0xad07[16]](_0x49f9x15)})[_0xad07[15]](function(_0x49f9x11){console[_0xad07[25]](_0x49f9x11);return handleError(_0x49f9xf,_0x49f9x11)})};exports[_0xad07[50]]=function(_0x49f9xe,_0x49f9xf,_0x49f9x10){return MailRoom[_0xad07[43]](_0x49f9xe[_0xad07[36]][_0xad07[28]])[_0xad07[18]](function(_0x49f9x15){if(!_0x49f9x15){return _0x49f9xf[_0xad07[39]](404)};return _0x49f9x15[_0xad07[52]]({attributes:[_0xad07[28],_0xad07[45],_0xad07[46],_0xad07[47],_0xad07[34],_0xad07[51]]})})[_0xad07[18]](function(_0x49f9x17){return _0x49f9xf[_0xad07[16]](_0x49f9x17)})[_0xad07[15]](function(_0x49f9x11){return handleError(_0x49f9xf,_0x49f9x11)})};exports[_0xad07[53]]=function(_0x49f9xe,_0x49f9xf,_0x49f9x10){return MailRoom[_0xad07[53]](_0x49f9xe[_0xad07[54]])[_0xad07[18]](function(_0x49f9x15){return _0x49f9xf[_0xad07[17]](201)[_0xad07[16]](_0x49f9x15)})[_0xad07[15]](function(_0x49f9x11){return handleError(_0x49f9xf,_0x49f9x11)})};exports[_0xad07[55]]=function(_0x49f9xe,_0x49f9xf,_0x49f9x10){_0x49f9xe[_0xad07[54]][_0xad07[56]]=_0x49f9xe[_0xad07[29]][_0xad07[28]];_0x49f9xe[_0xad07[54]][_0xad07[57]]=_0x49f9xe[_0xad07[36]][_0xad07[28]];_0x49f9xe[_0xad07[54]][_0xad07[58]]=(_0x49f9xe[_0xad07[54]][_0xad07[59]]&&_0x49f9xe[_0xad07[54]][_0xad07[59]][_0xad07[60]])?true:false;_0x49f9xe[_0xad07[54]][_0xad07[61]]=_0x49f9xe[_0xad07[54]][_0xad07[61]]||htmlToText[_0xad07[63]](_0x49f9xe[_0xad07[54]][_0xad07[62]],{wordwrap:false});return MailMessage[_0xad07[53]](_0x49f9xe[_0xad07[54]],{include:[{model:MailAttachment}],user:_0x49f9xe[_0xad07[29]]})[_0xad07[18]](function(_0x49f9x16){return _0x49f9xf[_0xad07[17]](201)[_0xad07[16]](_0x49f9x16)})[_0xad07[15]](function(_0x49f9x11){return handleError(_0x49f9xf,_0x49f9x11)})};exports[_0xad07[42]]=function(_0x49f9xe,_0x49f9xf,_0x49f9x10){var _0x49f9x14;return MailRoom[_0xad07[43]](_0x49f9xe[_0xad07[36]][_0xad07[28]])[_0xad07[18]](function(_0x49f9x15){if(!_0x49f9x15){return _0x49f9xf[_0xad07[39]](404)};return _0x49f9x15[_0xad07[42]](_0x49f9xe[_0xad07[54]])})[_0xad07[18]](function(_0x49f9x15){_0x49f9x14=_0x49f9x15;return ReportMailRoom[_0xad07[42]](_0x49f9xe[_0xad07[54]],{where:{roomId:_0x49f9xe[_0xad07[36]][_0xad07[28]]}})})[_0xad07[18]](function(_0x49f9x18){return _0x49f9xf[_0xad07[17]](200)[_0xad07[16]](_0x49f9x14)})[_0xad07[15]](function(_0x49f9x11){return handleError(_0x49f9xf,_0x49f9x11)})};exports[_0xad07[64]]=function(_0x49f9xe,_0x49f9xf,_0x49f9x10){var _0x49f9x19={tags:_0x49f9xe[_0xad07[54]][_0xad07[65]]};var _0x49f9x1a={where:{id:_0x49f9xe[_0xad07[36]][_0xad07[28]][_0xad07[67]](_0xad07[66])}};return MailRoom[_0xad07[42]](_0x49f9x19,_0x49f9x1a)[_0xad07[18]](function(_0x49f9x13){if(!_0x49f9x13){return _0x49f9xf[_0xad07[39]](404)};return _0x49f9x13})[_0xad07[18]](function(_0x49f9x13){return _0x49f9xf[_0xad07[39]](200)})[_0xad07[15]](function(_0x49f9x11){return handleError(_0x49f9xf,_0x49f9x11)})};exports[_0xad07[68]]=function(_0x49f9xe,_0x49f9xf,_0x49f9x10){return MailRoom[_0xad07[43]](_0x49f9xe[_0xad07[36]][_0xad07[28]])[_0xad07[18]](function(_0x49f9x15){if(!_0x49f9x15){return _0x49f9xf[_0xad07[39]](404)};return _0x49f9x15[_0xad07[70]](_0x49f9xe[_0xad07[54]][_0xad07[69]],{individualHooks:true})})[_0xad07[18]](function(){return _0x49f9xf[_0xad07[39]](200)})[_0xad07[15]](function(_0x49f9x11){return handleError(_0x49f9xf,_0x49f9x11)})};exports[_0xad07[71]]=function(_0x49f9xe,_0x49f9xf,_0x49f9x10){return MailRoom[_0xad07[43]](_0x49f9xe[_0xad07[36]][_0xad07[28]])[_0xad07[18]](function(_0x49f9x15){if(!_0x49f9x15){return _0x49f9xf[_0xad07[39]](404)};return _0x49f9x15[_0xad07[71]]()})[_0xad07[18]](function(){return _0x49f9xf[_0xad07[39]](204)})[_0xad07[15]](function(_0x49f9x11){return handleError(_0x49f9xf,_0x49f9x11)})};exports[_0xad07[72]]=function(_0x49f9xe,_0x49f9xf){return MailRoom[_0xad07[71]]({where:{id:_0x49f9xe[_0xad07[19]][_0xad07[73]]},individualHooks:true})[_0xad07[18]](function(){return _0x49f9xf[_0xad07[39]](200)})[_0xad07[15]](function(_0x49f9x11){return handleError(_0x49f9xf,_0x49f9x11)})};function handleError(_0x49f9xf,_0x49f9x11){return _0x49f9xf[_0xad07[17]](500)[_0xad07[16]](_0x49f9x11)}
\ No newline at end of file
+var _0xf341=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x68\x74\x6D\x6C\x2D\x74\x6F\x2D\x74\x65\x78\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x6D\x6F\x6D\x65\x6E\x74","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x43\x6F\x6E\x74\x61\x63\x74","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x53\x74\x61\x74\x75\x73","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74","\x4D\x61\x69\x6C\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x4D\x61\x69\x6C\x51\x75\x65\x75\x65","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74","\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","\x64\x65\x73\x63\x72\x69\x62\x65","\x69\x64","\x6D\x61\x70","\x67\x65\x74\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x75\x73\x65\x72","\x72\x6F\x6C\x65","\x70\x65\x6E\x64\x69\x6E\x67","\x6C\x6F\x67","\x50\x45\x4E\x44\x49\x4E\x47","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x6D\x65\x72\x67\x65","\x63\x6F\x75\x6E\x74","\x61\x6C\x6C","\x6E\x65\x77","\x4E\x45\x57","\x6F\x70\x65\x6E","\x4F\x50\x45\x4E","\x63\x6C\x6F\x73\x65\x64","\x43\x4C\x4F\x53\x45\x44","\x69\x6E\x62\x6F\x78","\x65\x72\x72\x6F\x72","\x53\x45\x4C\x45\x43\x54\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x69\x64\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x73\x75\x62\x6A\x65\x63\x74\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x66\x72\x6F\x6D\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x61\x63\x63\x6F\x75\x6E\x74\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x73\x74\x61\x74\x75\x73\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x6C\x61\x73\x74\x45\x76\x65\x6E\x74\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x75\x70\x64\x61\x74\x65\x64\x41\x74\x60\x20\x46\x52\x4F\x4D\x20\x60\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x41\x53\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x20\x4C\x45\x46\x54\x20\x4F\x55\x54\x45\x52\x20\x4A\x4F\x49\x4E\x20\x28\x60\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x41\x53\x20\x60\x55\x73\x65\x72\x73\x2E\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x49\x4E\x4E\x45\x52\x20\x4A\x4F\x49\x4E\x20\x60\x75\x73\x65\x72\x73\x60\x20\x41\x53\x20\x60\x55\x73\x65\x72\x73\x60\x20\x4F\x4E\x20\x60\x55\x73\x65\x72\x73\x60\x2E\x60\x69\x64\x60\x20\x3D\x20\x60\x55\x73\x65\x72\x73\x2E\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x2E\x60\x55\x73\x65\x72\x49\x64\x60\x29\x20\x4F\x4E\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x69\x64\x60\x20\x3D\x20\x60\x55\x73\x65\x72\x73\x2E\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x2E\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x49\x64\x60\x20\x57\x48\x45\x52\x45\x20\x28\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x64\x65\x6C\x65\x74\x65\x64\x41\x74\x60\x20\x49\x53\x20\x4E\x55\x4C\x4C\x20\x41\x4E\x44\x20\x28\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x73\x74\x61\x74\x75\x73\x60\x20\x3D\x20\x3A\x73\x74\x61\x74\x75\x73\x20\x4F\x52\x20\x60\x55\x73\x65\x72\x73\x60\x2E\x60\x69\x64\x60\x20\x3D\x20\x3A\x69\x64\x29\x29","\x55\x4E\x4D\x41\x4E\x41\x47\x45\x44","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x61\x67\x65\x6E\x74","\x53\x45\x4C\x45\x43\x54\x20\x60\x69\x64\x60\x2C\x20\x60\x73\x75\x62\x6A\x65\x63\x74\x60\x2C\x20\x60\x66\x72\x6F\x6D\x60\x2C\x20\x60\x61\x63\x63\x6F\x75\x6E\x74\x60\x2C\x20\x60\x73\x74\x61\x74\x75\x73\x60\x2C\x20\x60\x6C\x61\x73\x74\x45\x76\x65\x6E\x74\x60\x20\x2C\x60\x75\x70\x64\x61\x74\x65\x64\x41\x74\x60\x20\x46\x52\x4F\x4D\x20\x60\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x57\x48\x45\x52\x45\x20\x60\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x2E\x60\x64\x65\x6C\x65\x74\x65\x64\x41\x74\x60\x20\x49\x53\x20\x4E\x55\x4C\x4C","\x61\x67\x65\x6E\x74\x49\x6E\x64\x65\x78","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x41\x6C\x6C","\x75\x70\x64\x61\x74\x65\x52\x6F\x6F\x6D\x53\x74\x61\x74\x75\x73","\x62\x6F\x64\x79","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x2C","\x73\x70\x6C\x69\x74","\x6E\x61\x6D\x65","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x75\x70\x64\x61\x74\x65","\x67\x65\x74\x52\x6F\x6F\x6D\x42\x79\x4D\x65\x73\x73\x61\x67\x65","\x65\x6D\x61\x69\x6C","\x67\x65\x74\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x73\x68\x6F\x77","\x73\x68\x6F\x77\x41\x67\x65\x6E\x74\x73","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x67\x65\x74\x55\x73\x65\x72\x73","\x63\x72\x65\x61\x74\x65","\x73\x65\x6E\x64\x4D\x65\x73\x73\x61\x67\x65","\x55\x73\x65\x72\x49\x64","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x49\x64","\x61\x74\x74\x61\x63\x68\x6D\x65\x6E\x74","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x73","\x6C\x65\x6E\x67\x74\x68","\x74\x65\x78\x74","\x68\x74\x6D\x6C","\x66\x72\x6F\x6D\x53\x74\x72\x69\x6E\x67","\x61\x63\x63\x6F\x75\x6E\x74\x49\x64","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74\x49\x64","\x75\x70\x64\x61\x74\x65\x50\x61\x74\x63\x68","\x75\x70\x64\x61\x74\x65\x41\x67\x65\x6E\x74\x73","\x61\x67\x65\x6E\x74\x73","\x73\x65\x74\x55\x73\x65\x72\x73","\x64\x65\x73\x74\x72\x6F\x79","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73"];_0xf341[0];var _=require(_0xf341[1]);var util=require(_0xf341[2]);var htmlToText=require(_0xf341[3]);var Util=require(_0xf341[4]);var moment=require(_0xf341[5]);var sequelize=require(_0xf341[7])[_0xf341[6]];var User=require(_0xf341[7])[_0xf341[8]];var Agent=require(_0xf341[7])[_0xf341[8]];var Contact=require(_0xf341[7])[_0xf341[9]];var Status=require(_0xf341[7])[_0xf341[10]];var MailRoom=require(_0xf341[7])[_0xf341[11]];var MailMessage=require(_0xf341[7])[_0xf341[12]];var MailAccount=require(_0xf341[7])[_0xf341[13]];var MailApplication=require(_0xf341[7])[_0xf341[14]];var MailQueue=require(_0xf341[7])[_0xf341[15]];var MailAttachment=require(_0xf341[7])[_0xf341[16]];exports[_0xf341[17]]= function(_0xf7cbx11,_0xf7cbx12,_0xf7cbx13){return MailRoom[_0xf341[26]](_0xf341[25])[_0xf341[24]](Util[_0xf341[23]](_0xf7cbx11[_0xf341[22]]))[_0xf341[21]](function(_0xf7cbx15){return _0xf7cbx12[_0xf341[20]](200)[_0xf341[19]](_0xf7cbx15)})[_0xf341[18]](function(_0xf7cbx14){return handleError(_0xf7cbx12,_0xf7cbx14)})};exports[_0xf341[27]]= function(_0xf7cbx11,_0xf7cbx12){return MailRoom[_0xf341[27]]()[_0xf341[21]](function(_0xf7cbx16){return _0xf7cbx12[_0xf341[20]](200)[_0xf341[19]](_0xf7cbx16)})[_0xf341[18]](function(_0xf7cbx14){return handleError(_0xf7cbx12,_0xf7cbx14)})};function getMailQueues(_0xf7cbx18){return function(){switch(_0xf7cbx18[_0xf341[33]]){case _0xf341[32]:return User[_0xf341[31]](_0xf7cbx18[_0xf341[28]],{attributes:[_0xf341[28]]})[_0xf341[21]](Util[_0xf341[30]]({},{attributes:[_0xf341[28]]}))[_0xf341[21]](function(_0xf7cbx19){return {include:{model:MailAccount,include:{model:MailApplication,include:{model:MailQueue,where:{id:_[_0xf341[29]](_0xf7cbx19,_0xf341[28])}}}}}});default:return {}}}}exports[_0xf341[34]]= function(_0xf7cbx11,_0xf7cbx12){return Promise[_0xf341[41]]([])[_0xf341[21]](getMailQueues(_0xf7cbx11[_0xf341[32]]))[_0xf341[21]](function(_0xf7cbx1b){return MailRoom[_0xf341[40]](_[_0xf341[39]](Util[_0xf341[23]](_0xf7cbx11[_0xf341[22]],{status:_0xf341[36],updatedAt:{$gte:moment()[_0xf341[38]](_0xf341[37])}}),_0xf7cbx1b))})[_0xf341[21]](function(_0xf7cbx1a){return _0xf7cbx12[_0xf341[20]](200)[_0xf341[19]]({value:_0xf7cbx1a})})[_0xf341[18]](function(_0xf7cbx14){console[_0xf341[35]](_0xf7cbx14);return handleError(_0xf7cbx12,_0xf7cbx14)})};exports[_0xf341[42]]= function(_0xf7cbx11,_0xf7cbx12){return Promise[_0xf341[41]]([])[_0xf341[21]](getMailQueues(_0xf7cbx11[_0xf341[32]]))[_0xf341[21]](function(_0xf7cbx1b){return MailRoom[_0xf341[40]](_[_0xf341[39]](Util[_0xf341[23]](_0xf7cbx11[_0xf341[22]],{status:_0xf341[43],updatedAt:{$gte:moment()[_0xf341[38]](_0xf341[37])}}),_0xf7cbx1b))})[_0xf341[21]](function(_0xf7cbx1a){return _0xf7cbx12[_0xf341[20]](200)[_0xf341[19]]({value:_0xf7cbx1a})})[_0xf341[18]](function(_0xf7cbx14){console[_0xf341[35]](_0xf7cbx14);return handleError(_0xf7cbx12,_0xf7cbx14)})};exports[_0xf341[44]]= function(_0xf7cbx11,_0xf7cbx12){return Promise[_0xf341[41]]([])[_0xf341[21]](getMailQueues(_0xf7cbx11[_0xf341[32]]))[_0xf341[21]](function(_0xf7cbx1b){return MailRoom[_0xf341[40]](_[_0xf341[39]](Util[_0xf341[23]](_0xf7cbx11[_0xf341[22]],{status:_0xf341[45],updatedAt:{$gte:moment()[_0xf341[38]](_0xf341[37])}}),_0xf7cbx1b))})[_0xf341[21]](function(_0xf7cbx1a){return _0xf7cbx12[_0xf341[20]](200)[_0xf341[19]]({value:_0xf7cbx1a})})[_0xf341[18]](function(_0xf7cbx14){console[_0xf341[35]](_0xf7cbx14);return handleError(_0xf7cbx12,_0xf7cbx14)})};exports[_0xf341[46]]= function(_0xf7cbx11,_0xf7cbx12){return Promise[_0xf341[41]]([])[_0xf341[21]](getMailQueues(_0xf7cbx11[_0xf341[32]]))[_0xf341[21]](function(_0xf7cbx1b){return MailRoom[_0xf341[40]](_[_0xf341[39]](Util[_0xf341[23]](_0xf7cbx11[_0xf341[22]],{status:_0xf341[47],updatedAt:{$gte:moment()[_0xf341[38]](_0xf341[37])}}),_0xf7cbx1b))})[_0xf341[21]](function(_0xf7cbx1a){return _0xf7cbx12[_0xf341[20]](200)[_0xf341[19]]({value:_0xf7cbx1a})})[_0xf341[18]](function(_0xf7cbx14){console[_0xf341[35]](_0xf7cbx14);return handleError(_0xf7cbx12,_0xf7cbx14)})};exports[_0xf341[48]]= function(_0xf7cbx11,_0xf7cbx12,_0xf7cbx13){switch(_0xf7cbx11[_0xf341[32]][_0xf341[33]]){case _0xf341[54]:return sequelize[_0xf341[22]](_0xf341[50],{replacements:{status:_0xf341[51],id:_0xf7cbx11[_0xf341[32]][_0xf341[28]]},type:sequelize[_0xf341[53]][_0xf341[52]]})[_0xf341[21]](function(_0xf7cbx15){return _0xf7cbx12[_0xf341[20]](200)[_0xf341[19]](_0xf7cbx15)})[_0xf341[18]](function(_0xf7cbx14){console[_0xf341[49]](_0xf7cbx14);return handleError(_0xf7cbx12,_0xf7cbx14)});default:return sequelize[_0xf341[22]](_0xf341[55],{replacements:{status:_0xf341[51],id:_0xf7cbx11[_0xf341[32]][_0xf341[28]]},type:sequelize[_0xf341[53]][_0xf341[52]]})[_0xf341[21]](function(_0xf7cbx15){return _0xf7cbx12[_0xf341[20]](200)[_0xf341[19]](_0xf7cbx15)})[_0xf341[18]](function(_0xf7cbx14){return handleError(_0xf7cbx12,_0xf7cbx14)})}};exports[_0xf341[56]]= function(_0xf7cbx11,_0xf7cbx12,_0xf7cbx13){return MailRoom[_0xf341[58]]({where:{UserId:_0xf7cbx11[_0xf341[57]][_0xf341[28]]},include:[{all:true}]})[_0xf341[21]](function(_0xf7cbx1c){return _0xf7cbx12[_0xf341[20]](200)[_0xf341[19]](_0xf7cbx1c)})[_0xf341[18]](function(_0xf7cbx14){return handleError(_0xf7cbx12,_0xf7cbx14)})};exports[_0xf341[59]]= function(_0xf7cbx11,_0xf7cbx12,_0xf7cbx13){var _0xf7cbx1d;var _0xf7cbx1e=[];console[_0xf341[35]](_0xf7cbx11[_0xf341[60]]);console[_0xf341[35]](_0xf7cbx11[_0xf341[57]]);return MailRoom[_0xf341[67]](_0xf7cbx11[_0xf341[60]],{where:{id:_0xf7cbx11[_0xf341[57]][_0xf341[28]][_0xf341[63]](_0xf341[62])},individualHooks:true})[_0xf341[21]](function(){return Status[_0xf341[66]](_[_0xf341[29]](_0xf7cbx11[_0xf341[57]][_0xf341[28]][_0xf341[63]](_0xf341[62]),function(_0xf7cbx1f){return {status:_0xf7cbx11[_0xf341[60]][_0xf341[20]],data1:_0xf7cbx11[_0xf341[32]][_0xf341[64]],data2:_0xf7cbx11[_0xf341[32]][_0xf341[65]],MailRoomId:_0xf7cbx1f,UserId:_0xf7cbx11[_0xf341[32]][_0xf341[28]]}}))})[_0xf341[21]](function(_0xf7cbx1c){return _0xf7cbx12[_0xf341[61]](200)})[_0xf341[18]](function(_0xf7cbx14){return handleError(_0xf7cbx12,_0xf7cbx14)})};exports[_0xf341[68]]= function(_0xf7cbx11,_0xf7cbx12,_0xf7cbx13){return MailMessage[_0xf341[31]](_0xf7cbx11[_0xf341[57]][_0xf341[28]])[_0xf341[21]](function(_0xf7cbx21){return _0xf7cbx21[_0xf341[70]]({include:[{model:MailAccount},{model:MailMessage,include:[{model:MailAttachment},{model:User,attributes:[_0xf341[28],_0xf341[64],_0xf341[65],_0xf341[69]]}]},{model:User,attributes:[_0xf341[28],_0xf341[64],_0xf341[65],_0xf341[69]]}]})})[_0xf341[21]](function(_0xf7cbx20){return _0xf7cbx12[_0xf341[19]](_0xf7cbx20)})[_0xf341[18]](function(_0xf7cbx14){return handleError(_0xf7cbx12,_0xf7cbx14)})};exports[_0xf341[71]]= function(_0xf7cbx11,_0xf7cbx12,_0xf7cbx13){return MailRoom[_0xf341[26]](_0xf341[25])[_0xf341[31]](_0xf7cbx11[_0xf341[57]][_0xf341[28]])[_0xf341[21]](function(_0xf7cbx20){if(!_0xf7cbx20){return _0xf7cbx12[_0xf341[61]](404)};return _0xf7cbx12[_0xf341[19]](_0xf7cbx20)})[_0xf341[18]](function(_0xf7cbx14){console[_0xf341[49]](_0xf7cbx14);return handleError(_0xf7cbx12,_0xf7cbx14)})};exports[_0xf341[72]]= function(_0xf7cbx11,_0xf7cbx12,_0xf7cbx13){return MailRoom[_0xf341[31]](_0xf7cbx11[_0xf341[57]][_0xf341[28]])[_0xf341[21]](function(_0xf7cbx20){if(!_0xf7cbx20){return _0xf7cbx12[_0xf341[61]](404)};return _0xf7cbx20[_0xf341[74]]({attributes:[_0xf341[28],_0xf341[64],_0xf341[65],_0xf341[69],_0xf341[33],_0xf341[73]]})})[_0xf341[21]](function(_0xf7cbx22){return _0xf7cbx12[_0xf341[19]](_0xf7cbx22)})[_0xf341[18]](function(_0xf7cbx14){return handleError(_0xf7cbx12,_0xf7cbx14)})};exports[_0xf341[75]]= function(_0xf7cbx11,_0xf7cbx12,_0xf7cbx13){return MailRoom[_0xf341[75]](_0xf7cbx11[_0xf341[60]])[_0xf341[21]](function(_0xf7cbx20){return _0xf7cbx12[_0xf341[20]](201)[_0xf341[19]](_0xf7cbx20)})[_0xf341[18]](function(_0xf7cbx14){return handleError(_0xf7cbx12,_0xf7cbx14)})};exports[_0xf341[76]]= function(_0xf7cbx11,_0xf7cbx12,_0xf7cbx13){_0xf7cbx11[_0xf341[60]][_0xf341[77]]= _0xf7cbx11[_0xf341[32]][_0xf341[28]];_0xf7cbx11[_0xf341[60]][_0xf341[78]]= _0xf7cbx11[_0xf341[57]][_0xf341[28]];_0xf7cbx11[_0xf341[60]][_0xf341[79]]= (_0xf7cbx11[_0xf341[60]][_0xf341[80]]&& _0xf7cbx11[_0xf341[60]][_0xf341[80]][_0xf341[81]])?true:false;_0xf7cbx11[_0xf341[60]][_0xf341[82]]= _0xf7cbx11[_0xf341[60]][_0xf341[82]]|| htmlToText[_0xf341[84]](_0xf7cbx11[_0xf341[60]][_0xf341[83]],{wordwrap:false});return MailRoom[_0xf341[31]](_0xf7cbx11[_0xf341[57]][_0xf341[28]])[_0xf341[21]](function(_0xf7cbx20){_0xf7cbx11[_0xf341[60]][_0xf341[85]]= _0xf7cbx20[_0xf341[86]];return MailMessage[_0xf341[75]](_0xf7cbx11[_0xf341[60]],{include:[{model:MailAttachment}],user:_0xf7cbx11[_0xf341[32]]})})[_0xf341[21]](function(_0xf7cbx21){return _0xf7cbx12[_0xf341[20]](201)[_0xf341[19]](_0xf7cbx21)})[_0xf341[18]](function(_0xf7cbx14){return handleError(_0xf7cbx12,_0xf7cbx14)})};exports[_0xf341[67]]= function(_0xf7cbx11,_0xf7cbx12,_0xf7cbx13){return MailRoom[_0xf341[31]](_0xf7cbx11[_0xf341[57]][_0xf341[28]])[_0xf341[21]](function(_0xf7cbx20){if(!_0xf7cbx20){return _0xf7cbx12[_0xf341[61]](404)};return _0xf7cbx20[_0xf341[67]](_0xf7cbx11[_0xf341[60]])})[_0xf341[21]](function(_0xf7cbx20){return _0xf7cbx12[_0xf341[20]](200)[_0xf341[19]](_0xf7cbx20)})[_0xf341[18]](function(_0xf7cbx14){return handleError(_0xf7cbx12,_0xf7cbx14)})};exports[_0xf341[87]]= function(_0xf7cbx11,_0xf7cbx12,_0xf7cbx13){var _0xf7cbx23={where:{id:_0xf7cbx11[_0xf341[57]][_0xf341[28]][_0xf341[63]](_0xf341[62])},user:_0xf7cbx11[_0xf341[32]],individualHooks:true};return MailRoom[_0xf341[67]](_0xf7cbx11[_0xf341[60]],_0xf7cbx23)[_0xf341[21]](function(_0xf7cbx1c){if(!_0xf7cbx1c){return _0xf7cbx12[_0xf341[61]](404)};return _0xf7cbx1c})[_0xf341[21]](function(_0xf7cbx1c){return _0xf7cbx12[_0xf341[61]](200)})[_0xf341[18]](function(_0xf7cbx14){return handleError(_0xf7cbx12,_0xf7cbx14)})};exports[_0xf341[88]]= function(_0xf7cbx11,_0xf7cbx12,_0xf7cbx13){return MailRoom[_0xf341[31]](_0xf7cbx11[_0xf341[57]][_0xf341[28]])[_0xf341[21]](function(_0xf7cbx20){if(!_0xf7cbx20){return _0xf7cbx12[_0xf341[61]](404)};return _0xf7cbx20[_0xf341[90]](_0xf7cbx11[_0xf341[60]][_0xf341[89]],{individualHooks:true})})[_0xf341[21]](function(){return _0xf7cbx12[_0xf341[61]](200)})[_0xf341[18]](function(_0xf7cbx14){return handleError(_0xf7cbx12,_0xf7cbx14)})};exports[_0xf341[91]]= function(_0xf7cbx11,_0xf7cbx12,_0xf7cbx13){return MailRoom[_0xf341[31]](_0xf7cbx11[_0xf341[57]][_0xf341[28]])[_0xf341[21]](function(_0xf7cbx20){if(!_0xf7cbx20){return _0xf7cbx12[_0xf341[61]](404)};return _0xf7cbx20[_0xf341[91]]()})[_0xf341[21]](function(){return _0xf7cbx12[_0xf341[61]](204)})[_0xf341[18]](function(_0xf7cbx14){return handleError(_0xf7cbx12,_0xf7cbx14)})};exports[_0xf341[92]]= function(_0xf7cbx11,_0xf7cbx12){return MailRoom[_0xf341[91]]({where:{id:_0xf7cbx11[_0xf341[22]][_0xf341[93]]},individualHooks:true})[_0xf341[21]](function(){return _0xf7cbx12[_0xf341[61]](200)})[_0xf341[18]](function(_0xf7cbx14){return handleError(_0xf7cbx12,_0xf7cbx14)})};function handleError(_0xf7cbx12,_0xf7cbx14){return _0xf7cbx12[_0xf341[20]](500)[_0xf341[19]](_0xf7cbx14)}
\ No newline at end of file