Built motion from commit de2cb856.|2.0.39
[motion2.git] / server / api / cmHopperHistory / cmHopperHistory.controller.js
index 4fb9e1a..cf38055 100644 (file)
@@ -1 +1 @@
-var _0x19b1=["\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","\x43\x6D\x48\x6F\x70\x70\x65\x72\x48\x69\x73\x74\x6F\x72\x79\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","\x43\x6D\x48\x6F\x70\x70\x65\x72\x48\x69\x73\x74\x6F\x72\x79\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","\x43\x6D\x48\x6F\x70\x70\x65\x72\x48\x69\x73\x74\x6F\x72\x79","\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","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\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","\x64\x65\x73\x63\x72\x69\x62\x65","\x75\x6E\x69\x71\x75\x65\x69\x64"];_0x19b1[0];var jsonpatch=require(_0x19b1[1]);var rp=require(_0x19b1[2]);var moment=require(_0x19b1[3]);var BPromise=require(_0x19b1[4]);var Mustache=require(_0x19b1[5]);var util=require(_0x19b1[6]);var path=require(_0x19b1[7]);var sox=require(_0x19b1[8]);var csv=require(_0x19b1[9]);var ejs=require(_0x19b1[10]);var fs=require(_0x19b1[11]);var _=require(_0x19b1[12]);var squel=require(_0x19b1[13]);var crypto=require(_0x19b1[14]);var jsforce=require(_0x19b1[15]);var deskjs=require(_0x19b1[16]);var toCsv=require(_0x19b1[9]);var querystring=require(_0x19b1[17]);var qs=require(_0x19b1[18]);var logger=require(_0x19b1[20])(_0x19b1[19]);var utils=require(_0x19b1[21]);var config=require(_0x19b1[22]);var db=require(_0x19b1[24])[_0x19b1[23]];function respondWithStatusCode(_0xf1bex19,_0xf1bex1a,_0xf1bex1b){_0xf1bex1a= _0xf1bex1a|| 204;return function(_0xf1bex1c){if(_0xf1bex1c){logger[_0x19b1[27]](_0x19b1[25],_0xf1bex1b,_0xf1bex1a,_0x19b1[26]);logger[_0x19b1[29]](_0x19b1[28],_0xf1bex1b,_0xf1bex1a,_0x19b1[26]);return _0xf1bex19[_0x19b1[30]](_0xf1bex1a)};return _0xf1bex19[_0x19b1[32]](_0xf1bex1a)[_0x19b1[31]]()}}function respondWithResult(_0xf1bex19,_0xf1bex1a,_0xf1bex1b){_0xf1bex1a= _0xf1bex1a|| 200;return function(_0xf1bex1c){if(_0xf1bex1c){logger[_0x19b1[27]](_0x19b1[25],_0xf1bex1b,_0xf1bex1a,_0x19b1[33]);logger[_0x19b1[29]](_0x19b1[28],_0xf1bex1b,_0xf1bex1a,_0x19b1[33],JSON[_0x19b1[34]](_0xf1bex1c));return _0xf1bex19[_0x19b1[32]](_0xf1bex1a)[_0x19b1[35]](_0xf1bex1c)}}}function respondWithFilteredResult(_0xf1bex19,_0xf1bex1f,_0xf1bex1b){return function(_0xf1bex1c){if(_0xf1bex1c){var _0xf1bex20=_0xf1bex1c[_0x19b1[36]],_0xf1bex21=_0xf1bex1f[_0x19b1[37]],_0xf1bex22=_0xf1bex1f[_0x19b1[37]]+ _0xf1bex1f[_0x19b1[38]],_0xf1bex1a;if(_0xf1bex22>= _0xf1bex20){_0xf1bex22= _0xf1bex20;_0xf1bex1a= 200}else {_0xf1bex1a= 206};_0xf1bex19[_0x19b1[32]](_0xf1bex1a);logger[_0x19b1[27]](_0x19b1[25],_0xf1bex1b,_0xf1bex1a,_0x19b1[39]);logger[_0x19b1[29]](_0x19b1[28],_0xf1bex1b,_0xf1bex1a,_0x19b1[33],JSON[_0x19b1[34]](_0xf1bex1c));return _0xf1bex19[_0x19b1[43]](_0x19b1[40],_0xf1bex21+ _0x19b1[41]+ _0xf1bex22+ _0x19b1[42]+ _0xf1bex20)[_0x19b1[35]](_0xf1bex1c)};return null}}function patchUpdates(_0xf1bex24){return function(_0xf1bex1c){try{jsonpatch[_0x19b1[44]](_0xf1bex1c,_0xf1bex24,true)}catch(err){return BPromise[_0x19b1[45]](err)};return _0xf1bex1c[_0x19b1[46]]()}}function saveUpdates(_0xf1bex26,_0xf1bex1a,_0xf1bex1b){return function(_0xf1bex1c){if(_0xf1bex1c){return _0xf1bex1c[_0x19b1[49]](_0xf1bex26)[_0x19b1[48]](function(_0xf1bex27){logger[_0x19b1[27]](_0x19b1[25],_0xf1bex1b,_0xf1bex1a,_0x19b1[47]);logger[_0x19b1[29]](_0x19b1[28],_0xf1bex1b,_0xf1bex1a,_0x19b1[47],JSON[_0x19b1[34]](_0xf1bex1c));return _0xf1bex27})};return null}}function removeEntity(_0xf1bex19,_0xf1bex1a,_0xf1bex1b){return function(_0xf1bex1c){if(_0xf1bex1c){return _0xf1bex1c[_0x19b1[51]]()[_0x19b1[48]](function(){logger[_0x19b1[27]](_0x19b1[25],_0xf1bex1b,_0xf1bex1a,_0x19b1[50]);logger[_0x19b1[29]](_0x19b1[28],_0xf1bex1b,_0xf1bex1a,_0x19b1[50],JSON[_0x19b1[34]](_0xf1bex1c));_0xf1bex19[_0x19b1[32]](204)[_0x19b1[31]]()})}}}function handleEntityNotFound(_0xf1bex19,_0xf1bex1a,_0xf1bex1b){return function(_0xf1bex1c){if(!_0xf1bex1c){logger[_0x19b1[53]](_0x19b1[25],_0xf1bex1b,404,_0x19b1[52]);_0xf1bex19[_0x19b1[30]](404)};return _0xf1bex1c}}function handleError(_0xf1bex19,_0xf1bex1a,_0xf1bex1b){_0xf1bex1a= _0xf1bex1a|| 500;return function(_0xf1bex2b){logger[_0x19b1[53]](_0x19b1[25],_0xf1bex1b,_0xf1bex1a,util[_0x19b1[54]](_0xf1bex2b,{showHidden:false,depth:null}));delete _0xf1bex2b[_0x19b1[55]];_0xf1bex19[_0x19b1[32]](_0xf1bex1a)[_0x19b1[56]](_0xf1bex2b)}}exports[_0x19b1[57]]= function(_0xf1bex2c,_0xf1bex19){var _0xf1bex1f={},_0xf1bex2d={};_0xf1bex2d[_0x19b1[58]]= _[_0x19b1[61]](db[_0x19b1[60]][_0x19b1[59]]);_0xf1bex2d[_0x19b1[62]]= _[_0x19b1[61]](_0xf1bex2c[_0x19b1[62]]);_0xf1bex2d[_0x19b1[63]]= _[_0x19b1[64]](_0xf1bex2d[_0x19b1[58]],_0xf1bex2d[_0x19b1[62]]);_0xf1bex1f[_0x19b1[65]]= _[_0x19b1[64]](_0xf1bex2d[_0x19b1[58]],qs[_0x19b1[66]](_0xf1bex2c[_0x19b1[62]][_0x19b1[66]]));_0xf1bex1f[_0x19b1[65]]= (_0xf1bex1f[_0x19b1[65]][_0x19b1[67]])?_0xf1bex1f[_0x19b1[65]]:_0xf1bex2d[_0x19b1[58]];if(!_0xf1bex2c[_0x19b1[62]][_0x19b1[69]](_0x19b1[68])){_0xf1bex1f[_0x19b1[38]]= qs[_0x19b1[38]](_0xf1bex2c[_0x19b1[62]][_0x19b1[38]]);_0xf1bex1f[_0x19b1[37]]= qs[_0x19b1[37]](_0xf1bex2c[_0x19b1[62]][_0x19b1[37]])};_0xf1bex1f[_0x19b1[70]]= qs[_0x19b1[71]](_0xf1bex2c[_0x19b1[62]][_0x19b1[71]]);_0xf1bex1f[_0x19b1[72]]= qs[_0x19b1[63]](_[_0x19b1[73]](_0xf1bex2c[_0x19b1[62]],_0xf1bex2d[_0x19b1[63]]));if(_0xf1bex2c[_0x19b1[62]][_0x19b1[74]]){_0xf1bex1f[_0x19b1[72]]= _[_0x19b1[77]](_0xf1bex1f[_0x19b1[72]],{$or:_[_0x19b1[76]](_0xf1bex1f[_0x19b1[65]],function(_0xf1bex2e){var _0xf1bex2f={};_0xf1bex2f[_0xf1bex2e]= {$like:_0x19b1[75]+ _0xf1bex2c[_0x19b1[62]][_0x19b1[74]]+ _0x19b1[75]};return _0xf1bex2f})})};_0xf1bex1f= _[_0x19b1[77]]({},_0xf1bex1f,_0xf1bex2c[_0x19b1[78]]);return db[_0x19b1[60]][_0x19b1[80]](_0xf1bex1f)[_0x19b1[48]](respondWithFilteredResult(_0xf1bex19,_0xf1bex1f,_0x19b1[57]))[_0x19b1[79]](handleError(_0xf1bex19,null,_0x19b1[57]))};exports[_0x19b1[81]]= function(_0xf1bex2c,_0xf1bex19){var _0xf1bex1f={raw:true,where:{id:_0xf1bex2c[_0x19b1[83]][_0x19b1[82]]}},_0xf1bex2d={};_0xf1bex2d[_0x19b1[58]]= _[_0x19b1[61]](db[_0x19b1[60]][_0x19b1[59]]);_0xf1bex2d[_0x19b1[62]]= _[_0x19b1[61]](_0xf1bex2c[_0x19b1[62]]);_0xf1bex2d[_0x19b1[63]]= _[_0x19b1[64]](_0xf1bex2d[_0x19b1[58]],_0xf1bex2d[_0x19b1[62]]);_0xf1bex1f[_0x19b1[65]]= _[_0x19b1[64]](_0xf1bex2d[_0x19b1[58]],qs[_0x19b1[66]](_0xf1bex2c[_0x19b1[62]][_0x19b1[66]]));_0xf1bex1f[_0x19b1[65]]= (_0xf1bex1f[_0x19b1[65]][_0x19b1[67]])?_0xf1bex1f[_0x19b1[65]]:_0xf1bex2d[_0x19b1[58]];_0xf1bex1f= _[_0x19b1[77]]({},_0xf1bex1f,_0xf1bex2c[_0x19b1[78]]);return db[_0x19b1[60]][_0x19b1[84]](_0xf1bex1f)[_0x19b1[48]](handleEntityNotFound(_0xf1bex19,null,_0x19b1[81]))[_0x19b1[48]](respondWithResult(_0xf1bex19,null,_0x19b1[81]))[_0x19b1[79]](handleError(_0xf1bex19,null,_0x19b1[81]))};exports[_0x19b1[85]]= function(_0xf1bex2c,_0xf1bex19){return db[_0x19b1[60]][_0x19b1[85]](_0xf1bex2c[_0x19b1[86]],{})[_0x19b1[48]](respondWithResult(_0xf1bex19,201,_0x19b1[85]))[_0x19b1[79]](handleError(_0xf1bex19,null,_0x19b1[85]))};exports[_0x19b1[87]]= function(_0xf1bex2c,_0xf1bex19){return db[_0x19b1[60]][_0x19b1[87]]()[_0x19b1[48]](respondWithResult(_0xf1bex19,null,_0x19b1[87]))[_0x19b1[79]](handleError(_0xf1bex19,null,_0x19b1[87]))};exports[_0x19b1[49]]= function(_0xf1bex2c,_0xf1bex19){if(_0xf1bex2c[_0x19b1[86]][_0x19b1[88]]){delete _0xf1bex2c[_0x19b1[86]][_0x19b1[88]]};return db[_0x19b1[60]][_0x19b1[84]]({where:{uniqueid:_0xf1bex2c[_0x19b1[83]][_0x19b1[82]]}})[_0x19b1[48]](handleEntityNotFound(_0xf1bex19,null,_0x19b1[49]))[_0x19b1[48]](saveUpdates(_0xf1bex2c[_0x19b1[86]],null,_0x19b1[49]))[_0x19b1[48]](respondWithResult(_0xf1bex19,null,_0x19b1[49]))[_0x19b1[79]](handleError(_0xf1bex19,null,_0x19b1[49]))}
\ No newline at end of file
+var _0x4303=["\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","\x43\x6D\x48\x6F\x70\x70\x65\x72\x48\x69\x73\x74\x6F\x72\x79\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","\x43\x6D\x48\x6F\x70\x70\x65\x72\x48\x69\x73\x74\x6F\x72\x79\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","\x43\x6D\x48\x6F\x70\x70\x65\x72\x48\x69\x73\x74\x6F\x72\x79","\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","\x64\x65\x73\x63\x72\x69\x62\x65","\x75\x6E\x69\x71\x75\x65\x69\x64"];_0x4303[0];var jsonpatch=require(_0x4303[1]);var rp=require(_0x4303[2]);var moment=require(_0x4303[3]);var BPromise=require(_0x4303[4]);var Mustache=require(_0x4303[5]);var util=require(_0x4303[6]);var path=require(_0x4303[7]);var sox=require(_0x4303[8]);var csv=require(_0x4303[9]);var ejs=require(_0x4303[10]);var fs=require(_0x4303[11]);var _=require(_0x4303[12]);var squel=require(_0x4303[13]);var crypto=require(_0x4303[14]);var jsforce=require(_0x4303[15]);var deskjs=require(_0x4303[16]);var toCsv=require(_0x4303[9]);var querystring=require(_0x4303[17]);var qs=require(_0x4303[18]);var logger=require(_0x4303[20])(_0x4303[19]);var utils=require(_0x4303[21]);var config=require(_0x4303[22]);var db=require(_0x4303[24])[_0x4303[23]];function respondWithStatusCode(_0x5014x19,_0x5014x1a,_0x5014x1b){_0x5014x1a= _0x5014x1a|| 204;return function(_0x5014x1c){if(_0x5014x1c){logger[_0x4303[27]](_0x4303[25],_0x5014x1b,_0x5014x1a,_0x4303[26]);logger[_0x4303[29]](_0x4303[28],_0x5014x1b,_0x5014x1a,_0x4303[26]);return _0x5014x19[_0x4303[30]](_0x5014x1a)};return _0x5014x19[_0x4303[32]](_0x5014x1a)[_0x4303[31]]()}}function respondWithResult(_0x5014x19,_0x5014x1a,_0x5014x1b){_0x5014x1a= _0x5014x1a|| 200;return function(_0x5014x1c){if(_0x5014x1c){logger[_0x4303[27]](_0x4303[25],_0x5014x1b,_0x5014x1a,_0x4303[33]);logger[_0x4303[29]](_0x4303[28],_0x5014x1b,_0x5014x1a,_0x4303[33],JSON[_0x4303[34]](_0x5014x1c));return _0x5014x19[_0x4303[32]](_0x5014x1a)[_0x4303[35]](_0x5014x1c)}}}function respondWithFilteredResult(_0x5014x19,_0x5014x1f,_0x5014x1b){return function(_0x5014x1c){if(_0x5014x1c){var _0x5014x20=_0x5014x1c[_0x4303[36]],_0x5014x21=_0x5014x1f[_0x4303[37]],_0x5014x22=_0x5014x1f[_0x4303[37]]+ _0x5014x1f[_0x4303[38]],_0x5014x1a;if(_0x5014x22>= _0x5014x20){_0x5014x22= _0x5014x20;_0x5014x1a= 200}else {_0x5014x1a= 206};_0x5014x19[_0x4303[32]](_0x5014x1a);logger[_0x4303[27]](_0x4303[25],_0x5014x1b,_0x5014x1a,_0x4303[39]);logger[_0x4303[29]](_0x4303[28],_0x5014x1b,_0x5014x1a,_0x4303[33],JSON[_0x4303[34]](_0x5014x1c));return _0x5014x19[_0x4303[43]](_0x4303[40],_0x5014x21+ _0x4303[41]+ _0x5014x22+ _0x4303[42]+ _0x5014x20)[_0x4303[35]](_0x5014x1c)};return null}}function patchUpdates(_0x5014x24){return function(_0x5014x1c){try{jsonpatch[_0x4303[44]](_0x5014x1c,_0x5014x24,true)}catch(err){return BPromise[_0x4303[45]](err)};return _0x5014x1c[_0x4303[46]]()}}function saveUpdates(_0x5014x26,_0x5014x1a,_0x5014x1b){return function(_0x5014x1c){if(_0x5014x1c){return _0x5014x1c[_0x4303[49]](_0x5014x26)[_0x4303[48]](function(_0x5014x27){logger[_0x4303[27]](_0x4303[25],_0x5014x1b,_0x5014x1a,_0x4303[47]);logger[_0x4303[29]](_0x4303[28],_0x5014x1b,_0x5014x1a,_0x4303[47],JSON[_0x4303[34]](_0x5014x1c));return _0x5014x27})};return null}}function removeEntity(_0x5014x19,_0x5014x1a,_0x5014x1b){return function(_0x5014x1c){if(_0x5014x1c){return _0x5014x1c[_0x4303[51]]()[_0x4303[48]](function(){logger[_0x4303[27]](_0x4303[25],_0x5014x1b,_0x5014x1a,_0x4303[50]);logger[_0x4303[29]](_0x4303[28],_0x5014x1b,_0x5014x1a,_0x4303[50],JSON[_0x4303[34]](_0x5014x1c));_0x5014x19[_0x4303[32]](204)[_0x4303[31]]()})}}}function handleEntityNotFound(_0x5014x19,_0x5014x1a,_0x5014x1b){return function(_0x5014x1c){if(!_0x5014x1c){logger[_0x4303[53]](_0x4303[25],_0x5014x1b,404,_0x4303[52]);_0x5014x19[_0x4303[30]](404)};return _0x5014x1c}}function handleError(_0x5014x19,_0x5014x1a,_0x5014x1b){_0x5014x1a= _0x5014x1a|| 500;return function(_0x5014x2b){logger[_0x4303[53]](_0x4303[25],_0x5014x1b,_0x5014x1a,util[_0x4303[54]](_0x5014x2b,{showHidden:false,depth:null}));delete _0x5014x2b[_0x4303[55]];_0x5014x19[_0x4303[32]](_0x5014x1a)[_0x4303[56]](_0x5014x2b)}}exports[_0x4303[57]]= function(_0x5014x2c,_0x5014x19){var _0x5014x1f={},_0x5014x2d={},_0x5014x2e={count:0,rows:[]};_0x5014x2d[_0x4303[58]]= _[_0x4303[61]](db[_0x4303[60]][_0x4303[59]]);_0x5014x2d[_0x4303[62]]= _[_0x4303[61]](_0x5014x2c[_0x4303[62]]);_0x5014x2d[_0x4303[63]]= _[_0x4303[64]](_0x5014x2d[_0x4303[58]],_0x5014x2d[_0x4303[62]]);_0x5014x1f[_0x4303[65]]= _[_0x4303[64]](_0x5014x2d[_0x4303[58]],qs[_0x4303[66]](_0x5014x2c[_0x4303[62]][_0x4303[66]]));_0x5014x1f[_0x4303[65]]= (_0x5014x1f[_0x4303[65]][_0x4303[67]])?_0x5014x1f[_0x4303[65]]:_0x5014x2d[_0x4303[58]];if(!_0x5014x2c[_0x4303[62]][_0x4303[69]](_0x4303[68])){_0x5014x1f[_0x4303[38]]= qs[_0x4303[38]](_0x5014x2c[_0x4303[62]][_0x4303[38]]);_0x5014x1f[_0x4303[37]]= qs[_0x4303[37]](_0x5014x2c[_0x4303[62]][_0x4303[37]])};_0x5014x1f[_0x4303[70]]= qs[_0x4303[71]](_0x5014x2c[_0x4303[62]][_0x4303[71]]);_0x5014x1f[_0x4303[72]]= qs[_0x4303[63]](_[_0x4303[73]](_0x5014x2c[_0x4303[62]],_0x5014x2d[_0x4303[63]]));if(_0x5014x2c[_0x4303[62]][_0x4303[74]]){_0x5014x1f[_0x4303[72]]= _[_0x4303[77]](_0x5014x1f[_0x4303[72]],{$or:_[_0x4303[76]](_0x5014x1f[_0x4303[65]],function(_0x5014x2f){var _0x5014x2e={};_0x5014x2e[_0x5014x2f]= {$like:_0x4303[75]+ _0x5014x2c[_0x4303[62]][_0x4303[74]]+ _0x4303[75]};return _0x5014x2e})})};_0x5014x1f= _[_0x4303[77]]({},_0x5014x1f,_0x5014x2c[_0x4303[78]]);return db[_0x4303[60]][_0x4303[36]](_0x5014x1f)[_0x4303[48]](function(_0x5014x20){_0x5014x2e[_0x4303[36]]= _0x5014x20;if(_0x5014x2c[_0x4303[62]][_0x4303[81]]){_0x5014x1f[_0x4303[82]]= [{all:true}]};return db[_0x4303[60]][_0x4303[83]](_0x5014x1f)})[_0x4303[48]](function(_0x5014x30){_0x5014x2e[_0x4303[80]]= _0x5014x30;return _0x5014x2e})[_0x4303[48]](respondWithFilteredResult(_0x5014x19,_0x5014x1f,_0x4303[57]))[_0x4303[79]](handleError(_0x5014x19,null,_0x4303[57]))};exports[_0x4303[84]]= function(_0x5014x2c,_0x5014x19){var _0x5014x1f={raw:true,where:{id:_0x5014x2c[_0x4303[86]][_0x4303[85]]}},_0x5014x2d={};_0x5014x2d[_0x4303[58]]= _[_0x4303[61]](db[_0x4303[60]][_0x4303[59]]);_0x5014x2d[_0x4303[62]]= _[_0x4303[61]](_0x5014x2c[_0x4303[62]]);_0x5014x2d[_0x4303[63]]= _[_0x4303[64]](_0x5014x2d[_0x4303[58]],_0x5014x2d[_0x4303[62]]);_0x5014x1f[_0x4303[65]]= _[_0x4303[64]](_0x5014x2d[_0x4303[58]],qs[_0x4303[66]](_0x5014x2c[_0x4303[62]][_0x4303[66]]));_0x5014x1f[_0x4303[65]]= (_0x5014x1f[_0x4303[65]][_0x4303[67]])?_0x5014x1f[_0x4303[65]]:_0x5014x2d[_0x4303[58]];if(_0x5014x2c[_0x4303[62]][_0x4303[81]]){_0x5014x1f[_0x4303[82]]= [{all:true}]};_0x5014x1f= _[_0x4303[77]]({},_0x5014x1f,_0x5014x2c[_0x4303[78]]);return db[_0x4303[60]][_0x4303[87]](_0x5014x1f)[_0x4303[48]](handleEntityNotFound(_0x5014x19,null,_0x4303[84]))[_0x4303[48]](respondWithResult(_0x5014x19,null,_0x4303[84]))[_0x4303[79]](handleError(_0x5014x19,null,_0x4303[84]))};exports[_0x4303[88]]= function(_0x5014x2c,_0x5014x19){return db[_0x4303[60]][_0x4303[88]](_0x5014x2c[_0x4303[89]],{})[_0x4303[48]](respondWithResult(_0x5014x19,201,_0x4303[88]))[_0x4303[79]](handleError(_0x5014x19,null,_0x4303[88]))};exports[_0x4303[90]]= function(_0x5014x2c,_0x5014x19){return db[_0x4303[60]][_0x4303[90]]()[_0x4303[48]](respondWithResult(_0x5014x19,null,_0x4303[90]))[_0x4303[79]](handleError(_0x5014x19,null,_0x4303[90]))};exports[_0x4303[49]]= function(_0x5014x2c,_0x5014x19){if(_0x5014x2c[_0x4303[89]][_0x4303[91]]){delete _0x5014x2c[_0x4303[89]][_0x4303[91]]};return db[_0x4303[60]][_0x4303[87]]({where:{uniqueid:_0x5014x2c[_0x4303[86]][_0x4303[85]]}})[_0x4303[48]](handleEntityNotFound(_0x5014x19,null,_0x4303[49]))[_0x4303[48]](saveUpdates(_0x5014x2c[_0x4303[89]],null,_0x4303[49]))[_0x4303[48]](respondWithResult(_0x5014x19,null,_0x4303[49]))[_0x4303[79]](handleError(_0x5014x19,null,_0x4303[49]))}
\ No newline at end of file