Built motion from commit (unavailable).|2.5.29
[motion2.git] / server / api / action / action.controller.js
index a8f592a..9b560f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50e5=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','body','find','params','catch','Action','html-pdf'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x50e5,0xb7));var _0x550e=function(_0x10a047,_0x57e8ee){_0x10a047=_0x10a047-0x0;var _0x3754b8=_0x50e5[_0x10a047];return _0x3754b8;};'use strict';var pdf=require(_0x550e('0x0'));var emlformat=require(_0x550e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x550e('0x2'));var jsonpatch=require(_0x550e('0x3'));var rp=require(_0x550e('0x4'));var moment=require(_0x550e('0x5'));var BPromise=require(_0x550e('0x6'));var Mustache=require(_0x550e('0x7'));var util=require(_0x550e('0x8'));var path=require(_0x550e('0x9'));var sox=require(_0x550e('0xa'));var csv=require(_0x550e('0xb'));var ejs=require(_0x550e('0xc'));var fs=require('fs');var _=require(_0x550e('0xd'));var squel=require('squel');var crypto=require(_0x550e('0xe'));var jsforce=require(_0x550e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x550e('0xb'));var querystring=require(_0x550e('0x10'));var Papa=require(_0x550e('0x11'));var Redis=require('ioredis');var authService=require(_0x550e('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x550e('0x13'));var logger=require(_0x550e('0x14'))('api');var utils=require(_0x550e('0x15'));var config=require(_0x550e('0x16'));var licenseUtil=require(_0x550e('0x17'));var db=require(_0x550e('0x18'))['db'];function respondWithStatusCode(_0x518cad,_0x335cba){_0x335cba=_0x335cba||0xcc;return function(_0x57214a){if(_0x57214a){return _0x518cad[_0x550e('0x19')](_0x335cba);}return _0x518cad['status'](_0x335cba)[_0x550e('0x1a')]();};}function respondWithResult(_0x4c6070,_0x393055){_0x393055=_0x393055||0xc8;return function(_0x2d4b79){if(_0x2d4b79){return _0x4c6070[_0x550e('0x1b')](_0x393055)['json'](_0x2d4b79);}};}function respondWithFilteredResult(_0x302be0,_0x49787c){return function(_0xf28ba7){if(_0xf28ba7){var _0x49474f=_0xf28ba7['count'],_0x4a5f7a=_0x49787c['offset'],_0x31f4bf=_0x49787c['offset']+_0x49787c[_0x550e('0x1c')],_0xabb30d;if(_0x31f4bf>=_0x49474f){_0x31f4bf=_0x49474f;_0xabb30d=0xc8;}else{_0xabb30d=0xce;}_0x302be0['status'](_0xabb30d);return _0x302be0['set'](_0x550e('0x1d'),_0x4a5f7a+'-'+_0x31f4bf+'/'+_0x49474f)[_0x550e('0x1e')](_0xf28ba7);}return null;};}function patchUpdates(_0x6c7178){return function(_0x846ad){try{jsonpatch[_0x550e('0x1f')](_0x846ad,_0x6c7178,!![]);}catch(_0x29f2db){return BPromise[_0x550e('0x20')](_0x29f2db);}return _0x846ad[_0x550e('0x21')]();};}function saveUpdates(_0x1b9799,_0x47e6e1){return function(_0x23adb1){if(_0x23adb1){return _0x23adb1[_0x550e('0x22')](_0x1b9799)['then'](function(_0x4f70bd){return _0x4f70bd;});}return null;};}function removeEntity(_0x3e9822,_0x2663c7){return function(_0x5769bb){if(_0x5769bb){return _0x5769bb[_0x550e('0x23')]()[_0x550e('0x24')](function(){_0x3e9822[_0x550e('0x1b')](0xcc)[_0x550e('0x1a')]();});}};}function handleEntityNotFound(_0x3aa1b8,_0x3bbca3){return function(_0x56f6a2){if(!_0x56f6a2){_0x3aa1b8[_0x550e('0x19')](0x194);}return _0x56f6a2;};}function handleError(_0x205e3a,_0x45d972){_0x45d972=_0x45d972||0x1f4;return function(_0x2d10f3){logger[_0x550e('0x25')](_0x2d10f3[_0x550e('0x26')]);if(_0x2d10f3[_0x550e('0x27')]){delete _0x2d10f3[_0x550e('0x27')];}_0x205e3a[_0x550e('0x1b')](_0x45d972)[_0x550e('0x28')](_0x2d10f3);};}exports[_0x550e('0x22')]=function(_0x362d21,_0x5e0434){if(_0x362d21[_0x550e('0x29')]['id']){delete _0x362d21[_0x550e('0x29')]['id'];}return db['Action'][_0x550e('0x2a')]({'where':{'id':_0x362d21[_0x550e('0x2b')]['id']}})[_0x550e('0x24')](handleEntityNotFound(_0x5e0434,null))[_0x550e('0x24')](saveUpdates(_0x362d21[_0x550e('0x29')],null))[_0x550e('0x24')](respondWithResult(_0x5e0434,null))[_0x550e('0x2c')](handleError(_0x5e0434,null));};exports[_0x550e('0x23')]=function(_0x209f30,_0x43f7b2){return db[_0x550e('0x2d')][_0x550e('0x2a')]({'where':{'id':_0x209f30[_0x550e('0x2b')]['id']}})[_0x550e('0x24')](handleEntityNotFound(_0x43f7b2,null))['then'](removeEntity(_0x43f7b2,null))[_0x550e('0x2c')](handleError(_0x43f7b2,null));};
\ No newline at end of file
+var _0x2168=['destroy','end','error','stack','name','send','body','Action','find','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','reject','save','update','then'];(function(_0x5bca5d,_0x3a2225){var _0x578294=function(_0x32b2a1){while(--_0x32b2a1){_0x5bca5d['push'](_0x5bca5d['shift']());}};_0x578294(++_0x3a2225);}(_0x2168,0x9b));var _0x8216=function(_0x310de1,_0x4183e8){_0x310de1=_0x310de1-0x0;var _0x213cf7=_0x2168[_0x310de1];return _0x213cf7;};'use strict';var emlformat=require(_0x8216('0x0'));var rimraf=require(_0x8216('0x1'));var zipdir=require(_0x8216('0x2'));var jsonpatch=require(_0x8216('0x3'));var rp=require(_0x8216('0x4'));var moment=require(_0x8216('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8216('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x8216('0x7'));var ejs=require(_0x8216('0x8'));var fs=require('fs');var fs_extra=require(_0x8216('0x9'));var _=require(_0x8216('0xa'));var squel=require(_0x8216('0xb'));var crypto=require(_0x8216('0xc'));var jsforce=require(_0x8216('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8216('0x7'));var querystring=require(_0x8216('0xe'));var Papa=require(_0x8216('0xf'));var Redis=require('ioredis');var authService=require(_0x8216('0x10'));var qs=require(_0x8216('0x11'));var as=require(_0x8216('0x12'));var hardwareService=require(_0x8216('0x13'));var logger=require(_0x8216('0x14'))(_0x8216('0x15'));var utils=require('../../config/utils');var config=require(_0x8216('0x16'));var licenseUtil=require(_0x8216('0x17'));var db=require(_0x8216('0x18'))['db'];function respondWithStatusCode(_0x37c64d,_0x4cb109){_0x4cb109=_0x4cb109||0xcc;return function(_0x1f819e){if(_0x1f819e){return _0x37c64d[_0x8216('0x19')](_0x4cb109);}return _0x37c64d[_0x8216('0x1a')](_0x4cb109)['end']();};}function respondWithResult(_0x364b35,_0x5983d7){_0x5983d7=_0x5983d7||0xc8;return function(_0x273fc6){if(_0x273fc6){return _0x364b35['status'](_0x5983d7)['json'](_0x273fc6);}};}function respondWithFilteredResult(_0x33be7c,_0x2c795c){return function(_0x4aaeb4){if(_0x4aaeb4){var _0x4a1872=typeof _0x2c795c[_0x8216('0x1b')]==='undefined'&&typeof _0x2c795c[_0x8216('0x1c')]===_0x8216('0x1d');var _0x295984=_0x4aaeb4[_0x8216('0x1e')];var _0x5a69da=_0x4a1872?0x0:_0x2c795c[_0x8216('0x1b')];var _0x3ab66b=_0x4a1872?_0x4aaeb4[_0x8216('0x1e')]:_0x2c795c[_0x8216('0x1b')]+_0x2c795c[_0x8216('0x1c')];var _0x12e609;if(_0x3ab66b>=_0x295984){_0x3ab66b=_0x295984;_0x12e609=0xc8;}else{_0x12e609=0xce;}_0x33be7c['status'](_0x12e609);return _0x33be7c[_0x8216('0x1f')](_0x8216('0x20'),_0x5a69da+'-'+_0x3ab66b+'/'+_0x295984)['json'](_0x4aaeb4);}return null;};}function patchUpdates(_0x223638){return function(_0xb145e3){try{jsonpatch['apply'](_0xb145e3,_0x223638,!![]);}catch(_0x41eb56){return BPromise[_0x8216('0x21')](_0x41eb56);}return _0xb145e3[_0x8216('0x22')]();};}function saveUpdates(_0xaf2154,_0x57242a){return function(_0x3229aa){if(_0x3229aa){return _0x3229aa[_0x8216('0x23')](_0xaf2154)[_0x8216('0x24')](function(_0x4fcf35){return _0x4fcf35;});}return null;};}function removeEntity(_0x105898,_0x24fb34){return function(_0x48bd62){if(_0x48bd62){return _0x48bd62[_0x8216('0x25')]()[_0x8216('0x24')](function(){_0x105898[_0x8216('0x1a')](0xcc)[_0x8216('0x26')]();});}};}function handleEntityNotFound(_0xad9d99,_0x39ada1){return function(_0x19e9ea){if(!_0x19e9ea){_0xad9d99[_0x8216('0x19')](0x194);}return _0x19e9ea;};}function handleError(_0x3a3f3e,_0x431513){_0x431513=_0x431513||0x1f4;return function(_0x4c8aec){logger[_0x8216('0x27')](_0x4c8aec[_0x8216('0x28')]);if(_0x4c8aec[_0x8216('0x29')]){delete _0x4c8aec[_0x8216('0x29')];}_0x3a3f3e[_0x8216('0x1a')](_0x431513)[_0x8216('0x2a')](_0x4c8aec);};}exports[_0x8216('0x23')]=function(_0x308b6c,_0x490aaa){if(_0x308b6c[_0x8216('0x2b')]['id']){delete _0x308b6c[_0x8216('0x2b')]['id'];}return db[_0x8216('0x2c')][_0x8216('0x2d')]({'where':{'id':_0x308b6c['params']['id']}})[_0x8216('0x24')](handleEntityNotFound(_0x490aaa,null))[_0x8216('0x24')](saveUpdates(_0x308b6c[_0x8216('0x2b')],null))[_0x8216('0x24')](respondWithResult(_0x490aaa,null))[_0x8216('0x2e')](handleError(_0x490aaa,null));};exports[_0x8216('0x25')]=function(_0x263a0b,_0x25a5f3){return db[_0x8216('0x2c')][_0x8216('0x2d')]({'where':{'id':_0x263a0b[_0x8216('0x2f')]['id']}})[_0x8216('0x24')](handleEntityNotFound(_0x25a5f3,null))['then'](removeEntity(_0x25a5f3,null))[_0x8216('0x2e')](handleError(_0x25a5f3,null));};
\ No newline at end of file