Built motion from commit 038bc69.|0.0.119
[motion.git] / server / config / automations / mail.js
index 2ee7f71..ab9234a 100644 (file)
@@ -1 +1 @@
-var _0xe89d=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x2E\x2E\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\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","\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x53\x65\x74\x74\x69\x6E\x67\x73","\x45\x78\x65\x63\x75\x74\x69\x6E\x67\x20\x4D\x61\x69\x6C\x20\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x20","\x6C\x6F\x67","\x4D\x61\x69\x6C\x20\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x20\x65\x78\x65\x63\x20\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x69\x64","\x64\x61\x74\x61\x31","\x73\x74\x61\x74\x75\x73","\x61\x63\x74\x69\x6F\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x41\x63\x74\x69\x6F\x6E\x73","\x74\x68\x65\x6E","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x70\x75\x73\x68","\x24\x61\x6E\x64","\x77\x68\x65\x72\x65","\x41\x6C\x6C","\x24\x6F\x72","\x41\x6E\x79","\x66\x69\x6E\x64\x41\x6C\x6C","\x66\x69\x6E\x64\x42\x79\x49\x64","\x61\x6C\x6C","\x73\x63\x6F\x70\x65","\x41\x75\x74\x6F\x6D\x61\x74\x69\x63\x20\x6D\x61\x69\x6C\x20\x73\x74\x61\x74\x75\x73\x20\x65\x72\x72\x6F\x72","\x75\x70\x64\x61\x74\x65","\x66\x69\x65\x6C\x64","\x76\x61\x6C\x75\x65","\x65\x71\x75\x61\x6C\x73","\x6E\x6F\x74\x5F\x65\x71\x75\x61\x6C\x73","\x6F\x70\x65\x72\x61\x74\x6F\x72","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x6D\x61\x74","\x68\x6F\x75\x72\x73","\x73\x75\x62\x74\x72\x61\x63\x74","\x67\x72\x65\x61\x74\x65\x72","\x67\x72\x65\x61\x74\x65\x72\x5F\x6F\x72\x5F\x65\x71\x75\x61\x6C","\x6C\x65\x73\x73","\x6C\x65\x73\x73\x5F\x6F\x72\x5F\x65\x71\x75\x61\x6C","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x4D\x61\x69\x6C\x20\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x20","\x20\x73\x65\x74\x20\x77\x69\x74\x68\x20\x74\x69\x6D\x65\x6F\x75\x74\x20","\x74\x69\x6D\x65\x6F\x75\x74","\x69\x6E\x74\x65\x72\x76\x61\x6C","\x65\x78\x70\x6F\x72\x74\x73","\x20\x63\x72\x65\x61\x74\x65\x64\x2C\x20\x74\x68\x65\x20\x73\x74\x61\x74\x75\x73\x20\x69\x73\x20","\x63\x68\x61\x6E\x6E\x65\x6C","\x6D\x61\x69\x6C","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x20\x75\x70\x64\x61\x74\x65\x64\x2C\x20\x74\x68\x65\x20\x73\x74\x61\x74\x75\x73\x20\x69\x73\x20","\x4D\x61\x69\x6C\x20\x61\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x20\x75\x6E\x73\x65\x74\x20","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x20\x64\x65\x6C\x65\x74\x65\x64","\x61\x66\x74\x65\x72\x44\x65\x6C\x65\x74\x65","\x4D\x61\x69\x6C\x20\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x20\x69\x6E\x69\x74\x20\x65\x72\x72\x6F\x72"];_0xe89d[0];var _=require(_0xe89d[1]);var config=require(_0xe89d[2]);var moment=require(_0xe89d[3]);var sequelize=require(_0xe89d[5])[_0xe89d[4]];var Automation=require(_0xe89d[5])[_0xe89d[6]];var MailRoom=require(_0xe89d[5])[_0xe89d[7]];var Settings=require(_0xe89d[5])[_0xe89d[8]];var activeMailAutomations={};function executeAutomation(_0x72f8xa){console[_0xe89d[10]](_0xe89d[9],_0x72f8xa);var _0x72f8xb;return Automation[_0xe89d[30]](_0xe89d[29])[_0xe89d[28]](_0x72f8xa)[_0xe89d[19]](function(_0x72f8x10){_0x72f8xb=_0x72f8x10;var _0x72f8x11={where:{$and:[],$or:[]}};_0x72f8x10[_0xe89d[24]][_0xe89d[17]](function(_0x72f8x12){_0x72f8x11[_0xe89d[23]][_0xe89d[22]][_0xe89d[21]](getCondition(_0x72f8x12[_0xe89d[20]]))});_0x72f8x10[_0xe89d[26]][_0xe89d[17]](function(_0x72f8x12){_0x72f8x11[_0xe89d[23]][_0xe89d[25]][_0xe89d[21]](getCondition(_0x72f8x12[_0xe89d[20]]))});return MailRoom[_0xe89d[27]](_0x72f8x11)})[_0xe89d[19]](function(_0x72f8xd){_0x72f8xd[_0xe89d[17]](function(_0x72f8xe){_0x72f8xb[_0xe89d[18]][_0xe89d[17]](function(_0x72f8xf){switch(_0x72f8xf[_0xe89d[16]]){case _0xe89d[15]:setStatus(_0x72f8xe[_0xe89d[13]],_0x72f8xf[_0xe89d[14]]);break;default:}})})})[_0xe89d[12]](function(_0x72f8xc){console[_0xe89d[10]](_0xe89d[11],_0x72f8xc)})}function setStatus(_0x72f8x14,_0x72f8x15){return MailRoom[_0xe89d[32]]({status:_0x72f8x15},{where:{id:_0x72f8x14}})[_0xe89d[12]](function(_0x72f8xc){console[_0xe89d[10]](_0xe89d[31],_0x72f8xc)})}function getCondition(_0x72f8x12){var _0x72f8x17={};switch(_0x72f8x12[_0xe89d[33]]){case _0xe89d[15]:switch(_0x72f8x12[_0xe89d[37]]){case _0xe89d[35]:_0x72f8x17[_0x72f8x12[_0xe89d[33]]]=_0x72f8x12[_0xe89d[34]];break;case _0xe89d[36]:_0x72f8x17[_0x72f8x12[_0xe89d[33]]]={$ne:_0x72f8x12[_0xe89d[34]]};break;default:};break;case _0xe89d[46]:var _0x72f8x18=moment()[_0xe89d[41]](parseInt(_0x72f8x12[_0xe89d[34]],10),_0xe89d[40])[_0xe89d[39]](_0xe89d[38]);switch(_0x72f8x12[_0xe89d[37]]){case _0xe89d[42]:_0x72f8x17[_0x72f8x12[_0xe89d[33]]]={lt:_0x72f8x18};break;case _0xe89d[43]:_0x72f8x17[_0x72f8x12[_0xe89d[33]]]={$lte:_0x72f8x18};break;case _0xe89d[44]:_0x72f8x17[_0x72f8x12[_0xe89d[33]]]={$gt:_0x72f8x18};break;case _0xe89d[45]:_0x72f8x17[_0x72f8x12[_0xe89d[33]]]={$gte:_0x72f8x18};break;default:};break;default:};return _0x72f8x17}function createInterval(_0x72f8x10){console[_0xe89d[10]](_0xe89d[47],_0x72f8x10[_0xe89d[13]],_0xe89d[48],_0x72f8x10[_0xe89d[49]]*60*1000);activeMailAutomations[_0xe89d[50]+_0x72f8x10[_0xe89d[13]]]=setInterval(function(){executeAutomation(_0x72f8x10[_0xe89d[13]])},_0x72f8x10[_0xe89d[49]]*60*1000)}module[_0xe89d[51]]=function(){Automation[_0xe89d[55]](function(_0x72f8x1a,_0x72f8x1b){console[_0xe89d[10]](_0xe89d[47],_0x72f8x1a[_0xe89d[13]],_0xe89d[52],_0x72f8x1a[_0xe89d[15]]);if(_0x72f8x1a[_0xe89d[15]]&&_0x72f8x1a[_0xe89d[53]]===_0xe89d[54]){createInterval(_0x72f8x1a)}});Automation[_0xe89d[58]](function(_0x72f8x1a,_0x72f8x1b){console[_0xe89d[10]](_0xe89d[47],_0x72f8x1a[_0xe89d[13]],_0xe89d[56],_0x72f8x1a[_0xe89d[15]]);if(activeMailAutomations[_0xe89d[50]+_0x72f8x1a[_0xe89d[13]]]){console[_0xe89d[10]](_0xe89d[57],_0x72f8x1a[_0xe89d[13]]);clearInterval(activeMailAutomations[_0xe89d[50]+_0x72f8x1a[_0xe89d[13]]]);delete activeMailAutomations[_0xe89d[50]+_0x72f8x1a[_0xe89d[13]]]};if(_0x72f8x1a[_0xe89d[15]]&&_0x72f8x1a[_0xe89d[53]]===_0xe89d[54]){createInterval(_0x72f8x1a)}});Automation[_0xe89d[60]](function(_0x72f8x1a,_0x72f8x1b){console[_0xe89d[10]](_0xe89d[47],_0x72f8x1a[_0xe89d[13]],_0xe89d[59]);if(activeMailAutomations[_0xe89d[50]+_0x72f8x1a[_0xe89d[13]]]){console[_0xe89d[10]](_0xe89d[57],_0x72f8x1a[_0xe89d[13]]);clearInterval(activeMailAutomations[_0xe89d[50]+_0x72f8x1a[_0xe89d[13]]]);delete activeMailAutomations[_0xe89d[50]+_0x72f8x1a[_0xe89d[13]]]}});return Automation[_0xe89d[30]](_0xe89d[29])[_0xe89d[27]]({where:{status:true,channel:_0xe89d[54]},attributes:[_0xe89d[13],_0xe89d[49]]})[_0xe89d[19]](function(_0x72f8x1c){_0x72f8x1c[_0xe89d[17]](function(_0x72f8x10){createInterval(_0x72f8x10)})})[_0xe89d[12]](function(_0x72f8xc){console[_0xe89d[10]](_0xe89d[61],_0x72f8xc)})}
\ No newline at end of file
+var _0xfe58=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x2E\x2E\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\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","\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x53\x65\x74\x74\x69\x6E\x67\x73","\x45\x78\x65\x63\x75\x74\x69\x6E\x67\x20\x4D\x61\x69\x6C\x20\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x20","\x6C\x6F\x67","\x4D\x61\x69\x6C\x20\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x20\x65\x78\x65\x63\x20\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x69\x64","\x64\x61\x74\x61\x31","\x73\x74\x61\x74\x75\x73","\x61\x63\x74\x69\x6F\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x41\x63\x74\x69\x6F\x6E\x73","\x74\x68\x65\x6E","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x70\x75\x73\x68","\x24\x61\x6E\x64","\x77\x68\x65\x72\x65","\x41\x6C\x6C","\x24\x6F\x72","\x41\x6E\x79","\x66\x69\x6E\x64\x41\x6C\x6C","\x66\x69\x6E\x64\x42\x79\x49\x64","\x61\x6C\x6C","\x73\x63\x6F\x70\x65","\x41\x75\x74\x6F\x6D\x61\x74\x69\x63\x20\x6D\x61\x69\x6C\x20\x73\x74\x61\x74\x75\x73\x20\x65\x72\x72\x6F\x72","\x75\x70\x64\x61\x74\x65","\x66\x69\x65\x6C\x64","\x76\x61\x6C\x75\x65","\x65\x71\x75\x61\x6C\x73","\x6E\x6F\x74\x5F\x65\x71\x75\x61\x6C\x73","\x6F\x70\x65\x72\x61\x74\x6F\x72","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x6D\x61\x74","\x68\x6F\x75\x72\x73","\x73\x75\x62\x74\x72\x61\x63\x74","\x67\x72\x65\x61\x74\x65\x72","\x67\x72\x65\x61\x74\x65\x72\x5F\x6F\x72\x5F\x65\x71\x75\x61\x6C","\x6C\x65\x73\x73","\x6C\x65\x73\x73\x5F\x6F\x72\x5F\x65\x71\x75\x61\x6C","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x4D\x61\x69\x6C\x20\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x20","\x20\x73\x65\x74\x20\x77\x69\x74\x68\x20\x74\x69\x6D\x65\x6F\x75\x74\x20","\x74\x69\x6D\x65\x6F\x75\x74","\x69\x6E\x74\x65\x72\x76\x61\x6C","\x65\x78\x70\x6F\x72\x74\x73","\x20\x63\x72\x65\x61\x74\x65\x64\x2C\x20\x74\x68\x65\x20\x73\x74\x61\x74\x75\x73\x20\x69\x73\x20","\x63\x68\x61\x6E\x6E\x65\x6C","\x6D\x61\x69\x6C","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x20\x75\x70\x64\x61\x74\x65\x64\x2C\x20\x74\x68\x65\x20\x73\x74\x61\x74\x75\x73\x20\x69\x73\x20","\x4D\x61\x69\x6C\x20\x61\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x20\x75\x6E\x73\x65\x74\x20","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x20\x64\x65\x6C\x65\x74\x65\x64","\x61\x66\x74\x65\x72\x44\x65\x6C\x65\x74\x65","\x4D\x61\x69\x6C\x20\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x20\x69\x6E\x69\x74\x20\x65\x72\x72\x6F\x72"];_0xfe58[0];var _=require(_0xfe58[1]);var config=require(_0xfe58[2]);var moment=require(_0xfe58[3]);var sequelize=require(_0xfe58[5])[_0xfe58[4]];var Automation=require(_0xfe58[5])[_0xfe58[6]];var MailRoom=require(_0xfe58[5])[_0xfe58[7]];var Settings=require(_0xfe58[5])[_0xfe58[8]];var activeMailAutomations={};function executeAutomation(_0xb573xa){console[_0xfe58[10]](_0xfe58[9],_0xb573xa);var _0xb573xb;return Automation[_0xfe58[30]](_0xfe58[29])[_0xfe58[28]](_0xb573xa)[_0xfe58[19]](function(_0xb573x10){_0xb573xb= _0xb573x10;var _0xb573x11={where:{$and:[],$or:[]}};_0xb573x10[_0xfe58[24]][_0xfe58[17]](function(_0xb573x12){_0xb573x11[_0xfe58[23]][_0xfe58[22]][_0xfe58[21]](getCondition(_0xb573x12[_0xfe58[20]]))});_0xb573x10[_0xfe58[26]][_0xfe58[17]](function(_0xb573x12){_0xb573x11[_0xfe58[23]][_0xfe58[25]][_0xfe58[21]](getCondition(_0xb573x12[_0xfe58[20]]))});return MailRoom[_0xfe58[27]](_0xb573x11)})[_0xfe58[19]](function(_0xb573xd){_0xb573xd[_0xfe58[17]](function(_0xb573xe){_0xb573xb[_0xfe58[18]][_0xfe58[17]](function(_0xb573xf){switch(_0xb573xf[_0xfe58[16]]){case _0xfe58[15]:setStatus(_0xb573xe[_0xfe58[13]],_0xb573xf[_0xfe58[14]]);break;default:}})})})[_0xfe58[12]](function(_0xb573xc){console[_0xfe58[10]](_0xfe58[11],_0xb573xc)})}function setStatus(_0xb573x14,_0xb573x15){return MailRoom[_0xfe58[32]]({status:_0xb573x15},{where:{id:_0xb573x14}})[_0xfe58[12]](function(_0xb573xc){console[_0xfe58[10]](_0xfe58[31],_0xb573xc)})}function getCondition(_0xb573x12){var _0xb573x17={};switch(_0xb573x12[_0xfe58[33]]){case _0xfe58[15]:switch(_0xb573x12[_0xfe58[37]]){case _0xfe58[35]:_0xb573x17[_0xb573x12[_0xfe58[33]]]= _0xb573x12[_0xfe58[34]];break;case _0xfe58[36]:_0xb573x17[_0xb573x12[_0xfe58[33]]]= {$ne:_0xb573x12[_0xfe58[34]]};break;default:};break;case _0xfe58[46]:var _0xb573x18=moment()[_0xfe58[41]](parseInt(_0xb573x12[_0xfe58[34]],10),_0xfe58[40])[_0xfe58[39]](_0xfe58[38]);switch(_0xb573x12[_0xfe58[37]]){case _0xfe58[42]:_0xb573x17[_0xb573x12[_0xfe58[33]]]= {lt:_0xb573x18};break;case _0xfe58[43]:_0xb573x17[_0xb573x12[_0xfe58[33]]]= {$lte:_0xb573x18};break;case _0xfe58[44]:_0xb573x17[_0xb573x12[_0xfe58[33]]]= {$gt:_0xb573x18};break;case _0xfe58[45]:_0xb573x17[_0xb573x12[_0xfe58[33]]]= {$gte:_0xb573x18};break;default:};break;default:};return _0xb573x17}function createInterval(_0xb573x10){console[_0xfe58[10]](_0xfe58[47],_0xb573x10[_0xfe58[13]],_0xfe58[48],_0xb573x10[_0xfe58[49]]* 60* 1000);activeMailAutomations[_0xfe58[50]+ _0xb573x10[_0xfe58[13]]]= setInterval(function(){executeAutomation(_0xb573x10[_0xfe58[13]])},_0xb573x10[_0xfe58[49]]* 60* 1000)}module[_0xfe58[51]]= function(){Automation[_0xfe58[55]](function(_0xb573x1a,_0xb573x1b){console[_0xfe58[10]](_0xfe58[47],_0xb573x1a[_0xfe58[13]],_0xfe58[52],_0xb573x1a[_0xfe58[15]]);if(_0xb573x1a[_0xfe58[15]]&& _0xb573x1a[_0xfe58[53]]=== _0xfe58[54]){createInterval(_0xb573x1a)}});Automation[_0xfe58[58]](function(_0xb573x1a,_0xb573x1b){console[_0xfe58[10]](_0xfe58[47],_0xb573x1a[_0xfe58[13]],_0xfe58[56],_0xb573x1a[_0xfe58[15]]);if(activeMailAutomations[_0xfe58[50]+ _0xb573x1a[_0xfe58[13]]]){console[_0xfe58[10]](_0xfe58[57],_0xb573x1a[_0xfe58[13]]);clearInterval(activeMailAutomations[_0xfe58[50]+ _0xb573x1a[_0xfe58[13]]]);delete activeMailAutomations[_0xfe58[50]+ _0xb573x1a[_0xfe58[13]]]};if(_0xb573x1a[_0xfe58[15]]&& _0xb573x1a[_0xfe58[53]]=== _0xfe58[54]){createInterval(_0xb573x1a)}});Automation[_0xfe58[60]](function(_0xb573x1a,_0xb573x1b){console[_0xfe58[10]](_0xfe58[47],_0xb573x1a[_0xfe58[13]],_0xfe58[59]);if(activeMailAutomations[_0xfe58[50]+ _0xb573x1a[_0xfe58[13]]]){console[_0xfe58[10]](_0xfe58[57],_0xb573x1a[_0xfe58[13]]);clearInterval(activeMailAutomations[_0xfe58[50]+ _0xb573x1a[_0xfe58[13]]]);delete activeMailAutomations[_0xfe58[50]+ _0xb573x1a[_0xfe58[13]]]}});return Automation[_0xfe58[30]](_0xfe58[29])[_0xfe58[27]]({where:{status:true,channel:_0xfe58[54]},attributes:[_0xfe58[13],_0xfe58[49]]})[_0xfe58[19]](function(_0xb573x1c){_0xb573x1c[_0xfe58[17]](function(_0xb573x10){createInterval(_0xb573x10)})})[_0xfe58[12]](function(_0xb573xc){console[_0xfe58[10]](_0xfe58[61],_0xb573xc)})}
\ No newline at end of file