Built motion from commit c8dd8619.|2.0.42
[motion2.git] / server / api / team / team.controller.js
1 var _0xc3ee=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x66\x61\x73\x74\x2D\x6A\x73\x6F\x6E\x2D\x70\x61\x74\x63\x68","\x72\x65\x71\x75\x65\x73\x74\x2D\x70\x72\x6F\x6D\x69\x73\x65","\x6D\x6F\x6D\x65\x6E\x74","\x62\x6C\x75\x65\x62\x69\x72\x64","\x6D\x75\x73\x74\x61\x63\x68\x65","\x75\x74\x69\x6C","\x70\x61\x74\x68","\x73\x6F\x78","\x74\x6F\x2D\x63\x73\x76","\x65\x6A\x73","\x66\x73","\x6C\x6F\x64\x61\x73\x68","\x73\x71\x75\x65\x6C","\x63\x72\x79\x70\x74\x6F","\x6A\x73\x66\x6F\x72\x63\x65","\x64\x65\x73\x6B\x2E\x6A\x73","\x71\x75\x65\x72\x79\x73\x74\x72\x69\x6E\x67","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6D\x70\x6F\x6E\x65\x6E\x74\x73\x2F\x70\x61\x72\x73\x65\x72\x73\x2F\x71\x73","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C\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","\x64\x62","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x79\x73\x71\x6C\x64\x62","\x6C\x6F\x63\x61\x6C\x68\x6F\x73\x74","\x73\x6F\x63\x6B\x65\x74\x2E\x69\x6F\x2D\x65\x6D\x69\x74\x74\x65\x72","\x72\x65\x67\x69\x73\x74\x65\x72","\x2E\x2F\x74\x65\x61\x6D\x2E\x73\x6F\x63\x6B\x65\x74","\x54\x65\x61\x6D\x2C\x20\x25\x73\x2C\x20\x25\x73\x2C\x20\x25\x73","\x6E\x6F\x20\x63\x6F\x6E\x74\x65\x6E\x74","\x69\x6E\x66\x6F","\x54\x65\x61\x6D\x2C\x20\x25\x73\x2C\x20\x25\x73\x2C\x20\x25\x73\x2C\x20\x25\x73","\x64\x65\x62\x75\x67","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x65\x6E\x74\x69\x74\x79\x20\x66\x6F\x75\x6E\x64","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x6A\x73\x6F\x6E","\x63\x6F\x75\x6E\x74","\x6F\x66\x66\x73\x65\x74","\x6C\x69\x6D\x69\x74","\x65\x6E\x74\x69\x74\x69\x65\x73\x20\x66\x6F\x75\x6E\x64","\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x52\x61\x6E\x67\x65","\x2D","\x2F","\x73\x65\x74","\x61\x70\x70\x6C\x79","\x72\x65\x6A\x65\x63\x74","\x73\x61\x76\x65","\x65\x6E\x74\x69\x74\x79\x20\x75\x70\x64\x61\x74\x65\x64","\x74\x68\x65\x6E","\x75\x70\x64\x61\x74\x65","\x65\x6E\x74\x69\x74\x79\x20\x72\x65\x6D\x6F\x76\x65\x64","\x64\x65\x73\x74\x72\x6F\x79","\x65\x6E\x74\x69\x74\x79\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x65\x72\x72\x6F\x72","\x69\x6E\x73\x70\x65\x63\x74","\x6E\x61\x6D\x65","\x73\x65\x6E\x64","\x69\x6E\x64\x65\x78","\x6D\x6F\x64\x65\x6C","\x72\x61\x77\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x54\x65\x61\x6D","\x6B\x65\x79\x73","\x71\x75\x65\x72\x79","\x66\x69\x6C\x74\x65\x72\x73","\x69\x6E\x74\x65\x72\x73\x65\x63\x74\x69\x6F\x6E","\x61\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x66\x69\x65\x6C\x64\x73","\x6C\x65\x6E\x67\x74\x68","\x6E\x6F\x6C\x69\x6D\x69\x74","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x6F\x72\x64\x65\x72","\x73\x6F\x72\x74","\x77\x68\x65\x72\x65","\x70\x69\x63\x6B","\x66\x69\x6C\x74\x65\x72","\x25","\x6D\x61\x70","\x6D\x65\x72\x67\x65","\x6F\x70\x74\x69\x6F\x6E\x73","\x63\x61\x74\x63\x68","\x72\x6F\x77\x73","\x69\x6E\x63\x6C\x75\x64\x65\x41\x6C\x6C","\x69\x6E\x63\x6C\x75\x64\x65","\x66\x69\x6E\x64\x41\x6C\x6C","\x73\x68\x6F\x77","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64","\x63\x72\x65\x61\x74\x65","\x62\x6F\x64\x79","\x67\x65\x74\x51\x75\x65\x75\x65\x73","\x63\x68\x61\x6E\x6E\x65\x6C","\x69\x73\x56\x61\x6C\x69\x64\x43\x68\x61\x6E\x6E\x65\x6C","\x55\x6E\x6B\x6E\x6F\x77\x6E\x20\x63\x68\x61\x6E\x6E\x65\x6C","\x53\x65\x71\x75\x65\x6C\x69\x7A\x65","\x74\x6F\x4C\x6F\x77\x65\x72\x43\x61\x73\x65","\x63\x61\x70\x69\x74\x61\x6C\x69\x7A\x65","\x51\x75\x65\x75\x65","\x67\x65\x74","\x51\x75\x65\x75\x65\x73","\x66\x69\x6E\x64\x4F\x6E\x65","\x61\x64\x64\x51\x75\x65\x75\x65\x73","\x69\x64\x73","\x61\x64\x64","\x72\x65\x6D\x6F\x76\x65\x51\x75\x65\x75\x65\x73","\x72\x65\x6D\x6F\x76\x65","\x61\x64\x64\x41\x67\x65\x6E\x74\x73","\x75\x73\x65\x72\x54\x65\x61\x6D\x3A\x73\x61\x76\x65","\x65\x6D\x69\x74","\x73\x70\x72\x65\x61\x64","\x6F\x6D\x69\x74","\x72\x65\x6D\x6F\x76\x65\x41\x67\x65\x6E\x74\x73","\x69\x73\x41\x72\x72\x61\x79","\x75\x73\x65\x72\x54\x65\x61\x6D\x3A\x72\x65\x6D\x6F\x76\x65","\x67\x65\x74\x41\x67\x65\x6E\x74\x73","\x55\x73\x65\x72"];_0xc3ee[0];var jsonpatch=require(_0xc3ee[1]);var rp=require(_0xc3ee[2]);var moment=require(_0xc3ee[3]);var BPromise=require(_0xc3ee[4]);var Mustache=require(_0xc3ee[5]);var util=require(_0xc3ee[6]);var path=require(_0xc3ee[7]);var sox=require(_0xc3ee[8]);var csv=require(_0xc3ee[9]);var ejs=require(_0xc3ee[10]);var fs=require(_0xc3ee[11]);var _=require(_0xc3ee[12]);var squel=require(_0xc3ee[13]);var crypto=require(_0xc3ee[14]);var jsforce=require(_0xc3ee[15]);var deskjs=require(_0xc3ee[16]);var toCsv=require(_0xc3ee[9]);var querystring=require(_0xc3ee[17]);var qs=require(_0xc3ee[18]);var logger=require(_0xc3ee[20])(_0xc3ee[19]);var utils=require(_0xc3ee[21]);var config=require(_0xc3ee[22]);var db=require(_0xc3ee[24])[_0xc3ee[23]];var socket=require(_0xc3ee[26])({host:_0xc3ee[25],port:6379});require(_0xc3ee[28])[_0xc3ee[27]](socket);function respondWithStatusCode(_0xfcb0x1a,_0xfcb0x1b,_0xfcb0x1c){_0xfcb0x1b= _0xfcb0x1b|| 204;return function(_0xfcb0x1d){if(_0xfcb0x1d){logger[_0xc3ee[31]](_0xc3ee[29],_0xfcb0x1c,_0xfcb0x1b,_0xc3ee[30]);logger[_0xc3ee[33]](_0xc3ee[32],_0xfcb0x1c,_0xfcb0x1b,_0xc3ee[30]);return _0xfcb0x1a[_0xc3ee[34]](_0xfcb0x1b)};return _0xfcb0x1a[_0xc3ee[36]](_0xfcb0x1b)[_0xc3ee[35]]()}}function respondWithResult(_0xfcb0x1a,_0xfcb0x1b,_0xfcb0x1c){_0xfcb0x1b= _0xfcb0x1b|| 200;return function(_0xfcb0x1d){if(_0xfcb0x1d){logger[_0xc3ee[31]](_0xc3ee[29],_0xfcb0x1c,_0xfcb0x1b,_0xc3ee[37]);logger[_0xc3ee[33]](_0xc3ee[32],_0xfcb0x1c,_0xfcb0x1b,_0xc3ee[37],JSON[_0xc3ee[38]](_0xfcb0x1d));return _0xfcb0x1a[_0xc3ee[36]](_0xfcb0x1b)[_0xc3ee[39]](_0xfcb0x1d)}}}function respondWithFilteredResult(_0xfcb0x1a,_0xfcb0x20,_0xfcb0x1c){return function(_0xfcb0x1d){if(_0xfcb0x1d){var _0xfcb0x21=_0xfcb0x1d[_0xc3ee[40]],_0xfcb0x22=_0xfcb0x20[_0xc3ee[41]],_0xfcb0x23=_0xfcb0x20[_0xc3ee[41]]+ _0xfcb0x20[_0xc3ee[42]],_0xfcb0x1b;if(_0xfcb0x23>= _0xfcb0x21){_0xfcb0x23= _0xfcb0x21;_0xfcb0x1b= 200}else {_0xfcb0x1b= 206};_0xfcb0x1a[_0xc3ee[36]](_0xfcb0x1b);logger[_0xc3ee[31]](_0xc3ee[29],_0xfcb0x1c,_0xfcb0x1b,_0xc3ee[43]);logger[_0xc3ee[33]](_0xc3ee[32],_0xfcb0x1c,_0xfcb0x1b,_0xc3ee[37],JSON[_0xc3ee[38]](_0xfcb0x1d));return _0xfcb0x1a[_0xc3ee[47]](_0xc3ee[44],_0xfcb0x22+ _0xc3ee[45]+ _0xfcb0x23+ _0xc3ee[46]+ _0xfcb0x21)[_0xc3ee[39]](_0xfcb0x1d)};return null}}function patchUpdates(_0xfcb0x25){return function(_0xfcb0x1d){try{jsonpatch[_0xc3ee[48]](_0xfcb0x1d,_0xfcb0x25,true)}catch(err){return BPromise[_0xc3ee[49]](err)};return _0xfcb0x1d[_0xc3ee[50]]()}}function saveUpdates(_0xfcb0x27,_0xfcb0x1b,_0xfcb0x1c){return function(_0xfcb0x1d){if(_0xfcb0x1d){return _0xfcb0x1d[_0xc3ee[53]](_0xfcb0x27)[_0xc3ee[52]](function(_0xfcb0x28){logger[_0xc3ee[31]](_0xc3ee[29],_0xfcb0x1c,_0xfcb0x1b,_0xc3ee[51]);logger[_0xc3ee[33]](_0xc3ee[32],_0xfcb0x1c,_0xfcb0x1b,_0xc3ee[51],JSON[_0xc3ee[38]](_0xfcb0x1d));return _0xfcb0x28})};return null}}function removeEntity(_0xfcb0x1a,_0xfcb0x1b,_0xfcb0x1c){return function(_0xfcb0x1d){if(_0xfcb0x1d){return _0xfcb0x1d[_0xc3ee[55]]()[_0xc3ee[52]](function(){logger[_0xc3ee[31]](_0xc3ee[29],_0xfcb0x1c,_0xfcb0x1b,_0xc3ee[54]);logger[_0xc3ee[33]](_0xc3ee[32],_0xfcb0x1c,_0xfcb0x1b,_0xc3ee[54],JSON[_0xc3ee[38]](_0xfcb0x1d));_0xfcb0x1a[_0xc3ee[36]](204)[_0xc3ee[35]]()})}}}function handleEntityNotFound(_0xfcb0x1a,_0xfcb0x1b,_0xfcb0x1c){return function(_0xfcb0x1d){if(!_0xfcb0x1d){logger[_0xc3ee[57]](_0xc3ee[29],_0xfcb0x1c,404,_0xc3ee[56]);_0xfcb0x1a[_0xc3ee[34]](404)};return _0xfcb0x1d}}function handleError(_0xfcb0x1a,_0xfcb0x1b,_0xfcb0x1c){_0xfcb0x1b= _0xfcb0x1b|| 500;return function(_0xfcb0x2c){logger[_0xc3ee[57]](_0xc3ee[29],_0xfcb0x1c,_0xfcb0x1b,util[_0xc3ee[58]](_0xfcb0x2c,{showHidden:false,depth:null}));delete _0xfcb0x2c[_0xc3ee[59]];_0xfcb0x1a[_0xc3ee[36]](_0xfcb0x1b)[_0xc3ee[60]](_0xfcb0x2c)}}exports[_0xc3ee[61]]= function(_0xfcb0x2d,_0xfcb0x1a){var _0xfcb0x20={},_0xfcb0x2e={},_0xfcb0x2f={count:0,rows:[]};_0xfcb0x2e[_0xc3ee[62]]= _[_0xc3ee[65]](db[_0xc3ee[64]][_0xc3ee[63]]);_0xfcb0x2e[_0xc3ee[66]]= _[_0xc3ee[65]](_0xfcb0x2d[_0xc3ee[66]]);_0xfcb0x2e[_0xc3ee[67]]= _[_0xc3ee[68]](_0xfcb0x2e[_0xc3ee[62]],_0xfcb0x2e[_0xc3ee[66]]);_0xfcb0x20[_0xc3ee[69]]= _[_0xc3ee[68]](_0xfcb0x2e[_0xc3ee[62]],qs[_0xc3ee[70]](_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[70]]));_0xfcb0x20[_0xc3ee[69]]= (_0xfcb0x20[_0xc3ee[69]][_0xc3ee[71]])?_0xfcb0x20[_0xc3ee[69]]:_0xfcb0x2e[_0xc3ee[62]];if(!_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[73]](_0xc3ee[72])){_0xfcb0x20[_0xc3ee[42]]= qs[_0xc3ee[42]](_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[42]]);_0xfcb0x20[_0xc3ee[41]]= qs[_0xc3ee[41]](_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[41]])};_0xfcb0x20[_0xc3ee[74]]= qs[_0xc3ee[75]](_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[75]]);_0xfcb0x20[_0xc3ee[76]]= qs[_0xc3ee[67]](_[_0xc3ee[77]](_0xfcb0x2d[_0xc3ee[66]],_0xfcb0x2e[_0xc3ee[67]]));if(_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[78]]){_0xfcb0x20[_0xc3ee[76]]= _[_0xc3ee[81]](_0xfcb0x20[_0xc3ee[76]],{$or:_[_0xc3ee[80]](_0xfcb0x20[_0xc3ee[69]],function(_0xfcb0x30){var _0xfcb0x2f={};_0xfcb0x2f[_0xfcb0x30]= {$like:_0xc3ee[79]+ _0xfcb0x2d[_0xc3ee[66]][_0xc3ee[78]]+ _0xc3ee[79]};return _0xfcb0x2f})})};_0xfcb0x20= _[_0xc3ee[81]]({},_0xfcb0x20,_0xfcb0x2d[_0xc3ee[82]]);return db[_0xc3ee[64]][_0xc3ee[40]]({where:_0xfcb0x20[_0xc3ee[76]]})[_0xc3ee[52]](function(_0xfcb0x21){_0xfcb0x2f[_0xc3ee[40]]= _0xfcb0x21;if(_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[85]]){_0xfcb0x20[_0xc3ee[86]]= [{all:true}]};return db[_0xc3ee[64]][_0xc3ee[87]](_0xfcb0x20)})[_0xc3ee[52]](function(_0xfcb0x31){_0xfcb0x2f[_0xc3ee[84]]= _0xfcb0x31;return _0xfcb0x2f})[_0xc3ee[52]](respondWithFilteredResult(_0xfcb0x1a,_0xfcb0x20,_0xc3ee[61]))[_0xc3ee[83]](handleError(_0xfcb0x1a,null,_0xc3ee[61]))};exports[_0xc3ee[88]]= function(_0xfcb0x2d,_0xfcb0x1a){var _0xfcb0x20={raw:false,where:{id:_0xfcb0x2d[_0xc3ee[90]][_0xc3ee[89]]}},_0xfcb0x2e={};_0xfcb0x2e[_0xc3ee[62]]= _[_0xc3ee[65]](db[_0xc3ee[64]][_0xc3ee[63]]);_0xfcb0x2e[_0xc3ee[66]]= _[_0xc3ee[65]](_0xfcb0x2d[_0xc3ee[66]]);_0xfcb0x2e[_0xc3ee[67]]= _[_0xc3ee[68]](_0xfcb0x2e[_0xc3ee[62]],_0xfcb0x2e[_0xc3ee[66]]);_0xfcb0x20[_0xc3ee[69]]= _[_0xc3ee[68]](_0xfcb0x2e[_0xc3ee[62]],qs[_0xc3ee[70]](_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[70]]));_0xfcb0x20[_0xc3ee[69]]= (_0xfcb0x20[_0xc3ee[69]][_0xc3ee[71]])?_0xfcb0x20[_0xc3ee[69]]:_0xfcb0x2e[_0xc3ee[62]];if(_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[85]]){_0xfcb0x20[_0xc3ee[86]]= [{all:true}]};_0xfcb0x20= _[_0xc3ee[81]]({},_0xfcb0x20,_0xfcb0x2d[_0xc3ee[82]]);return db[_0xc3ee[64]][_0xc3ee[91]](_0xfcb0x20)[_0xc3ee[52]](handleEntityNotFound(_0xfcb0x1a,null,_0xc3ee[88]))[_0xc3ee[52]](respondWithResult(_0xfcb0x1a,null,_0xc3ee[88]))[_0xc3ee[83]](handleError(_0xfcb0x1a,null,_0xc3ee[88]))};exports[_0xc3ee[92]]= function(_0xfcb0x2d,_0xfcb0x1a){return db[_0xc3ee[64]][_0xc3ee[92]](_0xfcb0x2d[_0xc3ee[93]],{})[_0xc3ee[52]](respondWithResult(_0xfcb0x1a,201,_0xc3ee[92]))[_0xc3ee[83]](handleError(_0xfcb0x1a,null,_0xc3ee[92]))};exports[_0xc3ee[53]]= function(_0xfcb0x2d,_0xfcb0x1a){if(_0xfcb0x2d[_0xc3ee[93]][_0xc3ee[89]]){delete _0xfcb0x2d[_0xc3ee[93]][_0xc3ee[89]]};return db[_0xc3ee[64]][_0xc3ee[91]]({where:{id:_0xfcb0x2d[_0xc3ee[90]][_0xc3ee[89]]}})[_0xc3ee[52]](handleEntityNotFound(_0xfcb0x1a,null,_0xc3ee[53]))[_0xc3ee[52]](saveUpdates(_0xfcb0x2d[_0xc3ee[93]],null,_0xc3ee[53]))[_0xc3ee[52]](respondWithResult(_0xfcb0x1a,null,_0xc3ee[53]))[_0xc3ee[83]](handleError(_0xfcb0x1a,null,_0xc3ee[53]))};exports[_0xc3ee[55]]= function(_0xfcb0x2d,_0xfcb0x1a){return db[_0xc3ee[64]][_0xc3ee[91]]({where:{id:_0xfcb0x2d[_0xc3ee[90]][_0xc3ee[89]]}})[_0xc3ee[52]](handleEntityNotFound(_0xfcb0x1a,null,_0xc3ee[55]))[_0xc3ee[52]](removeEntity(_0xfcb0x1a,null,_0xc3ee[55]))[_0xc3ee[83]](handleError(_0xfcb0x1a,null,_0xc3ee[55]))};exports[_0xc3ee[94]]= function(_0xfcb0x2d,_0xfcb0x1a,_0xfcb0x32){return db[_0xc3ee[64]][_0xc3ee[104]]({where:{id:_0xfcb0x2d[_0xc3ee[90]][_0xc3ee[89]]}})[_0xc3ee[52]](handleEntityNotFound(_0xfcb0x1a,null,_0xc3ee[94]))[_0xc3ee[52]](function(_0xfcb0x1d){if(!_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[95]]||  !utils[_0xc3ee[96]](_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[95]])){throw  new db[_0xc3ee[98]].ValidationError(_0xc3ee[97])};var _0xfcb0x20={};var _0xfcb0x2e={};_0xfcb0x2e[_0xc3ee[62]]= _[_0xc3ee[65]](db[_[_0xc3ee[100]](_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[95]][_0xc3ee[99]]())+ _0xc3ee[101]][_0xc3ee[63]]);_0xfcb0x2e[_0xc3ee[66]]= _[_0xc3ee[65]](_0xfcb0x2d[_0xc3ee[66]]);_0xfcb0x2e[_0xc3ee[67]]= _[_0xc3ee[68]](_0xfcb0x2e[_0xc3ee[62]],_0xfcb0x2e[_0xc3ee[66]]);_0xfcb0x20[_0xc3ee[69]]= _[_0xc3ee[68]](_0xfcb0x2e[_0xc3ee[62]],qs[_0xc3ee[70]](_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[70]]));_0xfcb0x20[_0xc3ee[69]]= (_0xfcb0x20[_0xc3ee[69]][_0xc3ee[71]])?_0xfcb0x20[_0xc3ee[69]]:_0xfcb0x2e[_0xc3ee[62]];_0xfcb0x20[_0xc3ee[42]]= qs[_0xc3ee[42]](_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[42]]);_0xfcb0x20[_0xc3ee[41]]= qs[_0xc3ee[41]](_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[41]]);_0xfcb0x20[_0xc3ee[74]]= qs[_0xc3ee[75]](_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[75]]);_0xfcb0x20[_0xc3ee[76]]= qs[_0xc3ee[67]](_[_0xc3ee[77]](_0xfcb0x2d[_0xc3ee[66]],_0xfcb0x2e[_0xc3ee[67]]));_0xfcb0x20= _[_0xc3ee[81]]({},_0xfcb0x20,_0xfcb0x2d[_0xc3ee[82]]);return _0xfcb0x1d[_0xc3ee[102]+ _[_0xc3ee[100]](_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[95]][_0xc3ee[99]]())+ _0xc3ee[103]](_0xfcb0x20)})[_0xc3ee[52]](respondWithResult(_0xfcb0x1a,null,_0xc3ee[94]))[_0xc3ee[83]](handleError(_0xfcb0x1a,null,_0xc3ee[94]))};exports[_0xc3ee[105]]= function(_0xfcb0x2d,_0xfcb0x1a,_0xfcb0x32){return db[_0xc3ee[64]][_0xc3ee[104]]({where:{id:_0xfcb0x2d[_0xc3ee[90]][_0xc3ee[89]]}})[_0xc3ee[52]](function(_0xfcb0x1d){if(_0xfcb0x1d){if(!_0xfcb0x2d[_0xc3ee[93]][_0xc3ee[95]]||  !utils[_0xc3ee[96]](_0xfcb0x2d[_0xc3ee[93]][_0xc3ee[95]])){throw  new db[_0xc3ee[98]].ValidationError(_0xc3ee[97])};return _0xfcb0x1d[_0xc3ee[107]+ _[_0xc3ee[100]](_0xfcb0x2d[_0xc3ee[93]][_0xc3ee[95]][_0xc3ee[99]]())+ _0xc3ee[103]](_0xfcb0x2d[_0xc3ee[93]][_0xc3ee[106]])};return null})[_0xc3ee[52]](handleEntityNotFound(_0xfcb0x1a,null,_0xc3ee[105]))[_0xc3ee[52]](respondWithStatusCode(_0xfcb0x1a,null,_0xc3ee[105]))[_0xc3ee[83]](handleError(_0xfcb0x1a,null,_0xc3ee[105]))};exports[_0xc3ee[108]]= function(_0xfcb0x2d,_0xfcb0x1a,_0xfcb0x32){return db[_0xc3ee[64]][_0xc3ee[104]]({where:{id:_0xfcb0x2d[_0xc3ee[90]][_0xc3ee[89]]}})[_0xc3ee[52]](function(_0xfcb0x1d){if(_0xfcb0x1d){if(!_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[95]]||  !utils[_0xc3ee[96]](_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[95]])){throw  new db[_0xc3ee[98]].ValidationError(_0xc3ee[97])};return _0xfcb0x1d[_0xc3ee[109]+ _[_0xc3ee[100]](_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[95]][_0xc3ee[99]]())+ _0xc3ee[103]](_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[106]])};return null})[_0xc3ee[52]](handleEntityNotFound(_0xfcb0x1a,null,_0xc3ee[108]))[_0xc3ee[52]](respondWithStatusCode(_0xfcb0x1a,null,_0xc3ee[108]))[_0xc3ee[83]](handleError(_0xfcb0x1a,null,_0xc3ee[108]))};exports[_0xc3ee[110]]= function(_0xfcb0x2d,_0xfcb0x1a,_0xfcb0x32){return db[_0xc3ee[64]][_0xc3ee[91]]({where:{id:_0xfcb0x2d[_0xc3ee[90]][_0xc3ee[89]]}})[_0xc3ee[52]](handleEntityNotFound(_0xfcb0x1a,null,_0xc3ee[110]))[_0xc3ee[52]](function(_0xfcb0x1d){if(_0xfcb0x1d){return _0xfcb0x1d[_0xc3ee[110]](_0xfcb0x2d[_0xc3ee[93]][_0xc3ee[106]],_[_0xc3ee[114]](_0xfcb0x2d[_0xc3ee[93]],[_0xc3ee[106],_0xc3ee[89]])|| {})[_0xc3ee[113]](function(_0xfcb0x33){for(var _0xfcb0x34=0;_0xfcb0x34< _0xfcb0x2d[_0xc3ee[93]][_0xc3ee[106]][_0xc3ee[71]];_0xfcb0x34+= 1){socket[_0xc3ee[112]](_0xc3ee[111],{UserId:_0xfcb0x2d[_0xc3ee[93]][_0xc3ee[106]][_0xfcb0x34],TeamId:_0xfcb0x2d[_0xc3ee[90]][_0xc3ee[89]]})};return _0xfcb0x33})};return null})[_0xc3ee[52]](respondWithResult(_0xfcb0x1a,null,_0xc3ee[110]))[_0xc3ee[83]](handleError(_0xfcb0x1a,null,_0xc3ee[110]))};exports[_0xc3ee[115]]= function(_0xfcb0x2d,_0xfcb0x1a,_0xfcb0x32){var _0xfcb0x33;return db[_0xc3ee[64]][_0xc3ee[91]]({where:{id:_0xfcb0x2d[_0xc3ee[90]][_0xc3ee[89]]}})[_0xc3ee[52]](handleEntityNotFound(_0xfcb0x1a,null,_0xc3ee[115]))[_0xc3ee[52]](function(_0xfcb0x1d){if(_0xfcb0x1d){return _0xfcb0x1d[_0xc3ee[115]](_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[106]])[_0xc3ee[52]](function(_0xfcb0x33){if(_[_0xc3ee[116]](_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[106]])){for(var _0xfcb0x34=0;_0xfcb0x34< _0xfcb0x2d[_0xc3ee[66]][_0xc3ee[106]][_0xc3ee[71]];_0xfcb0x34+= 1){socket[_0xc3ee[112]](_0xc3ee[117],{UserId:_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[106]][_0xfcb0x34],TeamId:_0xfcb0x2d[_0xc3ee[90]][_0xc3ee[89]]})}}else {socket[_0xc3ee[112]](_0xc3ee[117],{UserId:_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[106]],TeamId:_0xfcb0x2d[_0xc3ee[90]][_0xc3ee[89]]})}})}})[_0xc3ee[52]](respondWithStatusCode(_0xfcb0x1a,null,_0xc3ee[115]))[_0xc3ee[83]](handleError(_0xfcb0x1a,null,_0xc3ee[115]))};exports[_0xc3ee[118]]= function(_0xfcb0x2d,_0xfcb0x1d,_0xfcb0x32){var _0xfcb0x20={};var _0xfcb0x2e={};var _0xfcb0x35;var _0xfcb0x21;return db[_0xc3ee[64]][_0xc3ee[104]]({where:{id:_0xfcb0x2d[_0xc3ee[90]][_0xc3ee[89]]}})[_0xc3ee[52]](handleEntityNotFound(_0xfcb0x1d,null,_0xc3ee[118]))[_0xc3ee[52]](function(_0xfcb0x1d){if(_0xfcb0x1d){_0xfcb0x35= _0xfcb0x1d;_0xfcb0x2e[_0xc3ee[62]]= _[_0xc3ee[65]](db[_0xc3ee[119]][_0xc3ee[63]]);_0xfcb0x2e[_0xc3ee[66]]= _[_0xc3ee[65]](_0xfcb0x2d[_0xc3ee[66]]);_0xfcb0x2e[_0xc3ee[67]]= _[_0xc3ee[68]](_0xfcb0x2e[_0xc3ee[62]],_0xfcb0x2e[_0xc3ee[66]]);_0xfcb0x20[_0xc3ee[69]]= _[_0xc3ee[68]](_0xfcb0x2e[_0xc3ee[62]],qs[_0xc3ee[70]](_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[70]]));_0xfcb0x20[_0xc3ee[69]]= (_0xfcb0x20[_0xc3ee[69]][_0xc3ee[71]])?_0xfcb0x20[_0xc3ee[69]]:_0xfcb0x2e[_0xc3ee[62]];_0xfcb0x20[_0xc3ee[74]]= qs[_0xc3ee[75]](_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[75]]);_0xfcb0x20[_0xc3ee[76]]= qs[_0xc3ee[67]](_[_0xc3ee[77]](_0xfcb0x2d[_0xc3ee[66]],_0xfcb0x2e[_0xc3ee[67]]));if(_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[78]]){_0xfcb0x20[_0xc3ee[76]]= _[_0xc3ee[81]](_0xfcb0x20[_0xc3ee[76]],{$or:_[_0xc3ee[80]](_0xfcb0x20[_0xc3ee[69]],function(_0xfcb0x30){var _0xfcb0x2f={};_0xfcb0x2f[_0xfcb0x30]= {$like:_0xc3ee[79]+ _0xfcb0x2d[_0xc3ee[66]][_0xc3ee[78]]+ _0xc3ee[79]};return _0xfcb0x2f})})};_0xfcb0x20= _[_0xc3ee[81]]({},_0xfcb0x20,_0xfcb0x2d[_0xc3ee[82]]);return _0xfcb0x35[_0xc3ee[118]](_0xfcb0x20)}})[_0xc3ee[52]](function(_0xfcb0x33){if(_0xfcb0x33){_0xfcb0x21= _0xfcb0x33[_0xc3ee[71]];if(!_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[73]](_0xc3ee[72])){_0xfcb0x20[_0xc3ee[42]]= qs[_0xc3ee[42]](_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[42]]);_0xfcb0x20[_0xc3ee[41]]= qs[_0xc3ee[41]](_0xfcb0x2d[_0xc3ee[66]][_0xc3ee[41]])};return _0xfcb0x35[_0xc3ee[118]](_0xfcb0x20)}})[_0xc3ee[52]](function(_0xfcb0x31){if(_0xfcb0x31){return _0xfcb0x31?{count:_0xfcb0x21,rows:_0xfcb0x31}:null}})[_0xc3ee[52]](respondWithResult(_0xfcb0x1d,null,_0xc3ee[118]))[_0xc3ee[83]](handleError(_0xfcb0x1d,null,_0xc3ee[118]))}