Built motion from commit ab2cbc7.|0.0.98
[motion.git] / server / api / mail_room / mail_room.controller.js
index bfedd87..1b3a545 100644 (file)
@@ -1 +1 @@
-var _0xc3aa=["\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"];_0xc3aa[0];var _=require(_0xc3aa[1]);var util=require(_0xc3aa[2]);var User=require(_0xc3aa[4])[_0xc3aa[3]];var Contact=require(_0xc3aa[4])[_0xc3aa[5]];var MailRoom=require(_0xc3aa[4])[_0xc3aa[6]];var MailMessage=require(_0xc3aa[4])[_0xc3aa[7]];var MailAccount=require(_0xc3aa[4])[_0xc3aa[8]];var MailAttachment=require(_0xc3aa[4])[_0xc3aa[9]];exports[_0xc3aa[10]]=function(_0xbb33x9,_0xbb33xa,_0xbb33xb){var _0xbb33xc=[_0xc3aa[11],_0xc3aa[12],_0xc3aa[13]];var _0xbb33xd=_0xbb33x9[_0xc3aa[15]][_0xc3aa[14]]?parseInt(_0xbb33x9[_0xc3aa[15]][_0xc3aa[14]],10):100;var _0xbb33xe=_0xbb33x9[_0xc3aa[15]][_0xc3aa[16]]?parseInt(_0xbb33x9[_0xc3aa[15]][_0xc3aa[16]],10):0;var _0xbb33xf={where:{$or:[{status:_0xc3aa[17]},{status:_0xc3aa[18]}]},include:[{model:User,attributes:[_0xc3aa[19],_0xc3aa[20],_0xc3aa[21],_0xc3aa[22],_0xc3aa[23],_0xc3aa[24]]},{model:MailAccount}],limit:_0xbb33xd,offset:_0xbb33xe*_0xbb33xd};if(_0xbb33x9[_0xc3aa[25]][_0xc3aa[23]]===_0xc3aa[26]){_0xbb33xf[_0xc3aa[28]][0][_0xc3aa[27]]={id:_0xbb33x9[_0xc3aa[25]][_0xc3aa[19]]}};_[_0xc3aa[41]](_0xbb33x9[_0xc3aa[15]],function(_0xbb33x10,_0xbb33x11){switch(_0xbb33x11){case _0xc3aa[14]:;case _0xc3aa[16]:break ;;case _0xc3aa[31]:_0xbb33xf[_0xc3aa[29]]=util[_0xc3aa[34]](_0xc3aa[30],_0xbb33x9[_0xc3aa[15]][_0xc3aa[31]],_0xbb33x9[_0xc3aa[15]][_0xc3aa[32]]||_0xc3aa[33])||null;break ;;case _0xc3aa[32]:break ;;case _0xc3aa[39]:_0xbb33xf[_0xc3aa[27]][_0xc3aa[35]]=[];_0xbb33xc[_0xc3aa[38]](function(_0xbb33x12){var _0xbb33x13={};_0xbb33x13[_0xbb33x12]={$like:_0xc3aa[36]+_0xbb33x10+_0xc3aa[36]};_0xbb33xf[_0xc3aa[27]][_0xc3aa[35]][_0xc3aa[37]](_0xbb33x13);});break ;;default:_0xbb33xf[_0xc3aa[27]][_0xbb33x11]={$like:{}};_0xbb33xf[_0xc3aa[27]][_0xbb33x11][_0xc3aa[40]]=_0xc3aa[36]+_0xbb33x10+_0xc3aa[36];;}});console[_0xc3aa[42]](_0xc3aa[15],_0xbb33xf);return MailRoom[_0xc3aa[55]](_0xbb33xf)[_0xc3aa[54]](function(_0xbb33x15){console[_0xc3aa[42]](_0xbb33x15);var _0xbb33x16=Math[_0xc3aa[45]](_0xbb33x15[_0xc3aa[44]]/_0xbb33xd);var _0xbb33x17=_0xbb33x16>(_0xbb33xf[_0xc3aa[46]]+1)?util[_0xc3aa[34]](_0xc3aa[47],_0xbb33x9[_0xc3aa[48]],_0xbb33x9[_0xc3aa[50]][_0xc3aa[49]],_0xbb33x9[_0xc3aa[51]],_0xbb33xe+1):null;var _0xbb33x18=_0xbb33xe>0?util[_0xc3aa[34]](_0xc3aa[47],_0xbb33x9[_0xc3aa[48]],_0xbb33x9[_0xc3aa[50]][_0xc3aa[49]],_0xbb33x9[_0xc3aa[51]],_0xbb33xe-1):null;_0xbb33xa[_0xc3aa[13]](200)[_0xc3aa[53]]({count:_0xbb33x15[_0xc3aa[44]],mailRooms:_0xbb33x15[_0xc3aa[52]],next_page:_0xbb33x17,previous_page:_0xbb33x18,total_pages:_0xbb33x16});})[_0xc3aa[43]](function(_0xbb33x14){return handleError(_0xbb33xa,_0xbb33x14)});};exports[_0xc3aa[56]]=function(_0xbb33x9,_0xbb33xa,_0xbb33xb){return MailRoom[_0xc3aa[58]]({where:{UserId:_0xbb33x9[_0xc3aa[57]][_0xc3aa[19]]},include:[{all:true}]})[_0xc3aa[54]](function(_0xbb33x19){return _0xbb33xa[_0xc3aa[13]](200)[_0xc3aa[53]](_0xbb33x19)})[_0xc3aa[43]](function(_0xbb33x14){return handleError(_0xbb33xa,_0xbb33x14)})};exports[_0xc3aa[59]]=function(_0xbb33x9,_0xbb33xa,_0xbb33xb){return MailRoom[_0xc3aa[61]](_0xbb33x9[_0xc3aa[57]][_0xc3aa[19]],{include:[{model:MailMessage,include:[{model:MailAttachment}]},{model:MailAccount}]})[_0xc3aa[54]](function(_0xbb33x1a){if(!_0xbb33x1a){return _0xbb33xa[_0xc3aa[60]](404)};return _0xbb33xa[_0xc3aa[53]](_0xbb33x1a);})[_0xc3aa[43]](function(_0xbb33x14){return handleError(_0xbb33xa,_0xbb33x14)})};exports[_0xc3aa[62]]=function(_0xbb33x9,_0xbb33xa,_0xbb33xb){return MailRoom[_0xc3aa[61]](_0xbb33x9[_0xc3aa[57]][_0xc3aa[19]])[_0xc3aa[54]](function(_0xbb33x1a){if(!_0xbb33x1a){return _0xbb33xa[_0xc3aa[60]](404)};return _0xbb33x1a[_0xc3aa[63]]({attributes:[_0xc3aa[19],_0xc3aa[20],_0xc3aa[21],_0xc3aa[22],_0xc3aa[23],_0xc3aa[24]]});})[_0xc3aa[54]](function(_0xbb33x1b){return _0xbb33xa[_0xc3aa[53]](_0xbb33x1b)})[_0xc3aa[43]](function(_0xbb33x14){return handleError(_0xbb33xa,_0xbb33x14)})};exports[_0xc3aa[64]]=function(_0xbb33x9,_0xbb33xa,_0xbb33xb){return MailRoom[_0xc3aa[64]](_0xbb33x9[_0xc3aa[65]])[_0xc3aa[54]](function(_0xbb33x1a){return _0xbb33xa[_0xc3aa[13]](201)[_0xc3aa[53]](_0xbb33x1a)})[_0xc3aa[43]](function(_0xbb33x14){return handleError(_0xbb33xa,_0xbb33x14)})};exports[_0xc3aa[66]]=function(_0xbb33x9,_0xbb33xa,_0xbb33xb){return MailRoom[_0xc3aa[61]](_0xbb33x9[_0xc3aa[57]][_0xc3aa[19]])[_0xc3aa[54]](function(_0xbb33x1a){if(!_0xbb33x1a){return _0xbb33xa[_0xc3aa[60]](404)};if(_0xbb33x1a[_0xc3aa[67]]){throw  new Error(_0xc3aa[68])};var _0xbb33x1c=_[_0xc3aa[69]](_0xbb33x1a,_0xbb33x9[_0xc3aa[65]]);return _0xbb33x1c[_0xc3aa[70]]();})[_0xc3aa[54]](function(_0xbb33x1a){return _0xbb33xa[_0xc3aa[13]](200)[_0xc3aa[53]](_0xbb33x1a)})[_0xc3aa[43]](function(_0xbb33x14){return handleError(_0xbb33xa,_0xbb33x14)})};exports[_0xc3aa[71]]=function(_0xbb33x9,_0xbb33xa,_0xbb33xb){return MailRoom[_0xc3aa[61]](_0xbb33x9[_0xc3aa[57]][_0xc3aa[19]])[_0xc3aa[54]](function(_0xbb33x1a){if(!_0xbb33x1a){return _0xbb33xa[_0xc3aa[60]](404)};return _0xbb33x1a[_0xc3aa[73]](_0xbb33x9[_0xc3aa[65]][_0xc3aa[72]]);})[_0xc3aa[54]](function(){return _0xbb33xa[_0xc3aa[60]](200)})[_0xc3aa[43]](function(_0xbb33x14){return handleError(_0xbb33xa,_0xbb33x14)})};exports[_0xc3aa[74]]=function(_0xbb33x9,_0xbb33xa,_0xbb33xb){return MailRoom[_0xc3aa[61]](_0xbb33x9[_0xc3aa[57]][_0xc3aa[19]])[_0xc3aa[54]](function(_0xbb33x1a){if(!_0xbb33x1a){return _0xbb33xa[_0xc3aa[60]](404)};return _0xbb33x1a[_0xc3aa[74]]();})[_0xc3aa[54]](function(){return _0xbb33xa[_0xc3aa[60]](204)})[_0xc3aa[43]](function(_0xbb33x14){return handleError(_0xbb33xa,_0xbb33x14)})};exports[_0xc3aa[75]]=function(_0xbb33x9,_0xbb33xa){return MailRoom[_0xc3aa[74]]({where:{id:_0xbb33x9[_0xc3aa[15]][_0xc3aa[19]]},individualHooks:true})[_0xc3aa[54]](function(){return _0xbb33xa[_0xc3aa[60]](200)})[_0xc3aa[43]](function(_0xbb33x14){return handleError(_0xbb33xa,_0xbb33x14)})};function handleError(_0xbb33xa,_0xbb33x14){return _0xbb33xa[_0xc3aa[13]](500)[_0xc3aa[53]](_0xbb33x14)}
\ No newline at end of file
+var _0xd607=["\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","\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"];_0xd607[0];var _=require(_0xd607[1]);var util=require(_0xd607[2]);var htmlToText=require(_0xd607[3]);var Util=require(_0xd607[4]);var sequelize=require(_0xd607[6])[_0xd607[5]];var User=require(_0xd607[6])[_0xd607[7]];var Agent=require(_0xd607[6])[_0xd607[7]];var Contact=require(_0xd607[6])[_0xd607[8]];var MailRoom=require(_0xd607[6])[_0xd607[9]];var MailMessage=require(_0xd607[6])[_0xd607[10]];var MailAccount=require(_0xd607[6])[_0xd607[11]];var MailAttachment=require(_0xd607[6])[_0xd607[12]];exports[_0xd607[13]]=function(_0x4e54xd,_0x4e54xe,_0x4e54xf){return MailRoom[_0xd607[22]](_0xd607[21])[_0xd607[20]](Util[_0xd607[19]](_0x4e54xd[_0xd607[18]]))[_0xd607[17]](function(_0x4e54x11){return _0x4e54xe[_0xd607[16]](200)[_0xd607[15]](_0x4e54x11)})[_0xd607[14]](function(_0x4e54x10){return handleError(_0x4e54xe,_0x4e54x10)})};exports[_0xd607[23]]=function(_0x4e54xd,_0x4e54xe,_0x4e54xf){switch(_0x4e54xd[_0xd607[28]][_0xd607[33]]){case _0xd607[31]:return sequelize[_0xd607[18]](_0xd607[25],{replacements:{status:_0xd607[26],id:_0x4e54xd[_0xd607[28]][_0xd607[27]]},type:sequelize[_0xd607[30]][_0xd607[29]]})[_0xd607[17]](function(_0x4e54x11){return _0x4e54xe[_0xd607[16]](200)[_0xd607[15]](_0x4e54x11)})[_0xd607[14]](function(_0x4e54x10){console[_0xd607[24]](_0x4e54x10);return handleError(_0x4e54xe,_0x4e54x10)});default:return sequelize[_0xd607[18]](_0xd607[32],{replacements:{status:_0xd607[26],id:_0x4e54xd[_0xd607[28]][_0xd607[27]]},type:sequelize[_0xd607[30]][_0xd607[29]]})[_0xd607[17]](function(_0x4e54x11){return _0x4e54xe[_0xd607[16]](200)[_0xd607[15]](_0x4e54x11)})[_0xd607[14]](function(_0x4e54x10){return handleError(_0x4e54xe,_0x4e54x10)})}};exports[_0xd607[34]]=function(_0x4e54xd,_0x4e54xe,_0x4e54xf){return MailRoom[_0xd607[36]]({where:{UserId:_0x4e54xd[_0xd607[35]][_0xd607[27]]},include:[{all:true}]})[_0xd607[17]](function(_0x4e54x12){return _0x4e54xe[_0xd607[16]](200)[_0xd607[15]](_0x4e54x12)})[_0xd607[14]](function(_0x4e54x10){return handleError(_0x4e54xe,_0x4e54x10)})};exports[_0xd607[37]]=function(_0x4e54xd,_0x4e54xe,_0x4e54xf){var _0x4e54x13;if(_0x4e54xd[_0xd607[28]][_0xd607[33]]===_0xd607[31]){return MailRoom[_0xd607[42]](_0x4e54xd[_0xd607[35]][_0xd607[27]])[_0xd607[17]](function(_0x4e54x14){_0x4e54x13=_0x4e54x14;if(!_0x4e54x13){return _0x4e54xe[_0xd607[38]](404)};return _0x4e54x13[_0xd607[41]]({status:_0xd607[40]},{userId:_0x4e54xd[_0xd607[28]][_0xd607[27]]})})[_0xd607[17]](function(){return _0x4e54x13[_0xd607[39]](_0x4e54xd[_0xd607[28]][_0xd607[27]])})[_0xd607[17]](function(){return _0x4e54xe[_0xd607[38]](200)})[_0xd607[14]](function(_0x4e54x10){return handleError(_0x4e54xe,_0x4e54x10)})}};exports[_0xd607[43]]=function(_0x4e54xd,_0x4e54xe,_0x4e54xf){return MailMessage[_0xd607[42]](_0x4e54xd[_0xd607[35]][_0xd607[27]])[_0xd607[17]](function(_0x4e54x15){return _0x4e54x15[_0xd607[47]]({include:[{model:MailAccount},{model:MailMessage,include:[{model:MailAttachment},{model:User,attributes:[_0xd607[27],_0xd607[44],_0xd607[45],_0xd607[46]]}]},{model:User,attributes:[_0xd607[27],_0xd607[44],_0xd607[45],_0xd607[46]]}]})})[_0xd607[17]](function(_0x4e54x14){return _0x4e54xe[_0xd607[15]](_0x4e54x14)})[_0xd607[14]](function(_0x4e54x10){return handleError(_0x4e54xe,_0x4e54x10)})};exports[_0xd607[48]]=function(_0x4e54xd,_0x4e54xe,_0x4e54xf){return MailRoom[_0xd607[22]](_0xd607[21])[_0xd607[42]](_0x4e54xd[_0xd607[35]][_0xd607[27]])[_0xd607[17]](function(_0x4e54x14){if(!_0x4e54x14){return _0x4e54xe[_0xd607[38]](404)};return _0x4e54xe[_0xd607[15]](_0x4e54x14)})[_0xd607[14]](function(_0x4e54x10){console[_0xd607[24]](_0x4e54x10);return handleError(_0x4e54xe,_0x4e54x10)})};exports[_0xd607[49]]=function(_0x4e54xd,_0x4e54xe,_0x4e54xf){return MailRoom[_0xd607[42]](_0x4e54xd[_0xd607[35]][_0xd607[27]])[_0xd607[17]](function(_0x4e54x14){if(!_0x4e54x14){return _0x4e54xe[_0xd607[38]](404)};return _0x4e54x14[_0xd607[51]]({attributes:[_0xd607[27],_0xd607[44],_0xd607[45],_0xd607[46],_0xd607[33],_0xd607[50]]})})[_0xd607[17]](function(_0x4e54x16){return _0x4e54xe[_0xd607[15]](_0x4e54x16)})[_0xd607[14]](function(_0x4e54x10){return handleError(_0x4e54xe,_0x4e54x10)})};exports[_0xd607[52]]=function(_0x4e54xd,_0x4e54xe,_0x4e54xf){return MailRoom[_0xd607[52]](_0x4e54xd[_0xd607[53]])[_0xd607[17]](function(_0x4e54x14){return _0x4e54xe[_0xd607[16]](201)[_0xd607[15]](_0x4e54x14)})[_0xd607[14]](function(_0x4e54x10){return handleError(_0x4e54xe,_0x4e54x10)})};exports[_0xd607[54]]=function(_0x4e54xd,_0x4e54xe,_0x4e54xf){_0x4e54xd[_0xd607[53]][_0xd607[55]]=_0x4e54xd[_0xd607[28]][_0xd607[27]];_0x4e54xd[_0xd607[53]][_0xd607[56]]=_0x4e54xd[_0xd607[35]][_0xd607[27]];_0x4e54xd[_0xd607[53]][_0xd607[57]]=(_0x4e54xd[_0xd607[53]][_0xd607[58]]&&_0x4e54xd[_0xd607[53]][_0xd607[58]][_0xd607[59]])?true:false;_0x4e54xd[_0xd607[53]][_0xd607[60]]=_0x4e54xd[_0xd607[53]][_0xd607[60]]||htmlToText[_0xd607[62]](_0x4e54xd[_0xd607[53]][_0xd607[61]],{wordwrap:false});return MailMessage[_0xd607[52]](_0x4e54xd[_0xd607[53]],{include:[{model:MailAttachment}],user:_0x4e54xd[_0xd607[28]]})[_0xd607[17]](function(_0x4e54x15){return _0x4e54xe[_0xd607[16]](201)[_0xd607[15]](_0x4e54x15)})[_0xd607[14]](function(_0x4e54x10){return handleError(_0x4e54xe,_0x4e54x10)})};exports[_0xd607[41]]=function(_0x4e54xd,_0x4e54xe,_0x4e54xf){return MailRoom[_0xd607[42]](_0x4e54xd[_0xd607[35]][_0xd607[27]])[_0xd607[17]](function(_0x4e54x14){if(!_0x4e54x14){return _0x4e54xe[_0xd607[38]](404)};return _0x4e54x14[_0xd607[41]](_0x4e54xd[_0xd607[53]])})[_0xd607[17]](function(_0x4e54x14){return _0x4e54xe[_0xd607[16]](200)[_0xd607[15]](_0x4e54x14)})[_0xd607[14]](function(_0x4e54x10){return handleError(_0x4e54xe,_0x4e54x10)})};exports[_0xd607[63]]=function(_0x4e54xd,_0x4e54xe,_0x4e54xf){var _0x4e54x17={tags:_0x4e54xd[_0xd607[53]][_0xd607[64]]};var _0x4e54x18={where:{id:_0x4e54xd[_0xd607[35]][_0xd607[27]][_0xd607[66]](_0xd607[65])}};return MailRoom[_0xd607[41]](_0x4e54x17,_0x4e54x18)[_0xd607[17]](function(_0x4e54x12){if(!_0x4e54x12){return _0x4e54xe[_0xd607[38]](404)};return _0x4e54x12})[_0xd607[17]](function(_0x4e54x12){return _0x4e54xe[_0xd607[38]](200)})[_0xd607[14]](function(_0x4e54x10){return handleError(_0x4e54xe,_0x4e54x10)})};exports[_0xd607[67]]=function(_0x4e54xd,_0x4e54xe,_0x4e54xf){return MailRoom[_0xd607[42]](_0x4e54xd[_0xd607[35]][_0xd607[27]])[_0xd607[17]](function(_0x4e54x14){if(!_0x4e54x14){return _0x4e54xe[_0xd607[38]](404)};return _0x4e54x14[_0xd607[69]](_0x4e54xd[_0xd607[53]][_0xd607[68]],{individualHooks:true})})[_0xd607[17]](function(){return _0x4e54xe[_0xd607[38]](200)})[_0xd607[14]](function(_0x4e54x10){return handleError(_0x4e54xe,_0x4e54x10)})};exports[_0xd607[70]]=function(_0x4e54xd,_0x4e54xe,_0x4e54xf){return MailRoom[_0xd607[42]](_0x4e54xd[_0xd607[35]][_0xd607[27]])[_0xd607[17]](function(_0x4e54x14){if(!_0x4e54x14){return _0x4e54xe[_0xd607[38]](404)};return _0x4e54x14[_0xd607[70]]()})[_0xd607[17]](function(){return _0x4e54xe[_0xd607[38]](204)})[_0xd607[14]](function(_0x4e54x10){return handleError(_0x4e54xe,_0x4e54x10)})};exports[_0xd607[71]]=function(_0x4e54xd,_0x4e54xe){return MailRoom[_0xd607[70]]({where:{id:_0x4e54xd[_0xd607[18]][_0xd607[72]]},individualHooks:true})[_0xd607[17]](function(){return _0x4e54xe[_0xd607[38]](200)})[_0xd607[14]](function(_0x4e54x10){return handleError(_0x4e54xe,_0x4e54x10)})};function handleError(_0x4e54xe,_0x4e54x10){return _0x4e54xe[_0xd607[16]](500)[_0xd607[15]](_0x4e54x10)}
\ No newline at end of file