Built motion from commit 7767ffc.|0.0.132
[motion.git] / server / api / mail_room / mail_room.controller.js
index dc4f40c..eeaf345 100644 (file)
@@ -1 +1 @@
-var _0x34c2=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\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","\x69\x6E\x64\x65\x78","\x73\x75\x62\x6A\x65\x63\x74","\x66\x72\x6F\x6D","\x73\x74\x61\x74\x75\x73","\x70\x65\x72\x5F\x70\x61\x67\x65","\x71\x75\x65\x72\x79","\x70\x61\x67\x65","\x4E\x45\x57","\x4F\x50\x45\x4E","\x69\x64","\x6E\x61\x6D\x65","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x72\x6F\x6C\x65","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x75\x73\x65\x72","\x61\x67\x65\x6E\x74","\x77\x68\x65\x72\x65","\x69\x6E\x63\x6C\x75\x64\x65","\x6F\x72\x64\x65\x72","\x25\x73\x20\x25\x73","\x73\x6F\x72\x74\x5F\x62\x79","\x73\x6F\x72\x74\x5F\x6F\x72\x64\x65\x72","\x41\x53\x43","\x66\x6F\x72\x6D\x61\x74","\x24\x6F\x72","\x25","\x70\x75\x73\x68","\x66\x6F\x72\x45\x61\x63\x68","\x24","\x24\x6C\x69\x6B\x65","\x66\x6F\x72\x49\x6E","\x6C\x6F\x67","\x63\x61\x74\x63\x68","\x63\x6F\x75\x6E\x74","\x63\x65\x69\x6C","\x6F\x66\x66\x73\x65\x74","\x25\x73\x3A\x2F\x2F\x25\x73\x25\x73\x3F\x70\x61\x67\x65\x3D\x25\x64","\x70\x72\x6F\x74\x6F\x63\x6F\x6C","\x68\x6F\x73\x74","\x68\x65\x61\x64\x65\x72\x73","\x62\x61\x73\x65\x55\x72\x6C","\x72\x6F\x77\x73","\x73\x65\x6E\x64","\x74\x68\x65\x6E","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x61\x67\x65\x6E\x74\x49\x6E\x64\x65\x78","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x41\x6C\x6C","\x73\x68\x6F\x77","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x73\x68\x6F\x77\x41\x67\x65\x6E\x74\x73","\x67\x65\x74\x55\x73\x65\x72\x73","\x63\x72\x65\x61\x74\x65","\x62\x6F\x64\x79","\x75\x70\x64\x61\x74\x65","\x6A\x6F\x62\x49\x64","\x4D\x61\x69\x6C\x20\x61\x6C\x72\x65\x61\x64\x79\x20\x61\x73\x73\x69\x67\x6E\x65\x64","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\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"];_0x34c2[0];var _=require(_0x34c2[1]);var util=require(_0x34c2[2]);var User=require(_0x34c2[4])[_0x34c2[3]];var Contact=require(_0x34c2[4])[_0x34c2[5]];var MailRoom=require(_0x34c2[4])[_0x34c2[6]];var MailMessage=require(_0x34c2[4])[_0x34c2[7]];var MailAccount=require(_0x34c2[4])[_0x34c2[8]];var MailAttachment=require(_0x34c2[4])[_0x34c2[9]];exports[_0x34c2[10]]=function(_0x685ex9,_0x685exa,_0x685exb){var _0x685exc=[_0x34c2[11],_0x34c2[12],_0x34c2[13]];var _0x685exd=_0x685ex9[_0x34c2[15]][_0x34c2[14]]?parseInt(_0x685ex9[_0x34c2[15]][_0x34c2[14]],10):100;var _0x685exe=_0x685ex9[_0x34c2[15]][_0x34c2[16]]?parseInt(_0x685ex9[_0x34c2[15]][_0x34c2[16]],10):0;var _0x685exf={where:{$or:[{status:_0x34c2[17]},{status:_0x34c2[18]}]},include:[{model:User,attributes:[_0x34c2[19],_0x34c2[20],_0x34c2[21],_0x34c2[22],_0x34c2[23],_0x34c2[24]]},{model:MailAccount}],limit:_0x685exd,offset:_0x685exe*_0x685exd};if(_0x685ex9[_0x34c2[25]][_0x34c2[23]]===_0x34c2[26]){_0x685exf[_0x34c2[28]][0][_0x34c2[27]]={id:_0x685ex9[_0x34c2[25]][_0x34c2[19]]}};_[_0x34c2[41]](_0x685ex9[_0x34c2[15]],function(_0x685ex10,_0x685ex11){switch(_0x685ex11){case _0x34c2[14]:;case _0x34c2[16]:break ;;case _0x34c2[31]:_0x685exf[_0x34c2[29]]=util[_0x34c2[34]](_0x34c2[30],_0x685ex9[_0x34c2[15]][_0x34c2[31]],_0x685ex9[_0x34c2[15]][_0x34c2[32]]||_0x34c2[33])||null;break ;;case _0x34c2[32]:break ;;case _0x34c2[39]:_0x685exf[_0x34c2[27]][_0x34c2[35]]=[];_0x685exc[_0x34c2[38]](function(_0x685ex12){var _0x685ex13={};_0x685ex13[_0x685ex12]={$like:_0x34c2[36]+_0x685ex10+_0x34c2[36]};_0x685exf[_0x34c2[27]][_0x34c2[35]][_0x34c2[37]](_0x685ex13);});break ;;default:_0x685exf[_0x34c2[27]][_0x685ex11]={$like:{}};_0x685exf[_0x34c2[27]][_0x685ex11][_0x34c2[40]]=_0x34c2[36]+_0x685ex10+_0x34c2[36];;}});console[_0x34c2[42]](_0x34c2[15],_0x685exf);return MailRoom[_0x34c2[55]](_0x685exf)[_0x34c2[54]](function(_0x685ex15){console[_0x34c2[42]](_0x685ex15);var _0x685ex16=Math[_0x34c2[45]](_0x685ex15[_0x34c2[44]]/_0x685exd);var _0x685ex17=_0x685ex16>(_0x685exf[_0x34c2[46]]+1)?util[_0x34c2[34]](_0x34c2[47],_0x685ex9[_0x34c2[48]],_0x685ex9[_0x34c2[50]][_0x34c2[49]],_0x685ex9[_0x34c2[51]],_0x685exe+1):null;var _0x685ex18=_0x685exe>0?util[_0x34c2[34]](_0x34c2[47],_0x685ex9[_0x34c2[48]],_0x685ex9[_0x34c2[50]][_0x34c2[49]],_0x685ex9[_0x34c2[51]],_0x685exe-1):null;_0x685exa[_0x34c2[13]](200)[_0x34c2[53]]({count:_0x685ex15[_0x34c2[44]],mailRooms:_0x685ex15[_0x34c2[52]],next_page:_0x685ex17,previous_page:_0x685ex18,total_pages:_0x685ex16});})[_0x34c2[43]](function(_0x685ex14){return handleError(_0x685exa,_0x685ex14)});};exports[_0x34c2[56]]=function(_0x685ex9,_0x685exa,_0x685exb){return MailRoom[_0x34c2[58]]({where:{UserId:_0x685ex9[_0x34c2[57]][_0x34c2[19]]},include:[{all:true}]})[_0x34c2[54]](function(_0x685ex19){return _0x685exa[_0x34c2[13]](200)[_0x34c2[53]](_0x685ex19)})[_0x34c2[43]](function(_0x685ex14){return handleError(_0x685exa,_0x685ex14)})};exports[_0x34c2[59]]=function(_0x685ex9,_0x685exa,_0x685exb){return MailRoom[_0x34c2[61]](_0x685ex9[_0x34c2[57]][_0x34c2[19]],{include:[{model:MailMessage,include:[{model:MailAttachment}]},{model:MailAccount}]})[_0x34c2[54]](function(_0x685ex1a){if(!_0x685ex1a){return _0x685exa[_0x34c2[60]](404)};return _0x685exa[_0x34c2[53]](_0x685ex1a);})[_0x34c2[43]](function(_0x685ex14){return handleError(_0x685exa,_0x685ex14)})};exports[_0x34c2[62]]=function(_0x685ex9,_0x685exa,_0x685exb){return MailRoom[_0x34c2[61]](_0x685ex9[_0x34c2[57]][_0x34c2[19]])[_0x34c2[54]](function(_0x685ex1a){if(!_0x685ex1a){return _0x685exa[_0x34c2[60]](404)};return _0x685ex1a[_0x34c2[63]]({attributes:[_0x34c2[19],_0x34c2[20],_0x34c2[21],_0x34c2[22],_0x34c2[23],_0x34c2[24]]});})[_0x34c2[54]](function(_0x685ex1b){return _0x685exa[_0x34c2[53]](_0x685ex1b)})[_0x34c2[43]](function(_0x685ex14){return handleError(_0x685exa,_0x685ex14)})};exports[_0x34c2[64]]=function(_0x685ex9,_0x685exa,_0x685exb){return MailRoom[_0x34c2[64]](_0x685ex9[_0x34c2[65]])[_0x34c2[54]](function(_0x685ex1a){return _0x685exa[_0x34c2[13]](201)[_0x34c2[53]](_0x685ex1a)})[_0x34c2[43]](function(_0x685ex14){return handleError(_0x685exa,_0x685ex14)})};exports[_0x34c2[66]]=function(_0x685ex9,_0x685exa,_0x685exb){return MailRoom[_0x34c2[61]](_0x685ex9[_0x34c2[57]][_0x34c2[19]])[_0x34c2[54]](function(_0x685ex1a){if(!_0x685ex1a){return _0x685exa[_0x34c2[60]](404)};if(_0x685ex1a[_0x34c2[67]]){throw  new Error(_0x34c2[68])};var _0x685ex1c=_[_0x34c2[69]](_0x685ex1a,_0x685ex9[_0x34c2[65]]);return _0x685ex1c[_0x34c2[70]]();})[_0x34c2[54]](function(_0x685ex1a){return _0x685exa[_0x34c2[13]](200)[_0x34c2[53]](_0x685ex1a)})[_0x34c2[43]](function(_0x685ex14){return handleError(_0x685exa,_0x685ex14)})};exports[_0x34c2[71]]=function(_0x685ex9,_0x685exa,_0x685exb){return MailRoom[_0x34c2[61]](_0x685ex9[_0x34c2[57]][_0x34c2[19]])[_0x34c2[54]](function(_0x685ex1a){if(!_0x685ex1a){return _0x685exa[_0x34c2[60]](404)};return _0x685ex1a[_0x34c2[73]](_0x685ex9[_0x34c2[65]][_0x34c2[72]]);})[_0x34c2[54]](function(){return _0x685exa[_0x34c2[60]](200)})[_0x34c2[43]](function(_0x685ex14){return handleError(_0x685exa,_0x685ex14)})};exports[_0x34c2[74]]=function(_0x685ex9,_0x685exa,_0x685exb){return MailRoom[_0x34c2[61]](_0x685ex9[_0x34c2[57]][_0x34c2[19]])[_0x34c2[54]](function(_0x685ex1a){if(!_0x685ex1a){return _0x685exa[_0x34c2[60]](404)};return _0x685ex1a[_0x34c2[74]]();})[_0x34c2[54]](function(){return _0x685exa[_0x34c2[60]](204)})[_0x34c2[43]](function(_0x685ex14){return handleError(_0x685exa,_0x685ex14)})};exports[_0x34c2[75]]=function(_0x685ex9,_0x685exa){return MailRoom[_0x34c2[74]]({where:{id:_0x685ex9[_0x34c2[15]][_0x34c2[19]]},individualHooks:true})[_0x34c2[54]](function(){return _0x685exa[_0x34c2[60]](200)})[_0x34c2[43]](function(_0x685ex14){return handleError(_0x685exa,_0x685ex14)})};function handleError(_0x685exa,_0x685ex14){return _0x685exa[_0x34c2[13]](500)[_0x34c2[53]](_0x685ex14)}
\ No newline at end of file
+var _0x7f02=["\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","\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"];_0x7f02[0];var _=require(_0x7f02[1]);var util=require(_0x7f02[2]);var htmlToText=require(_0x7f02[3]);var Util=require(_0x7f02[4]);var moment=require(_0x7f02[5]);var sequelize=require(_0x7f02[7])[_0x7f02[6]];var User=require(_0x7f02[7])[_0x7f02[8]];var Agent=require(_0x7f02[7])[_0x7f02[8]];var Contact=require(_0x7f02[7])[_0x7f02[9]];var Status=require(_0x7f02[7])[_0x7f02[10]];var MailRoom=require(_0x7f02[7])[_0x7f02[11]];var MailMessage=require(_0x7f02[7])[_0x7f02[12]];var MailAccount=require(_0x7f02[7])[_0x7f02[13]];var MailApplication=require(_0x7f02[7])[_0x7f02[14]];var MailQueue=require(_0x7f02[7])[_0x7f02[15]];var MailAttachment=require(_0x7f02[7])[_0x7f02[16]];exports[_0x7f02[17]]= function(_0xb3d0x11,_0xb3d0x12,_0xb3d0x13){return MailRoom[_0x7f02[26]](_0x7f02[25])[_0x7f02[24]](Util[_0x7f02[23]](_0xb3d0x11[_0x7f02[22]]))[_0x7f02[21]](function(_0xb3d0x15){return _0xb3d0x12[_0x7f02[20]](200)[_0x7f02[19]](_0xb3d0x15)})[_0x7f02[18]](function(_0xb3d0x14){return handleError(_0xb3d0x12,_0xb3d0x14)})};exports[_0x7f02[27]]= function(_0xb3d0x11,_0xb3d0x12){return MailRoom[_0x7f02[27]]()[_0x7f02[21]](function(_0xb3d0x16){return _0xb3d0x12[_0x7f02[20]](200)[_0x7f02[19]](_0xb3d0x16)})[_0x7f02[18]](function(_0xb3d0x14){return handleError(_0xb3d0x12,_0xb3d0x14)})};function getMailQueues(_0xb3d0x18){return function(){switch(_0xb3d0x18[_0x7f02[33]]){case _0x7f02[32]:return User[_0x7f02[31]](_0xb3d0x18[_0x7f02[28]],{attributes:[_0x7f02[28]]})[_0x7f02[21]](Util[_0x7f02[30]]({},{attributes:[_0x7f02[28]]}))[_0x7f02[21]](function(_0xb3d0x19){return {include:{model:MailAccount,include:{model:MailApplication,include:{model:MailQueue,where:{id:_[_0x7f02[29]](_0xb3d0x19,_0x7f02[28])}}}}}});default:return {}}}}exports[_0x7f02[34]]= function(_0xb3d0x11,_0xb3d0x12){return Promise[_0x7f02[41]]([])[_0x7f02[21]](getMailQueues(_0xb3d0x11[_0x7f02[32]]))[_0x7f02[21]](function(_0xb3d0x1b){return MailRoom[_0x7f02[40]](_[_0x7f02[39]](Util[_0x7f02[23]](_0xb3d0x11[_0x7f02[22]],{status:_0x7f02[36],updatedAt:{$gte:moment()[_0x7f02[38]](_0x7f02[37])}}),_0xb3d0x1b))})[_0x7f02[21]](function(_0xb3d0x1a){return _0xb3d0x12[_0x7f02[20]](200)[_0x7f02[19]]({value:_0xb3d0x1a})})[_0x7f02[18]](function(_0xb3d0x14){console[_0x7f02[35]](_0xb3d0x14);return handleError(_0xb3d0x12,_0xb3d0x14)})};exports[_0x7f02[42]]= function(_0xb3d0x11,_0xb3d0x12){return Promise[_0x7f02[41]]([])[_0x7f02[21]](getMailQueues(_0xb3d0x11[_0x7f02[32]]))[_0x7f02[21]](function(_0xb3d0x1b){return MailRoom[_0x7f02[40]](_[_0x7f02[39]](Util[_0x7f02[23]](_0xb3d0x11[_0x7f02[22]],{status:_0x7f02[43],updatedAt:{$gte:moment()[_0x7f02[38]](_0x7f02[37])}}),_0xb3d0x1b))})[_0x7f02[21]](function(_0xb3d0x1a){return _0xb3d0x12[_0x7f02[20]](200)[_0x7f02[19]]({value:_0xb3d0x1a})})[_0x7f02[18]](function(_0xb3d0x14){console[_0x7f02[35]](_0xb3d0x14);return handleError(_0xb3d0x12,_0xb3d0x14)})};exports[_0x7f02[44]]= function(_0xb3d0x11,_0xb3d0x12){return Promise[_0x7f02[41]]([])[_0x7f02[21]](getMailQueues(_0xb3d0x11[_0x7f02[32]]))[_0x7f02[21]](function(_0xb3d0x1b){return MailRoom[_0x7f02[40]](_[_0x7f02[39]](Util[_0x7f02[23]](_0xb3d0x11[_0x7f02[22]],{status:_0x7f02[45],updatedAt:{$gte:moment()[_0x7f02[38]](_0x7f02[37])}}),_0xb3d0x1b))})[_0x7f02[21]](function(_0xb3d0x1a){return _0xb3d0x12[_0x7f02[20]](200)[_0x7f02[19]]({value:_0xb3d0x1a})})[_0x7f02[18]](function(_0xb3d0x14){console[_0x7f02[35]](_0xb3d0x14);return handleError(_0xb3d0x12,_0xb3d0x14)})};exports[_0x7f02[46]]= function(_0xb3d0x11,_0xb3d0x12){return Promise[_0x7f02[41]]([])[_0x7f02[21]](getMailQueues(_0xb3d0x11[_0x7f02[32]]))[_0x7f02[21]](function(_0xb3d0x1b){return MailRoom[_0x7f02[40]](_[_0x7f02[39]](Util[_0x7f02[23]](_0xb3d0x11[_0x7f02[22]],{status:_0x7f02[47],updatedAt:{$gte:moment()[_0x7f02[38]](_0x7f02[37])}}),_0xb3d0x1b))})[_0x7f02[21]](function(_0xb3d0x1a){return _0xb3d0x12[_0x7f02[20]](200)[_0x7f02[19]]({value:_0xb3d0x1a})})[_0x7f02[18]](function(_0xb3d0x14){console[_0x7f02[35]](_0xb3d0x14);return handleError(_0xb3d0x12,_0xb3d0x14)})};exports[_0x7f02[48]]= function(_0xb3d0x11,_0xb3d0x12,_0xb3d0x13){switch(_0xb3d0x11[_0x7f02[32]][_0x7f02[33]]){case _0x7f02[54]:return sequelize[_0x7f02[22]](_0x7f02[50],{replacements:{status:_0x7f02[51],id:_0xb3d0x11[_0x7f02[32]][_0x7f02[28]]},type:sequelize[_0x7f02[53]][_0x7f02[52]]})[_0x7f02[21]](function(_0xb3d0x15){return _0xb3d0x12[_0x7f02[20]](200)[_0x7f02[19]](_0xb3d0x15)})[_0x7f02[18]](function(_0xb3d0x14){console[_0x7f02[49]](_0xb3d0x14);return handleError(_0xb3d0x12,_0xb3d0x14)});default:return sequelize[_0x7f02[22]](_0x7f02[55],{replacements:{status:_0x7f02[51],id:_0xb3d0x11[_0x7f02[32]][_0x7f02[28]]},type:sequelize[_0x7f02[53]][_0x7f02[52]]})[_0x7f02[21]](function(_0xb3d0x15){return _0xb3d0x12[_0x7f02[20]](200)[_0x7f02[19]](_0xb3d0x15)})[_0x7f02[18]](function(_0xb3d0x14){return handleError(_0xb3d0x12,_0xb3d0x14)})}};exports[_0x7f02[56]]= function(_0xb3d0x11,_0xb3d0x12,_0xb3d0x13){return MailRoom[_0x7f02[58]]({where:{UserId:_0xb3d0x11[_0x7f02[57]][_0x7f02[28]]},include:[{all:true}]})[_0x7f02[21]](function(_0xb3d0x1c){return _0xb3d0x12[_0x7f02[20]](200)[_0x7f02[19]](_0xb3d0x1c)})[_0x7f02[18]](function(_0xb3d0x14){return handleError(_0xb3d0x12,_0xb3d0x14)})};exports[_0x7f02[59]]= function(_0xb3d0x11,_0xb3d0x12,_0xb3d0x13){var _0xb3d0x1d;var _0xb3d0x1e=[];console[_0x7f02[35]](_0xb3d0x11[_0x7f02[60]]);console[_0x7f02[35]](_0xb3d0x11[_0x7f02[57]]);return MailRoom[_0x7f02[67]](_0xb3d0x11[_0x7f02[60]],{where:{id:_0xb3d0x11[_0x7f02[57]][_0x7f02[28]][_0x7f02[63]](_0x7f02[62])},individualHooks:true})[_0x7f02[21]](function(){return Status[_0x7f02[66]](_[_0x7f02[29]](_0xb3d0x11[_0x7f02[57]][_0x7f02[28]][_0x7f02[63]](_0x7f02[62]),function(_0xb3d0x1f){return {status:_0xb3d0x11[_0x7f02[60]][_0x7f02[20]],data1:_0xb3d0x11[_0x7f02[32]][_0x7f02[64]],data2:_0xb3d0x11[_0x7f02[32]][_0x7f02[65]],MailRoomId:_0xb3d0x1f,UserId:_0xb3d0x11[_0x7f02[32]][_0x7f02[28]]}}))})[_0x7f02[21]](function(_0xb3d0x1c){return _0xb3d0x12[_0x7f02[61]](200)})[_0x7f02[18]](function(_0xb3d0x14){return handleError(_0xb3d0x12,_0xb3d0x14)})};exports[_0x7f02[68]]= function(_0xb3d0x11,_0xb3d0x12,_0xb3d0x13){return MailMessage[_0x7f02[31]](_0xb3d0x11[_0x7f02[57]][_0x7f02[28]])[_0x7f02[21]](function(_0xb3d0x21){return _0xb3d0x21[_0x7f02[70]]({include:[{model:MailAccount},{model:MailMessage,include:[{model:MailAttachment},{model:User,attributes:[_0x7f02[28],_0x7f02[64],_0x7f02[65],_0x7f02[69]]}]},{model:User,attributes:[_0x7f02[28],_0x7f02[64],_0x7f02[65],_0x7f02[69]]}]})})[_0x7f02[21]](function(_0xb3d0x20){return _0xb3d0x12[_0x7f02[19]](_0xb3d0x20)})[_0x7f02[18]](function(_0xb3d0x14){return handleError(_0xb3d0x12,_0xb3d0x14)})};exports[_0x7f02[71]]= function(_0xb3d0x11,_0xb3d0x12,_0xb3d0x13){return MailRoom[_0x7f02[26]](_0x7f02[25])[_0x7f02[31]](_0xb3d0x11[_0x7f02[57]][_0x7f02[28]])[_0x7f02[21]](function(_0xb3d0x20){if(!_0xb3d0x20){return _0xb3d0x12[_0x7f02[61]](404)};return _0xb3d0x12[_0x7f02[19]](_0xb3d0x20)})[_0x7f02[18]](function(_0xb3d0x14){console[_0x7f02[49]](_0xb3d0x14);return handleError(_0xb3d0x12,_0xb3d0x14)})};exports[_0x7f02[72]]= function(_0xb3d0x11,_0xb3d0x12,_0xb3d0x13){return MailRoom[_0x7f02[31]](_0xb3d0x11[_0x7f02[57]][_0x7f02[28]])[_0x7f02[21]](function(_0xb3d0x20){if(!_0xb3d0x20){return _0xb3d0x12[_0x7f02[61]](404)};return _0xb3d0x20[_0x7f02[74]]({attributes:[_0x7f02[28],_0x7f02[64],_0x7f02[65],_0x7f02[69],_0x7f02[33],_0x7f02[73]]})})[_0x7f02[21]](function(_0xb3d0x22){return _0xb3d0x12[_0x7f02[19]](_0xb3d0x22)})[_0x7f02[18]](function(_0xb3d0x14){return handleError(_0xb3d0x12,_0xb3d0x14)})};exports[_0x7f02[75]]= function(_0xb3d0x11,_0xb3d0x12,_0xb3d0x13){return MailRoom[_0x7f02[75]](_0xb3d0x11[_0x7f02[60]])[_0x7f02[21]](function(_0xb3d0x20){return _0xb3d0x12[_0x7f02[20]](201)[_0x7f02[19]](_0xb3d0x20)})[_0x7f02[18]](function(_0xb3d0x14){return handleError(_0xb3d0x12,_0xb3d0x14)})};exports[_0x7f02[76]]= function(_0xb3d0x11,_0xb3d0x12,_0xb3d0x13){_0xb3d0x11[_0x7f02[60]][_0x7f02[77]]= _0xb3d0x11[_0x7f02[32]][_0x7f02[28]];_0xb3d0x11[_0x7f02[60]][_0x7f02[78]]= _0xb3d0x11[_0x7f02[57]][_0x7f02[28]];_0xb3d0x11[_0x7f02[60]][_0x7f02[79]]= (_0xb3d0x11[_0x7f02[60]][_0x7f02[80]]&& _0xb3d0x11[_0x7f02[60]][_0x7f02[80]][_0x7f02[81]])?true:false;_0xb3d0x11[_0x7f02[60]][_0x7f02[82]]= _0xb3d0x11[_0x7f02[60]][_0x7f02[82]]|| htmlToText[_0x7f02[84]](_0xb3d0x11[_0x7f02[60]][_0x7f02[83]],{wordwrap:false});return MailMessage[_0x7f02[75]](_0xb3d0x11[_0x7f02[60]],{include:[{model:MailAttachment}],user:_0xb3d0x11[_0x7f02[32]]})[_0x7f02[21]](function(_0xb3d0x21){return _0xb3d0x12[_0x7f02[20]](201)[_0x7f02[19]](_0xb3d0x21)})[_0x7f02[18]](function(_0xb3d0x14){return handleError(_0xb3d0x12,_0xb3d0x14)})};exports[_0x7f02[67]]= function(_0xb3d0x11,_0xb3d0x12,_0xb3d0x13){return MailRoom[_0x7f02[31]](_0xb3d0x11[_0x7f02[57]][_0x7f02[28]])[_0x7f02[21]](function(_0xb3d0x20){if(!_0xb3d0x20){return _0xb3d0x12[_0x7f02[61]](404)};return _0xb3d0x20[_0x7f02[67]](_0xb3d0x11[_0x7f02[60]])})[_0x7f02[21]](function(_0xb3d0x20){return _0xb3d0x12[_0x7f02[20]](200)[_0x7f02[19]](_0xb3d0x20)})[_0x7f02[18]](function(_0xb3d0x14){return handleError(_0xb3d0x12,_0xb3d0x14)})};exports[_0x7f02[85]]= function(_0xb3d0x11,_0xb3d0x12,_0xb3d0x13){var _0xb3d0x23={where:{id:_0xb3d0x11[_0x7f02[57]][_0x7f02[28]][_0x7f02[63]](_0x7f02[62])},user:_0xb3d0x11[_0x7f02[32]],individualHooks:true};return MailRoom[_0x7f02[67]](_0xb3d0x11[_0x7f02[60]],_0xb3d0x23)[_0x7f02[21]](function(_0xb3d0x1c){if(!_0xb3d0x1c){return _0xb3d0x12[_0x7f02[61]](404)};return _0xb3d0x1c})[_0x7f02[21]](function(_0xb3d0x1c){return _0xb3d0x12[_0x7f02[61]](200)})[_0x7f02[18]](function(_0xb3d0x14){return handleError(_0xb3d0x12,_0xb3d0x14)})};exports[_0x7f02[86]]= function(_0xb3d0x11,_0xb3d0x12,_0xb3d0x13){return MailRoom[_0x7f02[31]](_0xb3d0x11[_0x7f02[57]][_0x7f02[28]])[_0x7f02[21]](function(_0xb3d0x20){if(!_0xb3d0x20){return _0xb3d0x12[_0x7f02[61]](404)};return _0xb3d0x20[_0x7f02[88]](_0xb3d0x11[_0x7f02[60]][_0x7f02[87]],{individualHooks:true})})[_0x7f02[21]](function(){return _0xb3d0x12[_0x7f02[61]](200)})[_0x7f02[18]](function(_0xb3d0x14){return handleError(_0xb3d0x12,_0xb3d0x14)})};exports[_0x7f02[89]]= function(_0xb3d0x11,_0xb3d0x12,_0xb3d0x13){return MailRoom[_0x7f02[31]](_0xb3d0x11[_0x7f02[57]][_0x7f02[28]])[_0x7f02[21]](function(_0xb3d0x20){if(!_0xb3d0x20){return _0xb3d0x12[_0x7f02[61]](404)};return _0xb3d0x20[_0x7f02[89]]()})[_0x7f02[21]](function(){return _0xb3d0x12[_0x7f02[61]](204)})[_0x7f02[18]](function(_0xb3d0x14){return handleError(_0xb3d0x12,_0xb3d0x14)})};exports[_0x7f02[90]]= function(_0xb3d0x11,_0xb3d0x12){return MailRoom[_0x7f02[89]]({where:{id:_0xb3d0x11[_0x7f02[22]][_0x7f02[91]]},individualHooks:true})[_0x7f02[21]](function(){return _0xb3d0x12[_0x7f02[61]](200)})[_0x7f02[18]](function(_0xb3d0x14){return handleError(_0xb3d0x12,_0xb3d0x14)})};function handleError(_0xb3d0x12,_0xb3d0x14){return _0xb3d0x12[_0x7f02[20]](500)[_0x7f02[19]](_0xb3d0x14)}
\ No newline at end of file