Built motion from commit ec3309576.|1.0.33
[motion.git] / server / api / fax_room / fax_room.controller.js
index 0abd4d5..a92e14c 100644 (file)
@@ -1 +1 @@
-var _0x1e97=["\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","\x6D\x6F\x6D\x65\x6E\x74","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\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","\x46\x61\x78\x52\x6F\x6F\x6D","\x46\x61\x78\x4D\x65\x73\x73\x61\x67\x65","\x46\x61\x78\x41\x63\x63\x6F\x75\x6E\x74","\x46\x61\x78\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x46\x61\x78\x51\x75\x65\x75\x65","\x46\x61\x78\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\x46\x61\x78\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","\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","\x53\x45\x4C\x45\x43\x54\x20\x60\x46\x61\x78\x52\x6F\x6F\x6D\x60\x2E\x60\x69\x64\x60\x2C\x20\x60\x46\x61\x78\x52\x6F\x6F\x6D\x60\x2E\x60\x66\x72\x6F\x6D\x60\x2C\x20\x60\x46\x61\x78\x52\x6F\x6F\x6D\x60\x2E\x60\x61\x63\x63\x6F\x75\x6E\x74\x60\x2C\x20\x60\x46\x61\x78\x52\x6F\x6F\x6D\x60\x2E\x60\x73\x74\x61\x74\x75\x73\x60\x2C\x20\x60\x46\x61\x78\x52\x6F\x6F\x6D\x60\x2E\x60\x6C\x61\x73\x74\x45\x76\x65\x6E\x74\x60\x2C\x20\x60\x46\x61\x78\x52\x6F\x6F\x6D\x60\x2E\x60\x75\x70\x64\x61\x74\x65\x64\x41\x74\x60\x20\x46\x52\x4F\x4D\x20\x60\x66\x61\x78\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x41\x53\x20\x60\x46\x61\x78\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\x66\x61\x78\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\x66\x61\x78\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\x66\x61\x78\x5F\x72\x6F\x6F\x6D\x73\x60\x2E\x60\x55\x73\x65\x72\x49\x64\x60\x29\x20\x4F\x4E\x20\x60\x46\x61\x78\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\x66\x61\x78\x5F\x72\x6F\x6F\x6D\x73\x60\x2E\x60\x46\x61\x78\x52\x6F\x6F\x6D\x49\x64\x60\x20\x57\x48\x45\x52\x45\x20\x28\x60\x46\x61\x78\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\x46\x61\x78\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\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\x66\x61\x78\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x57\x48\x45\x52\x45\x20\x60\x66\x61\x78\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","\x6F\x70\x65\x6E\x52\x6F\x6F\x6D","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x61\x64\x64\x55\x73\x65\x72","\x75\x70\x64\x61\x74\x65","\x73\x68\x6F\x77","\x73\x68\x6F\x77\x41\x67\x65\x6E\x74\x73","\x6E\x61\x6D\x65","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\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","\x46\x61\x78\x52\x6F\x6F\x6D\x49\x64","\x74\x65\x78\x74","\x66\x61\x78\x4D\x65\x73\x73\x61\x67\x65\x41\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x61\x6D\x69","\x6C\x6F\x63\x61\x6C\x73","\x61\x70\x70","\x63\x68\x61\x6E\x67\x65\x64","\x66\x61\x78\x52\x6F\x6F\x6D\x41\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x6A\x6F\x62\x49\x64","\x46\x61\x78\x20\x61\x6C\x72\x65\x61\x64\x79\x20\x61\x73\x73\x69\x67\x6E\x65\x64","\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","\x69\x64\x73","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x75\x70\x64\x61\x74\x65\x50\x61\x74\x63\x68","\x2C","\x73\x70\x6C\x69\x74","\x67\x65\x74\x44\x61\x73\x68\x62\x6F\x61\x72\x64\x56\x61\x6C\x75\x65\x73","\x6B\x65\x79\x42\x79","\x6D\x61\x70\x56\x61\x6C\x75\x65\x73","\x53\x45\x4C\x45\x43\x54\x20\x4C\x4F\x57\x45\x52\x28\x73\x74\x61\x74\x75\x73\x29\x20\x41\x53\x20\x73\x74\x61\x74\x75\x73\x2C\x20\x43\x4F\x55\x4E\x54\x28\x69\x64\x29\x20\x41\x53\x20\x63\x6F\x75\x6E\x74\x20\x46\x52\x4F\x4D\x20\x66\x61\x78\x5F\x72\x6F\x6F\x6D\x73\x20\x57\x48\x45\x52\x45\x20\x64\x65\x6C\x65\x74\x65\x64\x41\x74\x20\x49\x53\x20\x4E\x55\x4C\x4C\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x73\x74\x61\x74\x75\x73","\x67\x65\x74\x52\x6F\x6F\x6D\x42\x79\x4D\x65\x73\x73\x61\x67\x65","\x67\x65\x74\x46\x61\x78\x52\x6F\x6F\x6D"];_0x1e97[0];var _=require(_0x1e97[1]);var util=require(_0x1e97[2]);var Util=require(_0x1e97[3]);var moment=require(_0x1e97[4]);var logger=require(_0x1e97[6])(_0x1e97[5]);var sequelize=require(_0x1e97[8])[_0x1e97[7]];var User=require(_0x1e97[8])[_0x1e97[9]];var Agent=require(_0x1e97[8])[_0x1e97[9]];var Contact=require(_0x1e97[8])[_0x1e97[10]];var FaxRoom=require(_0x1e97[8])[_0x1e97[11]];var FaxMessage=require(_0x1e97[8])[_0x1e97[12]];var FaxAccount=require(_0x1e97[8])[_0x1e97[13]];var FaxApplication=require(_0x1e97[8])[_0x1e97[14]];var FaxQueue=require(_0x1e97[8])[_0x1e97[15]];var FaxAttachment=require(_0x1e97[8])[_0x1e97[16]];exports[_0x1e97[17]]= function(_0xaf0ex10,_0xaf0ex11,_0xaf0ex12){return FaxRoom[_0x1e97[26]](_0x1e97[25])[_0x1e97[24]](Util[_0x1e97[23]](_0xaf0ex10[_0x1e97[22]]))[_0x1e97[21]](function(_0xaf0ex14){return _0xaf0ex11[_0x1e97[20]](200)[_0x1e97[19]](_0xaf0ex14)})[_0x1e97[18]](function(_0xaf0ex13){return handleError(_0xaf0ex11,_0xaf0ex13)})};exports[_0x1e97[27]]= function(_0xaf0ex10,_0xaf0ex11){return FaxRoom[_0x1e97[27]]()[_0x1e97[21]](function(_0xaf0ex15){return _0xaf0ex11[_0x1e97[20]](200)[_0x1e97[19]](_0xaf0ex15)})[_0x1e97[18]](function(_0xaf0ex13){return handleError(_0xaf0ex11,_0xaf0ex13)})};function getFaxQueues(_0xaf0ex17){return function(){switch(_0xaf0ex17[_0x1e97[33]]){case _0x1e97[32]:return User[_0x1e97[31]](_0xaf0ex17[_0x1e97[28]],{attributes:[_0x1e97[28]]})[_0x1e97[21]](Util[_0x1e97[30]]({},{attributes:[_0x1e97[28]]}))[_0x1e97[21]](function(_0xaf0ex18){return {include:{model:FaxAccount,include:{model:FaxApplication,include:{model:FaxQueue,where:{id:_[_0x1e97[29]](_0xaf0ex18,_0x1e97[28])}}}}}});default:return {}}}}exports[_0x1e97[34]]= function(_0xaf0ex10,_0xaf0ex11){return Promise[_0x1e97[40]]([])[_0x1e97[21]](getFaxQueues(_0xaf0ex10[_0x1e97[32]]))[_0x1e97[21]](function(_0xaf0ex1a){return FaxRoom[_0x1e97[39]](_[_0x1e97[38]](Util[_0x1e97[23]](_0xaf0ex10[_0x1e97[22]],{status:_0x1e97[35],updatedAt:{$gte:moment()[_0x1e97[37]](_0x1e97[36])}}),_0xaf0ex1a))})[_0x1e97[21]](function(_0xaf0ex19){return _0xaf0ex11[_0x1e97[20]](200)[_0x1e97[19]]({value:_0xaf0ex19})})[_0x1e97[18]](function(_0xaf0ex13){return handleError(_0xaf0ex11,_0xaf0ex13)})};exports[_0x1e97[41]]= function(_0xaf0ex10,_0xaf0ex11){return Promise[_0x1e97[40]]([])[_0x1e97[21]](getFaxQueues(_0xaf0ex10[_0x1e97[32]]))[_0x1e97[21]](function(_0xaf0ex1a){return FaxRoom[_0x1e97[39]](_[_0x1e97[38]](Util[_0x1e97[23]](_0xaf0ex10[_0x1e97[22]],{status:_0x1e97[42],updatedAt:{$gte:moment()[_0x1e97[37]](_0x1e97[36])}}),_0xaf0ex1a))})[_0x1e97[21]](function(_0xaf0ex19){return _0xaf0ex11[_0x1e97[20]](200)[_0x1e97[19]]({value:_0xaf0ex19})})[_0x1e97[18]](function(_0xaf0ex13){return handleError(_0xaf0ex11,_0xaf0ex13)})};exports[_0x1e97[43]]= function(_0xaf0ex10,_0xaf0ex11){return Promise[_0x1e97[40]]([])[_0x1e97[21]](getFaxQueues(_0xaf0ex10[_0x1e97[32]]))[_0x1e97[21]](function(_0xaf0ex1a){return FaxRoom[_0x1e97[39]](_[_0x1e97[38]](Util[_0x1e97[23]](_0xaf0ex10[_0x1e97[22]],{status:_0x1e97[44],updatedAt:{$gte:moment()[_0x1e97[37]](_0x1e97[36])}}),_0xaf0ex1a))})[_0x1e97[21]](function(_0xaf0ex19){return _0xaf0ex11[_0x1e97[20]](200)[_0x1e97[19]]({value:_0xaf0ex19})})[_0x1e97[18]](function(_0xaf0ex13){return handleError(_0xaf0ex11,_0xaf0ex13)})};exports[_0x1e97[45]]= function(_0xaf0ex10,_0xaf0ex11){return Promise[_0x1e97[40]]([])[_0x1e97[21]](getFaxQueues(_0xaf0ex10[_0x1e97[32]]))[_0x1e97[21]](function(_0xaf0ex1a){return FaxRoom[_0x1e97[39]](_[_0x1e97[38]](Util[_0x1e97[23]](_0xaf0ex10[_0x1e97[22]],{status:_0x1e97[46],updatedAt:{$gte:moment()[_0x1e97[37]](_0x1e97[36])}}),_0xaf0ex1a))})[_0x1e97[21]](function(_0xaf0ex19){return _0xaf0ex11[_0x1e97[20]](200)[_0x1e97[19]]({value:_0xaf0ex19})})[_0x1e97[18]](function(_0xaf0ex13){return handleError(_0xaf0ex11,_0xaf0ex13)})};exports[_0x1e97[47]]= function(_0xaf0ex10,_0xaf0ex11,_0xaf0ex12){switch(_0xaf0ex10[_0x1e97[32]][_0x1e97[33]]){case _0x1e97[52]:return sequelize[_0x1e97[22]](_0x1e97[48],{replacements:{status:_0x1e97[49],id:_0xaf0ex10[_0x1e97[32]][_0x1e97[28]]},type:sequelize[_0x1e97[51]][_0x1e97[50]]})[_0x1e97[21]](function(_0xaf0ex14){return _0xaf0ex11[_0x1e97[20]](200)[_0x1e97[19]](_0xaf0ex14)})[_0x1e97[18]](function(_0xaf0ex13){return handleError(_0xaf0ex11,_0xaf0ex13)});default:return sequelize[_0x1e97[22]](_0x1e97[53],{replacements:{status:_0x1e97[49],id:_0xaf0ex10[_0x1e97[32]][_0x1e97[28]]},type:sequelize[_0x1e97[51]][_0x1e97[50]]})[_0x1e97[21]](function(_0xaf0ex14){return _0xaf0ex11[_0x1e97[20]](200)[_0x1e97[19]](_0xaf0ex14)})[_0x1e97[18]](function(_0xaf0ex13){return handleError(_0xaf0ex11,_0xaf0ex13)})}};exports[_0x1e97[54]]= function(_0xaf0ex10,_0xaf0ex11,_0xaf0ex12){return FaxRoom[_0x1e97[56]]({where:{UserId:_0xaf0ex10[_0x1e97[55]][_0x1e97[28]]},include:[{all:true}]})[_0x1e97[21]](function(_0xaf0ex1b){return _0xaf0ex11[_0x1e97[20]](200)[_0x1e97[19]](_0xaf0ex1b)})[_0x1e97[18]](function(_0xaf0ex13){return handleError(_0xaf0ex11,_0xaf0ex13)})};exports[_0x1e97[57]]= function(_0xaf0ex10,_0xaf0ex11,_0xaf0ex12){var _0xaf0ex1c;if(_0xaf0ex10[_0x1e97[32]][_0x1e97[33]]=== _0x1e97[52]){return FaxRoom[_0x1e97[31]](_0xaf0ex10[_0x1e97[55]][_0x1e97[28]])[_0x1e97[21]](function(_0xaf0ex1d){_0xaf0ex1c= _0xaf0ex1d;if(!_0xaf0ex1c){return _0xaf0ex11[_0x1e97[58]](404)};return _0xaf0ex1c[_0x1e97[60]]({status:_0x1e97[44]},{userId:_0xaf0ex10[_0x1e97[32]][_0x1e97[28]]})})[_0x1e97[21]](function(){return _0xaf0ex1c[_0x1e97[59]](_0xaf0ex10[_0x1e97[32]][_0x1e97[28]])})[_0x1e97[21]](function(){return _0xaf0ex11[_0x1e97[58]](200)})[_0x1e97[18]](function(_0xaf0ex13){return handleError(_0xaf0ex11,_0xaf0ex13)})}};exports[_0x1e97[61]]= function(_0xaf0ex10,_0xaf0ex11,_0xaf0ex12){return FaxRoom[_0x1e97[26]](_0x1e97[25])[_0x1e97[31]](_0xaf0ex10[_0x1e97[55]][_0x1e97[28]])[_0x1e97[21]](function(_0xaf0ex1d){if(!_0xaf0ex1d){return _0xaf0ex11[_0x1e97[58]](404)};return _0xaf0ex11[_0x1e97[19]](_0xaf0ex1d)})[_0x1e97[18]](function(_0xaf0ex13){return handleError(_0xaf0ex11,_0xaf0ex13)})};exports[_0x1e97[62]]= function(_0xaf0ex10,_0xaf0ex11,_0xaf0ex12){return FaxRoom[_0x1e97[31]](_0xaf0ex10[_0x1e97[55]][_0x1e97[28]])[_0x1e97[21]](function(_0xaf0ex1d){if(!_0xaf0ex1d){return _0xaf0ex11[_0x1e97[58]](404)};return _0xaf0ex1d[_0x1e97[67]]({attributes:[_0x1e97[28],_0x1e97[63],_0x1e97[64],_0x1e97[65],_0x1e97[33],_0x1e97[66]]})})[_0x1e97[21]](function(_0xaf0ex1e){return _0xaf0ex11[_0x1e97[19]](_0xaf0ex1e)})[_0x1e97[18]](function(_0xaf0ex13){return handleError(_0xaf0ex11,_0xaf0ex13)})};exports[_0x1e97[68]]= function(_0xaf0ex10,_0xaf0ex11,_0xaf0ex12){return FaxRoom[_0x1e97[68]](_0xaf0ex10[_0x1e97[69]])[_0x1e97[21]](function(_0xaf0ex1d){return _0xaf0ex11[_0x1e97[20]](201)[_0x1e97[19]](_0xaf0ex1d)})[_0x1e97[18]](function(_0xaf0ex13){return handleError(_0xaf0ex11,_0xaf0ex13)})};exports[_0x1e97[70]]= function(_0xaf0ex10,_0xaf0ex11,_0xaf0ex12){_0xaf0ex10[_0x1e97[69]][_0x1e97[71]]= _0xaf0ex10[_0x1e97[32]][_0x1e97[28]];_0xaf0ex10[_0x1e97[69]][_0x1e97[72]]= _0xaf0ex10[_0x1e97[55]][_0x1e97[28]];_0xaf0ex10[_0x1e97[69]][_0x1e97[73]]= _0xaf0ex10[_0x1e97[69]][_0x1e97[73]];return FaxMessage[_0x1e97[68]](_0xaf0ex10[_0x1e97[69]],{include:[{model:FaxAttachment}],user:_0xaf0ex10[_0x1e97[32]]})[_0x1e97[21]](function(_0xaf0ex1f){if(_0xaf0ex1f){_0xaf0ex10[_0x1e97[77]][_0x1e97[76]][_0x1e97[75]][_0x1e97[19]]({message:_0x1e97[74],doc:_0xaf0ex1f,options:{user:_0xaf0ex10[_0x1e97[32]]}})};return _0xaf0ex11[_0x1e97[20]](201)[_0x1e97[19]](_0xaf0ex1f)})[_0x1e97[18]](function(_0xaf0ex13){return handleError(_0xaf0ex11,_0xaf0ex13)})};exports[_0x1e97[60]]= function(_0xaf0ex10,_0xaf0ex11,_0xaf0ex12){return FaxRoom[_0x1e97[31]](_0xaf0ex10[_0x1e97[55]][_0x1e97[28]])[_0x1e97[21]](function(_0xaf0ex1d){if(!_0xaf0ex1d){return _0xaf0ex11[_0x1e97[58]](404)};if(_0xaf0ex1d[_0x1e97[80]]){throw  new Error(_0x1e97[81])};var _0xaf0ex20=_[_0x1e97[38]](_0xaf0ex1d,_0xaf0ex10[_0x1e97[69]]);return _0xaf0ex20[_0x1e97[82]]()})[_0x1e97[21]](function(_0xaf0ex1d){if(_0xaf0ex1d[_0x1e97[78]](_0x1e97[20])&& _0xaf0ex1d[_0x1e97[20]]=== _0x1e97[46]){_0xaf0ex10[_0x1e97[77]][_0x1e97[76]][_0x1e97[75]][_0x1e97[19]]({message:_0x1e97[79],doc:_0xaf0ex1d})};return _0xaf0ex11[_0x1e97[20]](200)[_0x1e97[19]](_0xaf0ex1d)})[_0x1e97[18]](function(_0xaf0ex13){return handleError(_0xaf0ex11,_0xaf0ex13)})};exports[_0x1e97[83]]= function(_0xaf0ex10,_0xaf0ex11,_0xaf0ex12){return FaxRoom[_0x1e97[31]](_0xaf0ex10[_0x1e97[55]][_0x1e97[28]])[_0x1e97[21]](function(_0xaf0ex1d){if(!_0xaf0ex1d){return _0xaf0ex11[_0x1e97[58]](404)};return _0xaf0ex1d[_0x1e97[85]](_0xaf0ex10[_0x1e97[69]][_0x1e97[84]],{individualHooks:true})})[_0x1e97[21]](function(){return _0xaf0ex11[_0x1e97[58]](200)})[_0x1e97[18]](function(_0xaf0ex13){return handleError(_0xaf0ex11,_0xaf0ex13)})};exports[_0x1e97[86]]= function(_0xaf0ex10,_0xaf0ex11,_0xaf0ex12){return FaxRoom[_0x1e97[31]](_0xaf0ex10[_0x1e97[55]][_0x1e97[28]])[_0x1e97[21]](function(_0xaf0ex1d){if(!_0xaf0ex1d){return _0xaf0ex11[_0x1e97[58]](404)};return _0xaf0ex1d[_0x1e97[86]]()})[_0x1e97[21]](function(){return _0xaf0ex11[_0x1e97[58]](204)})[_0x1e97[18]](function(_0xaf0ex13){return handleError(_0xaf0ex11,_0xaf0ex13)})};exports[_0x1e97[87]]= function(_0xaf0ex10,_0xaf0ex11){return FaxRoom[_0x1e97[86]]({where:{id:_0xaf0ex10[_0x1e97[22]][_0x1e97[88]]},individualHooks:true})[_0x1e97[21]](function(){return _0xaf0ex11[_0x1e97[58]](200)})[_0x1e97[18]](function(_0xaf0ex13){return handleError(_0xaf0ex11,_0xaf0ex13)})};function handleError(_0xaf0ex11,_0xaf0ex13){logger[_0x1e97[90]](_0xaf0ex13[_0x1e97[89]]);return _0xaf0ex11[_0x1e97[20]](500)[_0x1e97[19]](_0xaf0ex13)}exports[_0x1e97[91]]= function(_0xaf0ex10,_0xaf0ex11,_0xaf0ex12){var _0xaf0ex22={where:{id:_0xaf0ex10[_0x1e97[55]][_0x1e97[28]][_0x1e97[93]](_0x1e97[92])},user:_0xaf0ex10[_0x1e97[32]],individualHooks:true};return FaxRoom[_0x1e97[60]](_0xaf0ex10[_0x1e97[69]],_0xaf0ex22)[_0x1e97[21]](function(_0xaf0ex23){if(!_0xaf0ex23){return _0xaf0ex11[_0x1e97[58]](404)};return _0xaf0ex23})[_0x1e97[21]](function(_0xaf0ex23){return _0xaf0ex11[_0x1e97[58]](200)})[_0x1e97[18]](function(_0xaf0ex13){return handleError(_0xaf0ex11,_0xaf0ex13)})};exports[_0x1e97[94]]= function(_0xaf0ex10,_0xaf0ex11){return sequelize[_0x1e97[22]](_0x1e97[97],{type:sequelize[_0x1e97[51]][_0x1e97[50]]})[_0x1e97[21]](function(_0xaf0ex24){var _0xaf0ex25=_[_0x1e97[38]]({new:0,open:0,pending:0,closed:0},_[_0x1e97[96]](_[_0x1e97[95]](_0xaf0ex24,_0x1e97[20]),_0x1e97[39]));return _0xaf0ex11[_0x1e97[20]](200)[_0x1e97[19]](_0xaf0ex25)})[_0x1e97[18]](function(_0xaf0ex13){return handleError(_0xaf0ex11,_0xaf0ex13)})};exports[_0x1e97[98]]= function(_0xaf0ex10,_0xaf0ex11,_0xaf0ex12){return FaxMessage[_0x1e97[31]](_0xaf0ex10[_0x1e97[55]][_0x1e97[28]])[_0x1e97[21]](function(_0xaf0ex1f){return _0xaf0ex1f[_0x1e97[99]]({include:[{model:FaxAccount},{model:FaxMessage,include:[{model:FaxAttachment},{model:User,attributes:[_0x1e97[28],_0x1e97[63],_0x1e97[64],_0x1e97[65]]}]},{model:User,attributes:[_0x1e97[28],_0x1e97[63],_0x1e97[64],_0x1e97[65]]}]})})[_0x1e97[21]](function(_0xaf0ex1d){return _0xaf0ex11[_0x1e97[19]](_0xaf0ex1d)})[_0x1e97[18]](function(_0xaf0ex13){return handleError(_0xaf0ex11,_0xaf0ex13)})}
\ No newline at end of file
+var _0xfe1d=["\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","\x6D\x6F\x6D\x65\x6E\x74","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\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","\x46\x61\x78\x52\x6F\x6F\x6D","\x46\x61\x78\x4D\x65\x73\x73\x61\x67\x65","\x46\x61\x78\x41\x63\x63\x6F\x75\x6E\x74","\x46\x61\x78\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x46\x61\x78\x51\x75\x65\x75\x65","\x46\x61\x78\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\x46\x61\x78\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","\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","\x53\x45\x4C\x45\x43\x54\x20\x60\x46\x61\x78\x52\x6F\x6F\x6D\x60\x2E\x60\x69\x64\x60\x2C\x20\x60\x46\x61\x78\x52\x6F\x6F\x6D\x60\x2E\x60\x66\x72\x6F\x6D\x60\x2C\x20\x60\x46\x61\x78\x52\x6F\x6F\x6D\x60\x2E\x60\x61\x63\x63\x6F\x75\x6E\x74\x60\x2C\x20\x60\x46\x61\x78\x52\x6F\x6F\x6D\x60\x2E\x60\x73\x74\x61\x74\x75\x73\x60\x2C\x20\x60\x46\x61\x78\x52\x6F\x6F\x6D\x60\x2E\x60\x6C\x61\x73\x74\x45\x76\x65\x6E\x74\x60\x2C\x20\x60\x46\x61\x78\x52\x6F\x6F\x6D\x60\x2E\x60\x75\x70\x64\x61\x74\x65\x64\x41\x74\x60\x20\x46\x52\x4F\x4D\x20\x60\x66\x61\x78\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x41\x53\x20\x60\x46\x61\x78\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\x66\x61\x78\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\x66\x61\x78\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\x66\x61\x78\x5F\x72\x6F\x6F\x6D\x73\x60\x2E\x60\x55\x73\x65\x72\x49\x64\x60\x29\x20\x4F\x4E\x20\x60\x46\x61\x78\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\x66\x61\x78\x5F\x72\x6F\x6F\x6D\x73\x60\x2E\x60\x46\x61\x78\x52\x6F\x6F\x6D\x49\x64\x60\x20\x57\x48\x45\x52\x45\x20\x28\x60\x46\x61\x78\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\x46\x61\x78\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\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\x66\x61\x78\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x57\x48\x45\x52\x45\x20\x60\x66\x61\x78\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","\x6F\x70\x65\x6E\x52\x6F\x6F\x6D","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x61\x64\x64\x55\x73\x65\x72","\x75\x70\x64\x61\x74\x65","\x73\x68\x6F\x77","\x73\x68\x6F\x77\x41\x67\x65\x6E\x74\x73","\x6E\x61\x6D\x65","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\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","\x46\x61\x78\x52\x6F\x6F\x6D\x49\x64","\x74\x65\x78\x74","\x66\x61\x78\x4D\x65\x73\x73\x61\x67\x65\x41\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x61\x6D\x69","\x6C\x6F\x63\x61\x6C\x73","\x61\x70\x70","\x63\x68\x61\x6E\x67\x65\x64","\x66\x61\x78\x52\x6F\x6F\x6D\x41\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x6A\x6F\x62\x49\x64","\x46\x61\x78\x20\x61\x6C\x72\x65\x61\x64\x79\x20\x61\x73\x73\x69\x67\x6E\x65\x64","\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","\x69\x64\x73","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x75\x70\x64\x61\x74\x65\x50\x61\x74\x63\x68","\x2C","\x73\x70\x6C\x69\x74","\x67\x65\x74\x44\x61\x73\x68\x62\x6F\x61\x72\x64\x56\x61\x6C\x75\x65\x73","\x6B\x65\x79\x42\x79","\x6D\x61\x70\x56\x61\x6C\x75\x65\x73","\x53\x45\x4C\x45\x43\x54\x20\x4C\x4F\x57\x45\x52\x28\x73\x74\x61\x74\x75\x73\x29\x20\x41\x53\x20\x73\x74\x61\x74\x75\x73\x2C\x20\x43\x4F\x55\x4E\x54\x28\x69\x64\x29\x20\x41\x53\x20\x63\x6F\x75\x6E\x74\x20\x46\x52\x4F\x4D\x20\x66\x61\x78\x5F\x72\x6F\x6F\x6D\x73\x20\x57\x48\x45\x52\x45\x20\x64\x65\x6C\x65\x74\x65\x64\x41\x74\x20\x49\x53\x20\x4E\x55\x4C\x4C\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x73\x74\x61\x74\x75\x73","\x67\x65\x74\x52\x6F\x6F\x6D\x42\x79\x4D\x65\x73\x73\x61\x67\x65","\x67\x65\x74\x46\x61\x78\x52\x6F\x6F\x6D"];_0xfe1d[0];var _=require(_0xfe1d[1]);var util=require(_0xfe1d[2]);var Util=require(_0xfe1d[3]);var moment=require(_0xfe1d[4]);var logger=require(_0xfe1d[6])(_0xfe1d[5]);var sequelize=require(_0xfe1d[8])[_0xfe1d[7]];var User=require(_0xfe1d[8])[_0xfe1d[9]];var Agent=require(_0xfe1d[8])[_0xfe1d[9]];var Contact=require(_0xfe1d[8])[_0xfe1d[10]];var FaxRoom=require(_0xfe1d[8])[_0xfe1d[11]];var FaxMessage=require(_0xfe1d[8])[_0xfe1d[12]];var FaxAccount=require(_0xfe1d[8])[_0xfe1d[13]];var FaxApplication=require(_0xfe1d[8])[_0xfe1d[14]];var FaxQueue=require(_0xfe1d[8])[_0xfe1d[15]];var FaxAttachment=require(_0xfe1d[8])[_0xfe1d[16]];exports[_0xfe1d[17]]= function(_0x3d1cx10,_0x3d1cx11,_0x3d1cx12){return FaxRoom[_0xfe1d[26]](_0xfe1d[25])[_0xfe1d[24]](Util[_0xfe1d[23]](_0x3d1cx10[_0xfe1d[22]]))[_0xfe1d[21]](function(_0x3d1cx14){return _0x3d1cx11[_0xfe1d[20]](200)[_0xfe1d[19]](_0x3d1cx14)})[_0xfe1d[18]](function(_0x3d1cx13){return handleError(_0x3d1cx11,_0x3d1cx13)})};exports[_0xfe1d[27]]= function(_0x3d1cx10,_0x3d1cx11){return FaxRoom[_0xfe1d[27]]()[_0xfe1d[21]](function(_0x3d1cx15){return _0x3d1cx11[_0xfe1d[20]](200)[_0xfe1d[19]](_0x3d1cx15)})[_0xfe1d[18]](function(_0x3d1cx13){return handleError(_0x3d1cx11,_0x3d1cx13)})};function getFaxQueues(_0x3d1cx17){return function(){switch(_0x3d1cx17[_0xfe1d[33]]){case _0xfe1d[32]:return User[_0xfe1d[31]](_0x3d1cx17[_0xfe1d[28]],{attributes:[_0xfe1d[28]]})[_0xfe1d[21]](Util[_0xfe1d[30]]({},{attributes:[_0xfe1d[28]]}))[_0xfe1d[21]](function(_0x3d1cx18){return {include:{model:FaxAccount,include:{model:FaxApplication,include:{model:FaxQueue,where:{id:_[_0xfe1d[29]](_0x3d1cx18,_0xfe1d[28])}}}}}});default:return {}}}}exports[_0xfe1d[34]]= function(_0x3d1cx10,_0x3d1cx11){return Promise[_0xfe1d[40]]([])[_0xfe1d[21]](getFaxQueues(_0x3d1cx10[_0xfe1d[32]]))[_0xfe1d[21]](function(_0x3d1cx1a){return FaxRoom[_0xfe1d[39]](_[_0xfe1d[38]](Util[_0xfe1d[23]](_0x3d1cx10[_0xfe1d[22]],{status:_0xfe1d[35],updatedAt:{$gte:moment()[_0xfe1d[37]](_0xfe1d[36])}}),_0x3d1cx1a))})[_0xfe1d[21]](function(_0x3d1cx19){return _0x3d1cx11[_0xfe1d[20]](200)[_0xfe1d[19]]({value:_0x3d1cx19})})[_0xfe1d[18]](function(_0x3d1cx13){return handleError(_0x3d1cx11,_0x3d1cx13)})};exports[_0xfe1d[41]]= function(_0x3d1cx10,_0x3d1cx11){return Promise[_0xfe1d[40]]([])[_0xfe1d[21]](getFaxQueues(_0x3d1cx10[_0xfe1d[32]]))[_0xfe1d[21]](function(_0x3d1cx1a){return FaxRoom[_0xfe1d[39]](_[_0xfe1d[38]](Util[_0xfe1d[23]](_0x3d1cx10[_0xfe1d[22]],{status:_0xfe1d[42],updatedAt:{$gte:moment()[_0xfe1d[37]](_0xfe1d[36])}}),_0x3d1cx1a))})[_0xfe1d[21]](function(_0x3d1cx19){return _0x3d1cx11[_0xfe1d[20]](200)[_0xfe1d[19]]({value:_0x3d1cx19})})[_0xfe1d[18]](function(_0x3d1cx13){return handleError(_0x3d1cx11,_0x3d1cx13)})};exports[_0xfe1d[43]]= function(_0x3d1cx10,_0x3d1cx11){return Promise[_0xfe1d[40]]([])[_0xfe1d[21]](getFaxQueues(_0x3d1cx10[_0xfe1d[32]]))[_0xfe1d[21]](function(_0x3d1cx1a){return FaxRoom[_0xfe1d[39]](_[_0xfe1d[38]](Util[_0xfe1d[23]](_0x3d1cx10[_0xfe1d[22]],{status:_0xfe1d[44],updatedAt:{$gte:moment()[_0xfe1d[37]](_0xfe1d[36])}}),_0x3d1cx1a))})[_0xfe1d[21]](function(_0x3d1cx19){return _0x3d1cx11[_0xfe1d[20]](200)[_0xfe1d[19]]({value:_0x3d1cx19})})[_0xfe1d[18]](function(_0x3d1cx13){return handleError(_0x3d1cx11,_0x3d1cx13)})};exports[_0xfe1d[45]]= function(_0x3d1cx10,_0x3d1cx11){return Promise[_0xfe1d[40]]([])[_0xfe1d[21]](getFaxQueues(_0x3d1cx10[_0xfe1d[32]]))[_0xfe1d[21]](function(_0x3d1cx1a){return FaxRoom[_0xfe1d[39]](_[_0xfe1d[38]](Util[_0xfe1d[23]](_0x3d1cx10[_0xfe1d[22]],{status:_0xfe1d[46],updatedAt:{$gte:moment()[_0xfe1d[37]](_0xfe1d[36])}}),_0x3d1cx1a))})[_0xfe1d[21]](function(_0x3d1cx19){return _0x3d1cx11[_0xfe1d[20]](200)[_0xfe1d[19]]({value:_0x3d1cx19})})[_0xfe1d[18]](function(_0x3d1cx13){return handleError(_0x3d1cx11,_0x3d1cx13)})};exports[_0xfe1d[47]]= function(_0x3d1cx10,_0x3d1cx11,_0x3d1cx12){switch(_0x3d1cx10[_0xfe1d[32]][_0xfe1d[33]]){case _0xfe1d[52]:return sequelize[_0xfe1d[22]](_0xfe1d[48],{replacements:{status:_0xfe1d[49],id:_0x3d1cx10[_0xfe1d[32]][_0xfe1d[28]]},type:sequelize[_0xfe1d[51]][_0xfe1d[50]]})[_0xfe1d[21]](function(_0x3d1cx14){return _0x3d1cx11[_0xfe1d[20]](200)[_0xfe1d[19]](_0x3d1cx14)})[_0xfe1d[18]](function(_0x3d1cx13){return handleError(_0x3d1cx11,_0x3d1cx13)});default:return sequelize[_0xfe1d[22]](_0xfe1d[53],{replacements:{status:_0xfe1d[49],id:_0x3d1cx10[_0xfe1d[32]][_0xfe1d[28]]},type:sequelize[_0xfe1d[51]][_0xfe1d[50]]})[_0xfe1d[21]](function(_0x3d1cx14){return _0x3d1cx11[_0xfe1d[20]](200)[_0xfe1d[19]](_0x3d1cx14)})[_0xfe1d[18]](function(_0x3d1cx13){return handleError(_0x3d1cx11,_0x3d1cx13)})}};exports[_0xfe1d[54]]= function(_0x3d1cx10,_0x3d1cx11,_0x3d1cx12){return FaxRoom[_0xfe1d[56]]({where:{UserId:_0x3d1cx10[_0xfe1d[55]][_0xfe1d[28]]},include:[{all:true}]})[_0xfe1d[21]](function(_0x3d1cx1b){return _0x3d1cx11[_0xfe1d[20]](200)[_0xfe1d[19]](_0x3d1cx1b)})[_0xfe1d[18]](function(_0x3d1cx13){return handleError(_0x3d1cx11,_0x3d1cx13)})};exports[_0xfe1d[57]]= function(_0x3d1cx10,_0x3d1cx11,_0x3d1cx12){var _0x3d1cx1c;if(_0x3d1cx10[_0xfe1d[32]][_0xfe1d[33]]=== _0xfe1d[52]){return FaxRoom[_0xfe1d[31]](_0x3d1cx10[_0xfe1d[55]][_0xfe1d[28]])[_0xfe1d[21]](function(_0x3d1cx1d){_0x3d1cx1c= _0x3d1cx1d;if(!_0x3d1cx1c){return _0x3d1cx11[_0xfe1d[58]](404)};return _0x3d1cx1c[_0xfe1d[60]]({status:_0xfe1d[44]},{userId:_0x3d1cx10[_0xfe1d[32]][_0xfe1d[28]]})})[_0xfe1d[21]](function(){return _0x3d1cx1c[_0xfe1d[59]](_0x3d1cx10[_0xfe1d[32]][_0xfe1d[28]])})[_0xfe1d[21]](function(){return _0x3d1cx11[_0xfe1d[58]](200)})[_0xfe1d[18]](function(_0x3d1cx13){return handleError(_0x3d1cx11,_0x3d1cx13)})}};exports[_0xfe1d[61]]= function(_0x3d1cx10,_0x3d1cx11,_0x3d1cx12){return FaxRoom[_0xfe1d[26]](_0xfe1d[25])[_0xfe1d[31]](_0x3d1cx10[_0xfe1d[55]][_0xfe1d[28]])[_0xfe1d[21]](function(_0x3d1cx1d){if(!_0x3d1cx1d){return _0x3d1cx11[_0xfe1d[58]](404)};return _0x3d1cx11[_0xfe1d[19]](_0x3d1cx1d)})[_0xfe1d[18]](function(_0x3d1cx13){return handleError(_0x3d1cx11,_0x3d1cx13)})};exports[_0xfe1d[62]]= function(_0x3d1cx10,_0x3d1cx11,_0x3d1cx12){return FaxRoom[_0xfe1d[31]](_0x3d1cx10[_0xfe1d[55]][_0xfe1d[28]])[_0xfe1d[21]](function(_0x3d1cx1d){if(!_0x3d1cx1d){return _0x3d1cx11[_0xfe1d[58]](404)};return _0x3d1cx1d[_0xfe1d[67]]({attributes:[_0xfe1d[28],_0xfe1d[63],_0xfe1d[64],_0xfe1d[65],_0xfe1d[33],_0xfe1d[66]]})})[_0xfe1d[21]](function(_0x3d1cx1e){return _0x3d1cx11[_0xfe1d[19]](_0x3d1cx1e)})[_0xfe1d[18]](function(_0x3d1cx13){return handleError(_0x3d1cx11,_0x3d1cx13)})};exports[_0xfe1d[68]]= function(_0x3d1cx10,_0x3d1cx11,_0x3d1cx12){return FaxRoom[_0xfe1d[68]](_0x3d1cx10[_0xfe1d[69]])[_0xfe1d[21]](function(_0x3d1cx1d){return _0x3d1cx11[_0xfe1d[20]](201)[_0xfe1d[19]](_0x3d1cx1d)})[_0xfe1d[18]](function(_0x3d1cx13){return handleError(_0x3d1cx11,_0x3d1cx13)})};exports[_0xfe1d[70]]= function(_0x3d1cx10,_0x3d1cx11,_0x3d1cx12){_0x3d1cx10[_0xfe1d[69]][_0xfe1d[71]]= _0x3d1cx10[_0xfe1d[32]][_0xfe1d[28]];_0x3d1cx10[_0xfe1d[69]][_0xfe1d[72]]= _0x3d1cx10[_0xfe1d[55]][_0xfe1d[28]];_0x3d1cx10[_0xfe1d[69]][_0xfe1d[73]]= _0x3d1cx10[_0xfe1d[69]][_0xfe1d[73]];return FaxMessage[_0xfe1d[68]](_0x3d1cx10[_0xfe1d[69]],{include:[{model:FaxAttachment}],user:_0x3d1cx10[_0xfe1d[32]]})[_0xfe1d[21]](function(_0x3d1cx1f){if(_0x3d1cx1f){_0x3d1cx10[_0xfe1d[77]][_0xfe1d[76]][_0xfe1d[75]][_0xfe1d[19]]({message:_0xfe1d[74],doc:_0x3d1cx1f,options:{user:_0x3d1cx10[_0xfe1d[32]]}})};return _0x3d1cx11[_0xfe1d[20]](201)[_0xfe1d[19]](_0x3d1cx1f)})[_0xfe1d[18]](function(_0x3d1cx13){return handleError(_0x3d1cx11,_0x3d1cx13)})};exports[_0xfe1d[60]]= function(_0x3d1cx10,_0x3d1cx11,_0x3d1cx12){return FaxRoom[_0xfe1d[31]](_0x3d1cx10[_0xfe1d[55]][_0xfe1d[28]])[_0xfe1d[21]](function(_0x3d1cx1d){if(!_0x3d1cx1d){return _0x3d1cx11[_0xfe1d[58]](404)};if(_0x3d1cx1d[_0xfe1d[80]]){throw  new Error(_0xfe1d[81])};var _0x3d1cx20=_[_0xfe1d[38]](_0x3d1cx1d,_0x3d1cx10[_0xfe1d[69]]);return _0x3d1cx20[_0xfe1d[82]]()})[_0xfe1d[21]](function(_0x3d1cx1d){if(_0x3d1cx1d[_0xfe1d[78]](_0xfe1d[20])&& _0x3d1cx1d[_0xfe1d[20]]=== _0xfe1d[46]){_0x3d1cx10[_0xfe1d[77]][_0xfe1d[76]][_0xfe1d[75]][_0xfe1d[19]]({message:_0xfe1d[79],doc:_0x3d1cx1d})};return _0x3d1cx11[_0xfe1d[20]](200)[_0xfe1d[19]](_0x3d1cx1d)})[_0xfe1d[18]](function(_0x3d1cx13){return handleError(_0x3d1cx11,_0x3d1cx13)})};exports[_0xfe1d[83]]= function(_0x3d1cx10,_0x3d1cx11,_0x3d1cx12){return FaxRoom[_0xfe1d[31]](_0x3d1cx10[_0xfe1d[55]][_0xfe1d[28]])[_0xfe1d[21]](function(_0x3d1cx1d){if(!_0x3d1cx1d){return _0x3d1cx11[_0xfe1d[58]](404)};return _0x3d1cx1d[_0xfe1d[85]](_0x3d1cx10[_0xfe1d[69]][_0xfe1d[84]],{individualHooks:true})})[_0xfe1d[21]](function(){return _0x3d1cx11[_0xfe1d[58]](200)})[_0xfe1d[18]](function(_0x3d1cx13){return handleError(_0x3d1cx11,_0x3d1cx13)})};exports[_0xfe1d[86]]= function(_0x3d1cx10,_0x3d1cx11,_0x3d1cx12){return FaxRoom[_0xfe1d[31]](_0x3d1cx10[_0xfe1d[55]][_0xfe1d[28]])[_0xfe1d[21]](function(_0x3d1cx1d){if(!_0x3d1cx1d){return _0x3d1cx11[_0xfe1d[58]](404)};return _0x3d1cx1d[_0xfe1d[86]]()})[_0xfe1d[21]](function(){return _0x3d1cx11[_0xfe1d[58]](204)})[_0xfe1d[18]](function(_0x3d1cx13){return handleError(_0x3d1cx11,_0x3d1cx13)})};exports[_0xfe1d[87]]= function(_0x3d1cx10,_0x3d1cx11){return FaxRoom[_0xfe1d[86]]({where:{id:_0x3d1cx10[_0xfe1d[22]][_0xfe1d[88]]},individualHooks:true})[_0xfe1d[21]](function(){return _0x3d1cx11[_0xfe1d[58]](200)})[_0xfe1d[18]](function(_0x3d1cx13){return handleError(_0x3d1cx11,_0x3d1cx13)})};function handleError(_0x3d1cx11,_0x3d1cx13){logger[_0xfe1d[90]](_0x3d1cx13[_0xfe1d[89]]);return _0x3d1cx11[_0xfe1d[20]](500)[_0xfe1d[19]](_0x3d1cx13)}exports[_0xfe1d[91]]= function(_0x3d1cx10,_0x3d1cx11,_0x3d1cx12){var _0x3d1cx22={where:{id:_0x3d1cx10[_0xfe1d[55]][_0xfe1d[28]][_0xfe1d[93]](_0xfe1d[92])},user:_0x3d1cx10[_0xfe1d[32]],individualHooks:true};return FaxRoom[_0xfe1d[60]](_0x3d1cx10[_0xfe1d[69]],_0x3d1cx22)[_0xfe1d[21]](function(_0x3d1cx23){if(!_0x3d1cx23){return _0x3d1cx11[_0xfe1d[58]](404)};return _0x3d1cx23})[_0xfe1d[21]](function(_0x3d1cx23){return _0x3d1cx11[_0xfe1d[58]](200)})[_0xfe1d[18]](function(_0x3d1cx13){return handleError(_0x3d1cx11,_0x3d1cx13)})};exports[_0xfe1d[94]]= function(_0x3d1cx10,_0x3d1cx11){return sequelize[_0xfe1d[22]](_0xfe1d[97],{type:sequelize[_0xfe1d[51]][_0xfe1d[50]]})[_0xfe1d[21]](function(_0x3d1cx24){var _0x3d1cx25=_[_0xfe1d[38]]({new:0,open:0,pending:0,closed:0},_[_0xfe1d[96]](_[_0xfe1d[95]](_0x3d1cx24,_0xfe1d[20]),_0xfe1d[39]));return _0x3d1cx11[_0xfe1d[20]](200)[_0xfe1d[19]](_0x3d1cx25)})[_0xfe1d[18]](function(_0x3d1cx13){return handleError(_0x3d1cx11,_0x3d1cx13)})};exports[_0xfe1d[98]]= function(_0x3d1cx10,_0x3d1cx11,_0x3d1cx12){return FaxMessage[_0xfe1d[31]](_0x3d1cx10[_0xfe1d[55]][_0xfe1d[28]])[_0xfe1d[21]](function(_0x3d1cx1f){return _0x3d1cx1f[_0xfe1d[99]]({include:[{model:FaxAccount},{model:FaxMessage,include:[{model:FaxAttachment},{model:User,attributes:[_0xfe1d[28],_0xfe1d[63],_0xfe1d[64],_0xfe1d[65]]}]},{model:User,attributes:[_0xfe1d[28],_0xfe1d[63],_0xfe1d[64],_0xfe1d[65]]}]})})[_0xfe1d[21]](function(_0x3d1cx1d){return _0x3d1cx11[_0xfe1d[19]](_0x3d1cx1d)})[_0xfe1d[18]](function(_0x3d1cx13){return handleError(_0x3d1cx11,_0x3d1cx13)})}
\ No newline at end of file