Built motion from commit 43538d75.|2.5.35
[motion2.git] / server / api / action / action.controller.js
index 8ae7718..396ca50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b0e=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','reject','save','then','destroy','error','name','update','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x1874f7,_0x5636fe){var _0x3e68ce=function(_0x384390){while(--_0x384390){_0x1874f7['push'](_0x1874f7['shift']());}};_0x3e68ce(++_0x5636fe);}(_0x9b0e,0x177));var _0xe9b0=function(_0x1620c9,_0x3b43be){_0x1620c9=_0x1620c9-0x0;var _0x5604c8=_0x9b0e[_0x1620c9];return _0x5604c8;};'use strict';var emlformat=require(_0xe9b0('0x0'));var rimraf=require(_0xe9b0('0x1'));var zipdir=require(_0xe9b0('0x2'));var jsonpatch=require(_0xe9b0('0x3'));var rp=require(_0xe9b0('0x4'));var moment=require(_0xe9b0('0x5'));var BPromise=require(_0xe9b0('0x6'));var Mustache=require(_0xe9b0('0x7'));var util=require(_0xe9b0('0x8'));var path=require(_0xe9b0('0x9'));var sox=require(_0xe9b0('0xa'));var csv=require(_0xe9b0('0xb'));var ejs=require(_0xe9b0('0xc'));var fs=require('fs');var fs_extra=require(_0xe9b0('0xd'));var _=require(_0xe9b0('0xe'));var squel=require(_0xe9b0('0xf'));var crypto=require('crypto');var jsforce=require(_0xe9b0('0x10'));var deskjs=require(_0xe9b0('0x11'));var toCsv=require(_0xe9b0('0xb'));var querystring=require(_0xe9b0('0x12'));var Papa=require(_0xe9b0('0x13'));var Redis=require(_0xe9b0('0x14'));var authService=require(_0xe9b0('0x15'));var qs=require(_0xe9b0('0x16'));var as=require(_0xe9b0('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe9b0('0x18'))('api');var utils=require(_0xe9b0('0x19'));var config=require(_0xe9b0('0x1a'));var licenseUtil=require(_0xe9b0('0x1b'));var db=require(_0xe9b0('0x1c'))['db'];function respondWithStatusCode(_0x1ccae7,_0x1dd547){_0x1dd547=_0x1dd547||0xcc;return function(_0x5ba669){if(_0x5ba669){return _0x1ccae7[_0xe9b0('0x1d')](_0x1dd547);}return _0x1ccae7[_0xe9b0('0x1e')](_0x1dd547)['end']();};}function respondWithResult(_0x354293,_0x2fa135){_0x2fa135=_0x2fa135||0xc8;return function(_0x1e1f7d){if(_0x1e1f7d){return _0x354293[_0xe9b0('0x1e')](_0x2fa135)['json'](_0x1e1f7d);}};}function respondWithFilteredResult(_0x607dca,_0x502dc4){return function(_0x201cfa){if(_0x201cfa){var _0x2e509e=typeof _0x502dc4[_0xe9b0('0x1f')]==='undefined'&&typeof _0x502dc4[_0xe9b0('0x20')]===_0xe9b0('0x21');var _0x327fd2=_0x201cfa[_0xe9b0('0x22')];var _0x3a0c9c=_0x2e509e?0x0:_0x502dc4[_0xe9b0('0x1f')];var _0x28fccc=_0x2e509e?_0x201cfa['count']:_0x502dc4['offset']+_0x502dc4[_0xe9b0('0x20')];var _0x431e7f;if(_0x28fccc>=_0x327fd2){_0x28fccc=_0x327fd2;_0x431e7f=0xc8;}else{_0x431e7f=0xce;}_0x607dca['status'](_0x431e7f);return _0x607dca[_0xe9b0('0x23')](_0xe9b0('0x24'),_0x3a0c9c+'-'+_0x28fccc+'/'+_0x327fd2)[_0xe9b0('0x25')](_0x201cfa);}return null;};}function patchUpdates(_0xb70a7d){return function(_0x127621){try{jsonpatch['apply'](_0x127621,_0xb70a7d,!![]);}catch(_0x45c32e){return BPromise[_0xe9b0('0x26')](_0x45c32e);}return _0x127621[_0xe9b0('0x27')]();};}function saveUpdates(_0x594db3,_0x556d5b){return function(_0x59508c){if(_0x59508c){return _0x59508c['update'](_0x594db3)[_0xe9b0('0x28')](function(_0x53d035){return _0x53d035;});}return null;};}function removeEntity(_0x2928ed,_0x14a48e){return function(_0x15f469){if(_0x15f469){return _0x15f469[_0xe9b0('0x29')]()[_0xe9b0('0x28')](function(){_0x2928ed[_0xe9b0('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29775e,_0x499a25){return function(_0x581ab0){if(!_0x581ab0){_0x29775e['sendStatus'](0x194);}return _0x581ab0;};}function handleError(_0x5a928d,_0x4a4418){_0x4a4418=_0x4a4418||0x1f4;return function(_0x13f2f3){logger[_0xe9b0('0x2a')](_0x13f2f3['stack']);if(_0x13f2f3['name']){delete _0x13f2f3[_0xe9b0('0x2b')];}_0x5a928d[_0xe9b0('0x1e')](_0x4a4418)['send'](_0x13f2f3);};}exports[_0xe9b0('0x2c')]=function(_0xc4154f,_0x3b9ff2){if(_0xc4154f[_0xe9b0('0x2d')]['id']){delete _0xc4154f[_0xe9b0('0x2d')]['id'];}return db[_0xe9b0('0x2e')][_0xe9b0('0x2f')]({'where':{'id':_0xc4154f[_0xe9b0('0x30')]['id']}})[_0xe9b0('0x28')](handleEntityNotFound(_0x3b9ff2,null))[_0xe9b0('0x28')](saveUpdates(_0xc4154f[_0xe9b0('0x2d')],null))[_0xe9b0('0x28')](respondWithResult(_0x3b9ff2,null))[_0xe9b0('0x31')](handleError(_0x3b9ff2,null));};exports[_0xe9b0('0x29')]=function(_0x2ff4b1,_0xfc870b){return db[_0xe9b0('0x2e')][_0xe9b0('0x2f')]({'where':{'id':_0x2ff4b1['params']['id']}})[_0xe9b0('0x28')](handleEntityNotFound(_0xfc870b,null))[_0xe9b0('0x28')](removeEntity(_0xfc870b,null))[_0xe9b0('0x31')](handleError(_0xfc870b,null));};
\ No newline at end of file
+var _0xb4ff=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','body','Action','find','catch','eml-format','zip-dir','fast-json-patch','bluebird','sox'];(function(_0x31826c,_0x1995c5){var _0x20bbd7=function(_0x2a98ab){while(--_0x2a98ab){_0x31826c['push'](_0x31826c['shift']());}};_0x20bbd7(++_0x1995c5);}(_0xb4ff,0x16b));var _0xfb4f=function(_0x88e11c,_0x2715a5){_0x88e11c=_0x88e11c-0x0;var _0x41ef2f=_0xb4ff[_0x88e11c];return _0x41ef2f;};'use strict';var emlformat=require(_0xfb4f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfb4f('0x1'));var jsonpatch=require(_0xfb4f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfb4f('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xfb4f('0x4'));var csv=require(_0xfb4f('0x5'));var ejs=require(_0xfb4f('0x6'));var fs=require('fs');var fs_extra=require(_0xfb4f('0x7'));var _=require(_0xfb4f('0x8'));var squel=require(_0xfb4f('0x9'));var crypto=require(_0xfb4f('0xa'));var jsforce=require(_0xfb4f('0xb'));var deskjs=require(_0xfb4f('0xc'));var toCsv=require(_0xfb4f('0x5'));var querystring=require('querystring');var Papa=require(_0xfb4f('0xd'));var Redis=require(_0xfb4f('0xe'));var authService=require(_0xfb4f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfb4f('0x10'));var hardwareService=require(_0xfb4f('0x11'));var logger=require(_0xfb4f('0x12'))(_0xfb4f('0x13'));var utils=require(_0xfb4f('0x14'));var config=require(_0xfb4f('0x15'));var licenseUtil=require(_0xfb4f('0x16'));var db=require(_0xfb4f('0x17'))['db'];function respondWithStatusCode(_0x3b35cc,_0x1529c6){_0x1529c6=_0x1529c6||0xcc;return function(_0x1b0f6d){if(_0x1b0f6d){return _0x3b35cc[_0xfb4f('0x18')](_0x1529c6);}return _0x3b35cc[_0xfb4f('0x19')](_0x1529c6)[_0xfb4f('0x1a')]();};}function respondWithResult(_0x3f39a8,_0xa66c57){_0xa66c57=_0xa66c57||0xc8;return function(_0x279b58){if(_0x279b58){return _0x3f39a8[_0xfb4f('0x19')](_0xa66c57)[_0xfb4f('0x1b')](_0x279b58);}};}function respondWithFilteredResult(_0x266c4f,_0x1eb8be){return function(_0x1ae033){if(_0x1ae033){var _0x68ae65=typeof _0x1eb8be[_0xfb4f('0x1c')]==='undefined'&&typeof _0x1eb8be['limit']===_0xfb4f('0x1d');var _0x5a7922=_0x1ae033[_0xfb4f('0x1e')];var _0x2fb007=_0x68ae65?0x0:_0x1eb8be[_0xfb4f('0x1c')];var _0x37aaa4=_0x68ae65?_0x1ae033[_0xfb4f('0x1e')]:_0x1eb8be['offset']+_0x1eb8be['limit'];var _0x64f1b9;if(_0x37aaa4>=_0x5a7922){_0x37aaa4=_0x5a7922;_0x64f1b9=0xc8;}else{_0x64f1b9=0xce;}_0x266c4f[_0xfb4f('0x19')](_0x64f1b9);return _0x266c4f[_0xfb4f('0x1f')]('Content-Range',_0x2fb007+'-'+_0x37aaa4+'/'+_0x5a7922)[_0xfb4f('0x1b')](_0x1ae033);}return null;};}function patchUpdates(_0x16a68f){return function(_0x2c930b){try{jsonpatch[_0xfb4f('0x20')](_0x2c930b,_0x16a68f,!![]);}catch(_0x1f9235){return BPromise[_0xfb4f('0x21')](_0x1f9235);}return _0x2c930b[_0xfb4f('0x22')]();};}function saveUpdates(_0x3157db,_0x570adb){return function(_0x32d4a4){if(_0x32d4a4){return _0x32d4a4[_0xfb4f('0x23')](_0x3157db)[_0xfb4f('0x24')](function(_0x4be5f6){return _0x4be5f6;});}return null;};}function removeEntity(_0x3ac293,_0x195d64){return function(_0x578b77){if(_0x578b77){return _0x578b77[_0xfb4f('0x25')]()['then'](function(){_0x3ac293[_0xfb4f('0x19')](0xcc)[_0xfb4f('0x1a')]();});}};}function handleEntityNotFound(_0x31933d,_0x4e3b73){return function(_0x21d2b5){if(!_0x21d2b5){_0x31933d[_0xfb4f('0x18')](0x194);}return _0x21d2b5;};}function handleError(_0x3de587,_0x2dc0a6){_0x2dc0a6=_0x2dc0a6||0x1f4;return function(_0x372ef3){logger[_0xfb4f('0x26')](_0x372ef3[_0xfb4f('0x27')]);if(_0x372ef3[_0xfb4f('0x28')]){delete _0x372ef3['name'];}_0x3de587[_0xfb4f('0x19')](_0x2dc0a6)[_0xfb4f('0x29')](_0x372ef3);};}exports[_0xfb4f('0x23')]=function(_0x109ccc,_0x4af6ff){if(_0x109ccc[_0xfb4f('0x2a')]['id']){delete _0x109ccc[_0xfb4f('0x2a')]['id'];}return db[_0xfb4f('0x2b')][_0xfb4f('0x2c')]({'where':{'id':_0x109ccc['params']['id']}})[_0xfb4f('0x24')](handleEntityNotFound(_0x4af6ff,null))[_0xfb4f('0x24')](saveUpdates(_0x109ccc[_0xfb4f('0x2a')],null))[_0xfb4f('0x24')](respondWithResult(_0x4af6ff,null))['catch'](handleError(_0x4af6ff,null));};exports[_0xfb4f('0x25')]=function(_0x2f49a5,_0x18580e){return db[_0xfb4f('0x2b')][_0xfb4f('0x2c')]({'where':{'id':_0x2f49a5['params']['id']}})[_0xfb4f('0x24')](handleEntityNotFound(_0x18580e,null))[_0xfb4f('0x24')](removeEntity(_0x18580e,null))[_0xfb4f('0x2d')](handleError(_0x18580e,null));};
\ No newline at end of file