1bdc7f0ad00f4c2bd08ce1eef5edf40aab4d3926
[motion.git] / server / api / fax_message / fax_message.controller.js
1 var _0xa897=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x66\x73","\x70\x61\x74\x68","\x75\x70\x6C\x6F\x61\x64\x2D\x66\x69\x6C\x65","\x6E\x6F\x64\x65\x2D\x75\x75\x69\x64","\x68\x74\x6D\x6C\x2D\x70\x64\x66","\x66\x6F\x72\x6D\x69\x64\x61\x62\x6C\x65","\x65\x78\x65\x63","\x63\x68\x69\x6C\x64\x5F\x70\x72\x6F\x63\x65\x73\x73","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x46\x61\x78\x4D\x65\x73\x73\x61\x67\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x46\x61\x78\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74","\x46\x61\x78\x52\x6F\x6F\x6D","\x46\x61\x78\x41\x63\x63\x6F\x75\x6E\x74","\x55\x73\x65\x72","\x69\x6E\x64\x65\x78","\x63\x72\x65\x61\x74\x65\x64\x41\x74\x20\x44\x45\x53\x43","\x77\x68\x65\x72\x65","\x71\x75\x65\x72\x79","\x61\x64\x6D\x69\x6E","\x61\x67\x65\x6E\x74","\x72\x6F\x6C\x65","\x75\x73\x65\x72","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x66\x69\x6E\x64\x41\x6C\x6C","\x64\x65\x73\x63\x72\x69\x62\x65","\x73\x68\x6F\x77","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x6E\x61\x6D\x65","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x66\x69\x6E\x64\x42\x79\x49\x64","\x63\x72\x65\x61\x74\x65","\x55\x73\x65\x72\x49\x64","\x62\x6F\x64\x79","\x74\x65\x78\x74","\x75\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x64\x65\x73\x74\x72\x6F\x79","\x62\x75\x6C\x6B\x44\x65\x6C\x65\x74\x65","\x54\x52\x41\x53\x48","\x62\x75\x6C\x6B\x55\x70\x64\x61\x74\x65"];_0xa897[0];var _=require(_0xa897[1]);var fs=require(_0xa897[2]);var path=require(_0xa897[3]);var uploadFile=require(_0xa897[4]);var uuidLib=require(_0xa897[5]);var pdf=require(_0xa897[6]);var formidable=require(_0xa897[7]);var exec=require(_0xa897[9])[_0xa897[8]];var config=require(_0xa897[10]);var FaxMessage=require(_0xa897[12])[_0xa897[11]];var FaxAttachment=require(_0xa897[12])[_0xa897[13]];var FaxRoom=require(_0xa897[12])[_0xa897[14]];var FaxAccount=require(_0xa897[12])[_0xa897[15]];var FaxAttachment=require(_0xa897[12])[_0xa897[13]];var User=require(_0xa897[12])[_0xa897[16]];exports[_0xa897[17]]= function(_0xcd93xf,_0xcd93x10,_0xcd93x11){var _0xcd93x12={order:_0xa897[18],include:[{all:true,include:[{all:true}]}]};switch(_0xcd93xf[_0xa897[24]][_0xa897[23]]){case _0xa897[21]:_0xcd93x12[_0xa897[19]]= _0xcd93xf[_0xa897[20]];break;case _0xa897[22]:break;default:};return FaxMessage[_0xa897[29]](_0xcd93x12)[_0xa897[28]](function(_0xcd93x14){return _0xcd93x10[_0xa897[27]](200)[_0xa897[26]](_0xcd93x14)})[_0xa897[25]](function(_0xcd93x13){return handleError(_0xcd93x10,_0xcd93x13,_0xcd93x11)})};exports[_0xa897[30]]= function(_0xcd93xf,_0xcd93x10){return FaxMessage[_0xa897[30]]()[_0xa897[28]](function(_0xcd93x15){return _0xcd93x10[_0xa897[27]](200)[_0xa897[26]](_0xcd93x15)})[_0xa897[25]](function(_0xcd93x13){return handleError(_0xcd93x10,_0xcd93x13)})};exports[_0xa897[31]]= function(_0xcd93xf,_0xcd93x10,_0xcd93x11){return FaxMessage[_0xa897[38]](_0xcd93xf[_0xa897[34]][_0xa897[33]],{include:[{model:FaxAttachment},{model:User,attributes:[_0xa897[33],_0xa897[35],_0xa897[36],_0xa897[37]]}]})[_0xa897[28]](function(_0xcd93x16){if(!_0xcd93x16){return _0xcd93x10[_0xa897[32]](404)};return _0xcd93x10[_0xa897[26]](_0xcd93x16)})[_0xa897[25]](function(_0xcd93x13){return handleError(_0xcd93x10,_0xcd93x13,_0xcd93x11)})};exports[_0xa897[39]]= function(_0xcd93xf,_0xcd93x10,_0xcd93x11){_0xcd93xf[_0xa897[41]][_0xa897[40]]= _0xcd93xf[_0xa897[24]][_0xa897[33]];_0xcd93xf[_0xa897[41]][_0xa897[42]]= _0xcd93xf[_0xa897[41]][_0xa897[42]];return FaxMessage[_0xa897[39]](_0xcd93xf[_0xa897[41]],{include:[{model:FaxAttachment}]})[_0xa897[28]](function(_0xcd93x16){return _0xcd93x10[_0xa897[27]](201)[_0xa897[26]](_0xcd93x16)})[_0xa897[25]](function(_0xcd93x13){return handleError(_0xcd93x10,_0xcd93x13)})};exports[_0xa897[43]]= function(_0xcd93xf,_0xcd93x10,_0xcd93x11){return FaxMessage[_0xa897[38]](_0xcd93xf[_0xa897[34]][_0xa897[33]],{include:[{all:true}]})[_0xa897[28]](function(_0xcd93x16){if(!_0xcd93x16){return _0xcd93x10[_0xa897[32]](404)};var _0xcd93x17=_[_0xa897[44]](_0xcd93x16,_0xcd93xf[_0xa897[41]]);return _0xcd93x17[_0xa897[45]]()})[_0xa897[28]](function(_0xcd93x17){return _0xcd93x10[_0xa897[27]](200)[_0xa897[26]](_0xcd93x17)})[_0xa897[25]](function(_0xcd93x13){return handleError(_0xcd93x10,_0xcd93x13,_0xcd93x11)})};exports[_0xa897[46]]= function(_0xcd93xf,_0xcd93x10,_0xcd93x11){return FaxMessage[_0xa897[38]](_0xcd93xf[_0xa897[34]][_0xa897[33]])[_0xa897[28]](function(_0xcd93x16){if(!_0xcd93x16){return _0xcd93x10[_0xa897[32]](404)};return _0xcd93x16[_0xa897[46]]()})[_0xa897[28]](function(){return _0xcd93x10[_0xa897[32]](204)})[_0xa897[25]](function(_0xcd93x13){return handleError(_0xcd93x10,_0xcd93x13,_0xcd93x11)})};exports[_0xa897[47]]= function(_0xcd93xf,_0xcd93x10,_0xcd93x11){return FaxMessage[_0xa897[49]]({where:{id:{$in:_0xcd93xf[_0xa897[41]][_0xa897[33]]}},attributes:{directory:_0xa897[48]}})[_0xa897[28]](function(_0xcd93x16){if(!_0xcd93x16){return _0xcd93x10[_0xa897[32]](404)};return _0xcd93x16[_0xa897[46]]()})[_0xa897[28]](function(){return _0xcd93x10[_0xa897[32]](204)})[_0xa897[25]](function(_0xcd93x13){return handleError(_0xcd93x10,_0xcd93x13,_0xcd93x11)})};function handleError(_0xcd93x10,_0xcd93x13,_0xcd93x11){return _0xcd93x10[_0xa897[27]](500)[_0xa897[26]](_0xcd93x13)}