Built motion from commit ec3309576.|1.0.33
[motion.git] / server / api / integration / integration.controller.js
index 70d0890..d0fb755 100644 (file)
@@ -1 +1 @@
-var _0x6a87=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x70\x6C\x6F\x61\x64\x2D\x66\x69\x6C\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x70\x61\x74\x68","\x73\x69\x6D\x70\x6C\x65\x2D\x72\x61\x6E\x64\x6F\x6D","\x61\x64\x6D\x2D\x7A\x69\x70","\x73\x74\x72\x69\x6E\x67\x2D\x74\x6F\x2D\x6A\x73\x6F\x6E","\x66\x73","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\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","\x73\x68\x6F\x77","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x63\x72\x65\x61\x74\x65","\x72\x6F\x6F\x74","\x73\x65\x72\x76\x65\x72\x2F\x66\x69\x6C\x65\x73\x2F\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x73","\x6A\x6F\x69\x6E","\x4D\x61\x78\x20\x6E\x75\x6D\x62\x65\x72\x20\x6F\x66\x20\x66\x69\x6C\x65\x73\x20\x75\x70\x6C\x6F\x61\x64\x20\x65\x78\x63\x65\x65\x64\x65\x64","\x4F\x6E\x6C\x79\x20\x7A\x69\x70\x20\x66\x6F\x72\x6D\x61\x74\x20\x61\x63\x63\x65\x70\x74\x65\x64","\x54\x68\x65\x20\x6D\x61\x78\x69\x6D\x75\x6D\x20\x66\x69\x6C\x65\x20\x73\x69\x7A\x65\x20\x69\x73\x20\x35\x20\x4D\x62","\x49\x6E\x76\x61\x6C\x69\x64\x20\x72\x65\x71\x75\x65\x73\x74","\x65\x6E\x64","\x66\x69\x6C\x65","\x67\x65\x74\x45\x6E\x74\x72\x69\x65\x73","\x6E\x61\x6D\x65","\x6D\x61\x6E\x69\x66\x65\x73\x74\x2E\x6A\x73\x6F\x6E","\x75\x74\x66\x38","\x67\x65\x74\x44\x61\x74\x61","\x75\x70\x6C\x6F\x61\x64\x5A\x69\x70","\x6C\x6F\x67","\x70\x61\x72\x73\x65","\x65\x78\x74\x72\x61\x63\x74\x41\x6C\x6C\x54\x6F","\x6D\x65\x72\x67\x65","\x6A\x73\x6F\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x75\x6E\x6C\x69\x6E\x6B\x53\x79\x6E\x63","\x6D\x61\x6E\x69\x66\x65\x73\x74","\x6D\x61\x6E\x69\x66\x65\x73\x74\x2E\x6A\x73\x6F\x6E\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x6F\x6E","\x65\x72\x72\x6F\x72","\x75\x70\x6C\x6F\x61\x64","\x75\x70\x64\x61\x74\x65","\x62\x6F\x64\x79","\x73\x61\x76\x65","\x64\x65\x73\x74\x72\x6F\x79","\x66\x69\x6E\x64"];_0x6a87[0];var _=require(_0x6a87[1]);var uploadFile=require(_0x6a87[2]);var config=require(_0x6a87[3]);var path=require(_0x6a87[4]);var sr=require(_0x6a87[5]);var admZip=require(_0x6a87[6]);var str2json=require(_0x6a87[7]);var fs=require(_0x6a87[8]);var Util=require(_0x6a87[9]);var Integration=require(_0x6a87[11])[_0x6a87[10]];exports[_0x6a87[12]]= function(_0xc7e6xb,_0xc7e6xc,_0xc7e6xd){return Integration[_0x6a87[19]](Util[_0x6a87[18]](_0xc7e6xb[_0x6a87[17]]))[_0x6a87[16]](function(_0xc7e6xf){_0xc7e6xc[_0x6a87[15]](200)[_0x6a87[14]](_0xc7e6xf)})[_0x6a87[13]](function(_0xc7e6xe){return handleError(_0xc7e6xc,_0xc7e6xe)})};exports[_0x6a87[20]]= function(_0xc7e6xb,_0xc7e6xc){return Integration[_0x6a87[24]](_0xc7e6xb[_0x6a87[23]][_0x6a87[22]])[_0x6a87[16]](function(_0xc7e6x10){if(!_0xc7e6x10){return _0xc7e6xc[_0x6a87[21]](404)};return _0xc7e6xc[_0x6a87[14]](_0xc7e6x10)})[_0x6a87[13]](function(_0xc7e6xe){return handleError(_0xc7e6xc,_0xc7e6xe)})};exports[_0x6a87[25]]= function(_0xc7e6xb,_0xc7e6xc){var _0xc7e6x11= new uploadFile({dest:path[_0x6a87[28]](config[_0x6a87[26]],_0x6a87[27]),maxFileSize:5* 1000000,maxNumberOfFiles:1,minNumberOfFiles:1,acceptFileTypes:/(\.|\/)(zip)$/i,messages:{maxNumberOfFiles:_0x6a87[29],acceptFileTypes:_0x6a87[30],maxFileSize:_0x6a87[31],invalidRequest:_0x6a87[32]}});_0xc7e6x11[_0x6a87[50]](_0x6a87[33],function(_0xc7e6x12,_0xc7e6x13){var _0xc7e6x14= new admZip(_0xc7e6x13[_0x6a87[34]][_0x6a87[4]]);var _0xc7e6x15=false;var _0xc7e6x16=_0xc7e6x14[_0x6a87[35]]();_0xc7e6x16[_0x6a87[46]](function(_0xc7e6x17){if(_0xc7e6x17[_0x6a87[36]]=== _0x6a87[37]){var _0xc7e6x18=_0xc7e6x17[_0x6a87[39]]().toString(_0x6a87[38]);console[_0x6a87[41]](_0x6a87[40],_0xc7e6x18);try{_0xc7e6x15= JSON[_0x6a87[42]](_0xc7e6x18);console[_0x6a87[41]](_0x6a87[40],_0xc7e6x15);Integration[_0x6a87[25]](_[_0x6a87[44]](_0xc7e6x13[_0x6a87[34]],_0xc7e6x15))[_0x6a87[16]](function(_0xc7e6x10){_0xc7e6x14[_0x6a87[43]](path[_0x6a87[28]](config[_0x6a87[26]],_0x6a87[27]),true);return _0xc7e6xc[_0x6a87[15]](201)[_0x6a87[14]](_0xc7e6x10)})[_0x6a87[13]](function(_0xc7e6xe){return handleError(_0xc7e6xc,_0xc7e6xe)})}catch(e){console[_0x6a87[41]](e);var _0xc7e6xe={errors:[{type:_0x6a87[45],message:e}]};return handleError(_0xc7e6xc,_0xc7e6xe)}}});fs[_0x6a87[47]](_0xc7e6x13[_0x6a87[34]][_0x6a87[4]]);if(!_0xc7e6x15){var _0xc7e6xe={errors:[{type:_0x6a87[48],message:_0x6a87[49]}]};return handleError(_0xc7e6xc,_0xc7e6xe)}});_0xc7e6x11[_0x6a87[50]](_0x6a87[51],function(_0xc7e6x19){var _0xc7e6xe={errors:[{type:_0x6a87[52],message:_0xc7e6x19}]};return handleError(_0xc7e6xc,_0xc7e6xe)});_0xc7e6x11[_0x6a87[42]](_0xc7e6xb)};exports[_0x6a87[53]]= function(_0xc7e6xb,_0xc7e6xc){if(_0xc7e6xb[_0x6a87[54]][_0x6a87[22]]){delete _0xc7e6xb[_0x6a87[54]][_0x6a87[22]]};return Integration[_0x6a87[24]](_0xc7e6xb[_0x6a87[23]][_0x6a87[22]])[_0x6a87[16]](function(_0xc7e6x10){if(!_0xc7e6x10){return _0xc7e6xc[_0x6a87[21]](404)};var _0xc7e6x1a=_[_0x6a87[44]](_0xc7e6x10,_0xc7e6xb[_0x6a87[54]]);return _0xc7e6x1a[_0x6a87[55]]()})[_0x6a87[16]](function(_0xc7e6x10){return _0xc7e6xc[_0x6a87[15]](200)[_0x6a87[14]](_0xc7e6x10)})[_0x6a87[13]](function(_0xc7e6xe){return handleError(_0xc7e6xc,_0xc7e6xe)})};exports[_0x6a87[56]]= function(_0xc7e6xb,_0xc7e6xc){return Integration[_0x6a87[57]]({where:{id:_0xc7e6xb[_0x6a87[23]][_0x6a87[22]]}})[_0x6a87[16]](function(_0xc7e6x10){if(!_0xc7e6x10){return _0xc7e6xc[_0x6a87[21]](404)};return _0xc7e6x10[_0x6a87[56]]()})[_0x6a87[16]](function(){return _0xc7e6xc[_0x6a87[21]](204)})[_0x6a87[13]](function(_0xc7e6xe){return handleError(_0xc7e6xc,_0xc7e6xe)})};function handleError(_0xc7e6xc,_0xc7e6xe){return _0xc7e6xc[_0x6a87[15]](500)[_0x6a87[14]](_0xc7e6xe)}
\ No newline at end of file
+var _0x977f=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x70\x6C\x6F\x61\x64\x2D\x66\x69\x6C\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x70\x61\x74\x68","\x73\x69\x6D\x70\x6C\x65\x2D\x72\x61\x6E\x64\x6F\x6D","\x61\x64\x6D\x2D\x7A\x69\x70","\x73\x74\x72\x69\x6E\x67\x2D\x74\x6F\x2D\x6A\x73\x6F\x6E","\x66\x73","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\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","\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\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","\x73\x68\x6F\x77","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x63\x72\x65\x61\x74\x65","\x72\x6F\x6F\x74","\x73\x65\x72\x76\x65\x72\x2F\x66\x69\x6C\x65\x73\x2F\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x73","\x6A\x6F\x69\x6E","\x4D\x61\x78\x20\x6E\x75\x6D\x62\x65\x72\x20\x6F\x66\x20\x66\x69\x6C\x65\x73\x20\x75\x70\x6C\x6F\x61\x64\x20\x65\x78\x63\x65\x65\x64\x65\x64","\x4F\x6E\x6C\x79\x20\x7A\x69\x70\x20\x66\x6F\x72\x6D\x61\x74\x20\x61\x63\x63\x65\x70\x74\x65\x64","\x54\x68\x65\x20\x6D\x61\x78\x69\x6D\x75\x6D\x20\x66\x69\x6C\x65\x20\x73\x69\x7A\x65\x20\x69\x73\x20\x35\x20\x4D\x62","\x49\x6E\x76\x61\x6C\x69\x64\x20\x72\x65\x71\x75\x65\x73\x74","\x65\x6E\x64","\x66\x69\x6C\x65","\x67\x65\x74\x45\x6E\x74\x72\x69\x65\x73","\x6E\x61\x6D\x65","\x6D\x61\x6E\x69\x66\x65\x73\x74\x2E\x6A\x73\x6F\x6E","\x75\x74\x66\x38","\x67\x65\x74\x44\x61\x74\x61","\x75\x70\x6C\x6F\x61\x64\x5A\x69\x70","\x64\x65\x62\x75\x67","\x70\x61\x72\x73\x65","\x65\x78\x74\x72\x61\x63\x74\x41\x6C\x6C\x54\x6F","\x6D\x65\x72\x67\x65","\x65\x72\x72\x6F\x72","\x6A\x73\x6F\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x75\x6E\x6C\x69\x6E\x6B\x53\x79\x6E\x63","\x6D\x61\x6E\x69\x66\x65\x73\x74","\x6D\x61\x6E\x69\x66\x65\x73\x74\x2E\x6A\x73\x6F\x6E\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x6F\x6E","\x75\x70\x6C\x6F\x61\x64","\x75\x70\x64\x61\x74\x65","\x62\x6F\x64\x79","\x73\x61\x76\x65","\x64\x65\x73\x74\x72\x6F\x79","\x66\x69\x6E\x64","\x73\x74\x61\x63\x6B"];_0x977f[0];var _=require(_0x977f[1]);var uploadFile=require(_0x977f[2]);var config=require(_0x977f[3]);var path=require(_0x977f[4]);var sr=require(_0x977f[5]);var admZip=require(_0x977f[6]);var str2json=require(_0x977f[7]);var fs=require(_0x977f[8]);var Util=require(_0x977f[9]);var logger=require(_0x977f[11])(_0x977f[10]);var Integration=require(_0x977f[13])[_0x977f[12]];exports[_0x977f[14]]= function(_0xd2fcxc,_0xd2fcxd,_0xd2fcxe){return Integration[_0x977f[21]](Util[_0x977f[20]](_0xd2fcxc[_0x977f[19]]))[_0x977f[18]](function(_0xd2fcx10){_0xd2fcxd[_0x977f[17]](200)[_0x977f[16]](_0xd2fcx10)})[_0x977f[15]](function(_0xd2fcxf){return handleError(_0xd2fcxd,_0xd2fcxf)})};exports[_0x977f[22]]= function(_0xd2fcxc,_0xd2fcxd){return Integration[_0x977f[26]](_0xd2fcxc[_0x977f[25]][_0x977f[24]])[_0x977f[18]](function(_0xd2fcx11){if(!_0xd2fcx11){return _0xd2fcxd[_0x977f[23]](404)};return _0xd2fcxd[_0x977f[16]](_0xd2fcx11)})[_0x977f[15]](function(_0xd2fcxf){return handleError(_0xd2fcxd,_0xd2fcxf)})};exports[_0x977f[27]]= function(_0xd2fcxc,_0xd2fcxd){var _0xd2fcx12= new uploadFile({dest:path[_0x977f[30]](config[_0x977f[28]],_0x977f[29]),maxFileSize:5* 1000000,maxNumberOfFiles:1,minNumberOfFiles:1,acceptFileTypes:/(\.|\/)(zip)$/i,messages:{maxNumberOfFiles:_0x977f[31],acceptFileTypes:_0x977f[32],maxFileSize:_0x977f[33],invalidRequest:_0x977f[34]}});_0xd2fcx12[_0x977f[53]](_0x977f[35],function(_0xd2fcx13,_0xd2fcx14){var _0xd2fcx15= new admZip(_0xd2fcx14[_0x977f[36]][_0x977f[4]]);var _0xd2fcx16=false;var _0xd2fcx17=_0xd2fcx15[_0x977f[37]]();_0xd2fcx17[_0x977f[49]](function(_0xd2fcx18){if(_0xd2fcx18[_0x977f[38]]=== _0x977f[39]){var _0xd2fcx19=_0xd2fcx18[_0x977f[41]]().toString(_0x977f[40]);logger[_0x977f[43]](_0x977f[42],_0xd2fcx19);try{_0xd2fcx16= JSON[_0x977f[44]](_0xd2fcx19);logger[_0x977f[43]](_0x977f[42],_0xd2fcx16);Integration[_0x977f[27]](_[_0x977f[46]](_0xd2fcx14[_0x977f[36]],_0xd2fcx16))[_0x977f[18]](function(_0xd2fcx11){_0xd2fcx15[_0x977f[45]](path[_0x977f[30]](config[_0x977f[28]],_0x977f[29]),true);return _0xd2fcxd[_0x977f[17]](201)[_0x977f[16]](_0xd2fcx11)})[_0x977f[15]](function(_0xd2fcxf){return handleError(_0xd2fcxd,_0xd2fcxf)})}catch(e){logger[_0x977f[47]](e);var _0xd2fcxf={errors:[{type:_0x977f[48],message:e}]};return handleError(_0xd2fcxd,_0xd2fcxf)}}});fs[_0x977f[50]](_0xd2fcx14[_0x977f[36]][_0x977f[4]]);if(!_0xd2fcx16){var _0xd2fcxf={errors:[{type:_0x977f[51],message:_0x977f[52]}]};return handleError(_0xd2fcxd,_0xd2fcxf)}});_0xd2fcx12[_0x977f[53]](_0x977f[47],function(_0xd2fcx1a){var _0xd2fcxf={errors:[{type:_0x977f[54],message:_0xd2fcx1a}]};return handleError(_0xd2fcxd,_0xd2fcxf)});_0xd2fcx12[_0x977f[44]](_0xd2fcxc)};exports[_0x977f[55]]= function(_0xd2fcxc,_0xd2fcxd){if(_0xd2fcxc[_0x977f[56]][_0x977f[24]]){delete _0xd2fcxc[_0x977f[56]][_0x977f[24]]};return Integration[_0x977f[26]](_0xd2fcxc[_0x977f[25]][_0x977f[24]])[_0x977f[18]](function(_0xd2fcx11){if(!_0xd2fcx11){return _0xd2fcxd[_0x977f[23]](404)};var _0xd2fcx1b=_[_0x977f[46]](_0xd2fcx11,_0xd2fcxc[_0x977f[56]]);return _0xd2fcx1b[_0x977f[57]]()})[_0x977f[18]](function(_0xd2fcx11){return _0xd2fcxd[_0x977f[17]](200)[_0x977f[16]](_0xd2fcx11)})[_0x977f[15]](function(_0xd2fcxf){return handleError(_0xd2fcxd,_0xd2fcxf)})};exports[_0x977f[58]]= function(_0xd2fcxc,_0xd2fcxd){return Integration[_0x977f[59]]({where:{id:_0xd2fcxc[_0x977f[25]][_0x977f[24]]}})[_0x977f[18]](function(_0xd2fcx11){if(!_0xd2fcx11){return _0xd2fcxd[_0x977f[23]](404)};return _0xd2fcx11[_0x977f[58]]()})[_0x977f[18]](function(){return _0xd2fcxd[_0x977f[23]](204)})[_0x977f[15]](function(_0xd2fcxf){return handleError(_0xd2fcxd,_0xd2fcxf)})};function handleError(_0xd2fcxd,_0xd2fcxf){logger[_0x977f[47]](_0xd2fcxf[_0x977f[60]]);return _0xd2fcxd[_0x977f[17]](500)[_0x977f[16]](_0xd2fcxf)}
\ No newline at end of file