Built motion from commit 645879c.|0.0.82
[motion.git] / server / api / jscripty_project / jscripty_project.controller.js
1 var _0xf4d0=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x78\x6D\x6C\x32\x6A\x73","\x6C\x6F\x64\x61\x73\x68","\x4A\x73\x63\x72\x69\x70\x74\x79\x50\x72\x6F\x6A\x65\x63\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\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","\x52\x65\x70\x6F\x72\x74\x4A\x73\x63\x72\x69\x70\x74\x79\x53\x65\x73\x73\x69\x6F\x6E","\x52\x65\x70\x6F\x72\x74\x4A\x73\x63\x72\x69\x70\x74\x79\x51\x75\x65\x73\x74\x69\x6F\x6E","\x52\x65\x70\x6F\x72\x74\x4A\x73\x63\x72\x69\x70\x74\x79\x49\x6E\x70\x75\x74","\x62\x6C\x75\x65\x62\x69\x72\x64","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x6A\x73\x6F\x6E","\x65\x6E\x64","\x74\x68\x65\x6E","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x64\x65\x73\x74\x72\x6F\x79","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\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","\x73\x68\x6F\x77\x53\x65\x73\x73\x69\x6F\x6E\x73","\x6C\x6F\x67","\x71\x75\x65\x73\x74\x69\x6F\x6E\x73\x41\x6E\x64\x49\x6E\x70\x75\x74","\x73\x63\x6F\x70\x65","\x73\x68\x6F\x77\x53\x65\x73\x73\x69\x6F\x6E","\x73\x65\x73\x73\x69\x6F\x6E\x49\x64","\x66\x69\x6E\x64\x41\x6C\x6C","\x73\x68\x6F\x77\x51\x75\x65\x73\x74\x69\x6F\x6E\x73","\x73\x68\x6F\x77\x53\x75\x6D\x6D\x61\x72\x79","\x71\x75\x65\x73\x74\x69\x6F\x6E\x53\x75\x6D\x6D\x61\x72\x79","\x73\x68\x6F\x77\x44\x65\x74\x61\x69\x6C","\x71\x75\x65\x73\x74\x69\x6F\x6E","\x71\x75\x65\x73\x74\x69\x6F\x6E\x5F\x69\x64","\x71\x75\x65\x73\x74\x69\x6F\x6E\x5F\x6C\x61\x62\x65\x6C","\x71\x75\x65\x73\x74\x69\x6F\x6E\x5F\x74\x65\x78\x74","\x71\x75\x65\x73\x74\x69\x6F\x6E\x5F\x61\x6E\x73\x77\x65\x72","\x63\x6F\x75\x6E\x74","\x63\x6F\x6C","\x66\x6E","\x63\x72\x65\x61\x74\x65","\x6E\x61\x6D\x65","\x66\x69\x65\x6C\x64\x73","\x6D\x65\x73\x73\x61\x67\x65","\x50\x72\x6F\x6A\x65\x63\x74\x20\x6E\x61\x6D\x65\x20\x61\x6C\x72\x65\x61\x64\x79\x20\x65\x78\x69\x73\x74\x73","\x74\x72\x61\x6E\x73\x6C\x61\x74\x65\x64\x4D\x65\x73\x73\x61\x67\x65","\x4D\x45\x53\x53\x41\x47\x45\x5F\x45\x58\x49\x53\x54\x5F\x50\x52\x4F\x4A\x45\x43\x54","\x62\x6F\x64\x79","\x63\x72\x65\x61\x74\x65\x53\x65\x73\x73\x69\x6F\x6E","\x63\x72\x65\x61\x74\x65\x51\x75\x65\x73\x74\x69\x6F\x6E\x73","\x72\x65\x71\x2E\x62\x6F\x64\x79","\x70\x75\x73\x68","\x66\x6F\x72\x45\x61\x63\x68","\x61\x6C\x6C","\x75\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x75\x70\x64\x61\x74\x65\x53\x65\x73\x73\x69\x6F\x6E","\x66\x69\x6E\x64","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73","\x64\x6F\x77\x6E\x6C\x6F\x61\x64","\x66\x69\x6C\x65\x6E\x61\x6D\x65","\x61\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x3B\x20\x66\x69\x6C\x65\x6E\x61\x6D\x65\x3D\x22","\x2E\x78\x6D\x6C\x22","\x74\x78\x74\x2F\x78\x6D\x6C","\x73\x65\x74","\x70\x72\x6F\x64\x75\x63\x74\x69\x6F\x6E"];_0xf4d0[0];var xml=require(_0xf4d0[1]);var _=require(_0xf4d0[2]);var JscriptyProject=require(_0xf4d0[4])[_0xf4d0[3]];var Util=require(_0xf4d0[5]);var sequelize=require(_0xf4d0[4])[_0xf4d0[6]];var ReportJscriptySession=require(_0xf4d0[4])[_0xf4d0[7]];var ReportJscriptyQuestion=require(_0xf4d0[4])[_0xf4d0[8]];var ReportJscriptyInput=require(_0xf4d0[4])[_0xf4d0[9]];var Promise=require(_0xf4d0[10]);function handleError(_0xaa24xb,_0xaa24xc){return _0xaa24xb[_0xf4d0[12]](500)[_0xf4d0[11]](_0xaa24xc)}function responseWithResult(_0xaa24xb,_0xaa24xe){_0xaa24xe=_0xaa24xe||200;return function(_0xaa24xf){if(_0xaa24xf){_0xaa24xb[_0xf4d0[12]](_0xaa24xe)[_0xf4d0[13]](_0xaa24xf)}}}function handleEntityNotFound(_0xaa24xb){return function(_0xaa24xf){if(!_0xaa24xf){_0xaa24xb[_0xf4d0[12]](404)[_0xf4d0[14]]();return null};return _0xaa24xf}}function saveUpdates(_0xaa24x12){return function(_0xaa24xf){return _0xaa24xf[_0xf4d0[16]](_0xaa24x12)[_0xf4d0[15]](function(_0xaa24x13){return _0xaa24x13})}}function removeEntity(_0xaa24xb){return function(_0xaa24xf){if(_0xaa24xf){return _0xaa24xf[_0xf4d0[17]]()[_0xf4d0[15]](function(){_0xaa24xb[_0xf4d0[12]](204)[_0xf4d0[14]]()})}}}exports[_0xf4d0[18]]=function(_0xaa24x15,_0xaa24xb,_0xaa24x16){return JscriptyProject[_0xf4d0[22]](Util[_0xf4d0[21]](_0xaa24x15[_0xf4d0[20]]))[_0xf4d0[15]](function(_0xaa24x17){_0xaa24xb[_0xf4d0[12]](200)[_0xf4d0[11]](_0xaa24x17)})[_0xf4d0[19]](function(_0xaa24xc){return handleError(_0xaa24xb,_0xaa24xc)})};exports[_0xf4d0[23]]=function(_0xaa24x15,_0xaa24xb){return JscriptyProject[_0xf4d0[27]](_0xaa24x15[_0xf4d0[26]][_0xf4d0[25]])[_0xf4d0[15]](function(_0xaa24x18){if(!_0xaa24x18){return _0xaa24xb[_0xf4d0[24]](404)};return _0xaa24xb[_0xf4d0[11]](_0xaa24x18)})[_0xf4d0[19]](function(_0xaa24xc){return handleError(_0xaa24xb,_0xaa24xc)})};exports[_0xf4d0[28]]=function(_0xaa24x15,_0xaa24xb){return ReportJscriptySession[_0xf4d0[31]]({method:[_0xf4d0[30],_0xaa24x15[_0xf4d0[26]][_0xf4d0[25]]]})[_0xf4d0[22]](Util[_0xf4d0[21]](_0xaa24x15[_0xf4d0[20]]))[_0xf4d0[15]](handleEntityNotFound(_0xaa24xb))[_0xf4d0[15]](responseWithResult(_0xaa24xb))[_0xf4d0[19]](function(_0xaa24xc){console[_0xf4d0[29]](_0xaa24xc);return handleError(_0xaa24xb,_0xaa24xc)})};exports[_0xf4d0[32]]=function(_0xaa24x15,_0xaa24xb){return ReportJscriptySession[_0xf4d0[34]]({where:{projectId:_0xaa24x15[_0xf4d0[26]][_0xf4d0[25]],session_id:_0xaa24x15[_0xf4d0[26]][_0xf4d0[33]]},include:[{model:ReportJscriptyQuestion,include:[{model:ReportJscriptyInput}]}]})[_0xf4d0[15]](handleEntityNotFound(_0xaa24xb))[_0xf4d0[15]](responseWithResult(_0xaa24xb))[_0xf4d0[19]](function(_0xaa24xc){console[_0xf4d0[29]](_0xaa24xc);return handleError(_0xaa24xb,_0xaa24xc)})};exports[_0xf4d0[35]]=function(_0xaa24x15,_0xaa24xb){return ReportJscriptyQuestion[_0xf4d0[34]]({where:{projectId:_0xaa24x15[_0xf4d0[26]][_0xf4d0[25]]},include:[{model:ReportJscriptyInput}]})[_0xf4d0[15]](function(_0xaa24x19){if(!_0xaa24x19){return _0xaa24xb[_0xf4d0[24]](404)};return _0xaa24xb[_0xf4d0[12]](200)[_0xf4d0[11]](_0xaa24x19)})[_0xf4d0[15]](handleEntityNotFound(_0xaa24xb))[_0xf4d0[19]](function(_0xaa24xc){console[_0xf4d0[29]](_0xaa24xc);return handleError(_0xaa24xb,_0xaa24xc)})};exports[_0xf4d0[36]]=function(_0xaa24x15,_0xaa24xb){return ReportJscriptyQuestion[_0xf4d0[31]]({method:[_0xf4d0[37],_0xaa24x15[_0xf4d0[26]][_0xf4d0[25]]]})[_0xf4d0[22]](Util[_0xf4d0[21]](_0xaa24x15[_0xf4d0[20]]))[_0xf4d0[15]](handleEntityNotFound(_0xaa24xb))[_0xf4d0[15]](function(_0xaa24x1a){return _0xaa24xb[_0xf4d0[12]](200)[_0xf4d0[11]](_0xaa24x1a)})[_0xf4d0[19]](function(_0xaa24xc){console[_0xf4d0[29]](_0xaa24xc);return handleError(_0xaa24xb,_0xaa24xc)})};exports[_0xf4d0[38]]=function(_0xaa24x15,_0xaa24xb){return ReportJscriptyQuestion[_0xf4d0[34]]({where:{projectId:_0xaa24x15[_0xf4d0[26]][_0xf4d0[25]],question_type:_0xf4d0[39]},attributes:[_0xf4d0[40],_0xf4d0[41],_0xf4d0[42],_0xf4d0[43],[sequelize[_0xf4d0[46]](_0xf4d0[44],sequelize[_0xf4d0[45]](_0xf4d0[43])),_0xf4d0[44]]],group:[_0xf4d0[40],_0xf4d0[41],_0xf4d0[42],_0xf4d0[43]]})[_0xf4d0[15]](function(_0xaa24x19){return _0xaa24xb[_0xf4d0[12]](201)[_0xf4d0[11]](_0xaa24x19)})[_0xf4d0[19]](function(_0xaa24xc){console[_0xf4d0[29]](_0xaa24xc);return handleError(_0xaa24xb,_0xaa24xc)})};exports[_0xf4d0[47]]=function(_0xaa24x15,_0xaa24xb){return JscriptyProject[_0xf4d0[47]](_0xaa24x15[_0xf4d0[54]])[_0xf4d0[15]](function(_0xaa24x18){return _0xaa24xb[_0xf4d0[12]](201)[_0xf4d0[11]](_0xaa24x18)})[_0xf4d0[19]](sequelize.UniqueConstraintError,function(_0xaa24xc){if(_0xaa24xc[_0xf4d0[49]][_0xf4d0[48]]){_0xaa24xc[_0xf4d0[50]]=_0xf4d0[51];_0xaa24xc[_0xf4d0[52]]=_0xf4d0[53]};return handleError(_0xaa24xb,_0xaa24xc)})[_0xf4d0[19]](function(_0xaa24xc){return handleError(_0xaa24xb,_0xaa24xc)})};exports[_0xf4d0[55]]=function(_0xaa24x15,_0xaa24xb){ReportJscriptySession[_0xf4d0[47]](_0xaa24x15[_0xf4d0[54]])[_0xf4d0[15]](function(_0xaa24x1b){return _0xaa24xb[_0xf4d0[12]](201)[_0xf4d0[11]](_0xaa24x1b)})[_0xf4d0[19]](function(_0xaa24xc){return handleError(_0xaa24xb,_0xaa24xc)})};exports[_0xf4d0[56]]=function(_0xaa24x15,_0xaa24xb){ReportJscriptyQuestion[_0xf4d0[17]]({where:{sessionId:_0xaa24x15[_0xf4d0[26]][_0xf4d0[33]]}})[_0xf4d0[15]](function(){console[_0xf4d0[29]](_0xf4d0[57],_0xaa24x15[_0xf4d0[54]]);var _0xaa24x1d=[];_0xaa24x15[_0xf4d0[54]][_0xf4d0[59]](function(_0xaa24x1e){_0xaa24x1d[_0xf4d0[58]](ReportJscriptyQuestion[_0xf4d0[47]](_0xaa24x1e,{include:[{model:ReportJscriptyInput}]}))});return Promise[_0xf4d0[60]](_0xaa24x1d)})[_0xf4d0[15]](function(_0xaa24x1c){return _0xaa24xb[_0xf4d0[12]](201)[_0xf4d0[11]](_0xaa24x1c)})[_0xf4d0[19]](function(_0xaa24xc){return handleError(_0xaa24xb,_0xaa24xc)})};exports[_0xf4d0[61]]=function(_0xaa24x15,_0xaa24xb){if(_0xaa24x15[_0xf4d0[54]][_0xf4d0[25]]){delete _0xaa24x15[_0xf4d0[54]][_0xf4d0[25]]};JscriptyProject[_0xf4d0[27]](_0xaa24x15[_0xf4d0[26]][_0xf4d0[25]])[_0xf4d0[15]](function(_0xaa24x18){if(!_0xaa24x18){return _0xaa24xb[_0xf4d0[24]](404)};var _0xaa24x13=_[_0xf4d0[62]](_0xaa24x18,_0xaa24x15[_0xf4d0[54]]);_0xaa24x13[_0xf4d0[63]]()[_0xf4d0[15]](function(){return _0xaa24xb[_0xf4d0[12]](200)[_0xf4d0[11]](_0xaa24x18)})[_0xf4d0[19]](function(_0xaa24xc){return handleError(_0xaa24xb,_0xaa24xc)})})[_0xf4d0[19]](function(_0xaa24xc){return handleError(_0xaa24xb,_0xaa24xc)})};exports[_0xf4d0[64]]=function(_0xaa24x15,_0xaa24xb){ReportJscriptySession[_0xf4d0[61]](_0xaa24x15[_0xf4d0[54]],{where:{session_id:_0xaa24x15[_0xf4d0[26]][_0xf4d0[33]]}})[_0xf4d0[15]](function(_0xaa24x1b){return _0xaa24xb[_0xf4d0[12]](200)[_0xf4d0[11]](_0xaa24x1b)})[_0xf4d0[19]](function(_0xaa24xc){return handleError(_0xaa24xb,_0xaa24xc)})};exports[_0xf4d0[17]]=function(_0xaa24x15,_0xaa24xb){JscriptyProject[_0xf4d0[65]]({where:{id:_0xaa24x15[_0xf4d0[26]][_0xf4d0[25]]}})[_0xf4d0[15]](function(_0xaa24x18){if(!_0xaa24x18){return _0xaa24xb[_0xf4d0[24]](404)};_0xaa24x18[_0xf4d0[17]]()[_0xf4d0[15]](function(){return _0xaa24xb[_0xf4d0[24]](204)})[_0xf4d0[19]](function(_0xaa24xc){return handleError(_0xaa24xb,_0xaa24xc)})})[_0xf4d0[19]](function(_0xaa24xc){return handleError(_0xaa24xb,_0xaa24xc)})};exports[_0xf4d0[66]]=function(_0xaa24x15,_0xaa24xb){JscriptyProject[_0xf4d0[17]]({where:{id:_0xaa24x15[_0xf4d0[20]][_0xf4d0[67]]},individualHooks:true})[_0xf4d0[15]](function(){return _0xaa24xb[_0xf4d0[24]](204)})[_0xf4d0[19]](function(_0xaa24xc){return handleError(_0xaa24xb,_0xaa24xc)})};exports[_0xf4d0[68]]=function(_0xaa24x15,_0xaa24xb,_0xaa24x16){JscriptyProject[_0xf4d0[27]](_0xaa24x15[_0xf4d0[26]][_0xf4d0[25]])[_0xf4d0[15]](function(_0xaa24x18){if(!_0xaa24x18){return _0xaa24xb[_0xf4d0[24]](404)};console[_0xf4d0[29]](_0xaa24x15[_0xf4d0[20]][_0xf4d0[69]]);_0xaa24xb[_0xf4d0[73]]({"\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x44\x69\x73\x70\x6F\x73\x69\x74\x69\x6F\x6E":_0xf4d0[70]+_0xaa24x15[_0xf4d0[20]][_0xf4d0[69]]+_0xf4d0[71],"\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x54\x79\x70\x65":_0xf4d0[72]});return _0xaa24xb[_0xf4d0[11]](_0xaa24x18[_0xf4d0[74]])})[_0xf4d0[19]](function(_0xaa24xc){return handleError(_0xaa24xb,_0xaa24xc)})}