Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / server / api / action / action.controller.js
index 172bfd9..2b283ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b65=['crypto','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','stack','name','send','body','Action','find','catch','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel'];(function(_0x239f86,_0x1dfabb){var _0x25123a=function(_0x20b487){while(--_0x20b487){_0x239f86['push'](_0x239f86['shift']());}};_0x25123a(++_0x1dfabb);}(_0x1b65,0x1b4));var _0x51b6=function(_0x331b08,_0x2c5937){_0x331b08=_0x331b08-0x0;var _0x5034d9=_0x1b65[_0x331b08];return _0x5034d9;};'use strict';var pdf=require(_0x51b6('0x0'));var emlformat=require(_0x51b6('0x1'));var rimraf=require(_0x51b6('0x2'));var zipdir=require(_0x51b6('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x51b6('0x4'));var moment=require(_0x51b6('0x5'));var BPromise=require(_0x51b6('0x6'));var Mustache=require(_0x51b6('0x7'));var util=require(_0x51b6('0x8'));var path=require(_0x51b6('0x9'));var sox=require(_0x51b6('0xa'));var csv=require('to-csv');var ejs=require(_0x51b6('0xb'));var fs=require('fs');var _=require(_0x51b6('0xc'));var squel=require(_0x51b6('0xd'));var crypto=require(_0x51b6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x51b6('0xf'));var toCsv=require(_0x51b6('0x10'));var querystring=require('querystring');var Papa=require(_0x51b6('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x51b6('0x12'));var as=require(_0x51b6('0x13'));var hardwareService=require(_0x51b6('0x14'));var logger=require(_0x51b6('0x15'))(_0x51b6('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x51b6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cd605,_0x422bd4){_0x422bd4=_0x422bd4||0xcc;return function(_0x4ca143){if(_0x4ca143){return _0x4cd605[_0x51b6('0x18')](_0x422bd4);}return _0x4cd605['status'](_0x422bd4)[_0x51b6('0x19')]();};}function respondWithResult(_0x24a386,_0x2890ee){_0x2890ee=_0x2890ee||0xc8;return function(_0x235d8c){if(_0x235d8c){return _0x24a386[_0x51b6('0x1a')](_0x2890ee)[_0x51b6('0x1b')](_0x235d8c);}};}function respondWithFilteredResult(_0x4c6cd0,_0x23549b){return function(_0x596863){if(_0x596863){var _0x39583d=_0x596863[_0x51b6('0x1c')],_0x4c99fb=_0x23549b[_0x51b6('0x1d')],_0x4007b0=_0x23549b[_0x51b6('0x1d')]+_0x23549b[_0x51b6('0x1e')],_0x500a82;if(_0x4007b0>=_0x39583d){_0x4007b0=_0x39583d;_0x500a82=0xc8;}else{_0x500a82=0xce;}_0x4c6cd0[_0x51b6('0x1a')](_0x500a82);return _0x4c6cd0[_0x51b6('0x1f')]('Content-Range',_0x4c99fb+'-'+_0x4007b0+'/'+_0x39583d)[_0x51b6('0x1b')](_0x596863);}return null;};}function patchUpdates(_0x5b8a31){return function(_0x2974f0){try{jsonpatch[_0x51b6('0x20')](_0x2974f0,_0x5b8a31,!![]);}catch(_0x506367){return BPromise[_0x51b6('0x21')](_0x506367);}return _0x2974f0[_0x51b6('0x22')]();};}function saveUpdates(_0x3fee21,_0x471783){return function(_0x21c90c){if(_0x21c90c){return _0x21c90c[_0x51b6('0x23')](_0x3fee21)[_0x51b6('0x24')](function(_0x1e70fc){return _0x1e70fc;});}return null;};}function removeEntity(_0x4ab876,_0x35d2ab){return function(_0x11db4e){if(_0x11db4e){return _0x11db4e[_0x51b6('0x25')]()[_0x51b6('0x24')](function(){_0x4ab876['status'](0xcc)[_0x51b6('0x19')]();});}};}function handleEntityNotFound(_0x3680af,_0x51c013){return function(_0x5de6e3){if(!_0x5de6e3){_0x3680af[_0x51b6('0x18')](0x194);}return _0x5de6e3;};}function handleError(_0x47499e,_0x3518ba){_0x3518ba=_0x3518ba||0x1f4;return function(_0x59193e){logger['error'](_0x59193e[_0x51b6('0x26')]);if(_0x59193e[_0x51b6('0x27')]){delete _0x59193e[_0x51b6('0x27')];}_0x47499e['status'](_0x3518ba)[_0x51b6('0x28')](_0x59193e);};}exports[_0x51b6('0x23')]=function(_0x5a8a5b,_0x2df2fa){if(_0x5a8a5b[_0x51b6('0x29')]['id']){delete _0x5a8a5b[_0x51b6('0x29')]['id'];}return db[_0x51b6('0x2a')][_0x51b6('0x2b')]({'where':{'id':_0x5a8a5b['params']['id']}})[_0x51b6('0x24')](handleEntityNotFound(_0x2df2fa,null))[_0x51b6('0x24')](saveUpdates(_0x5a8a5b[_0x51b6('0x29')],null))['then'](respondWithResult(_0x2df2fa,null))[_0x51b6('0x2c')](handleError(_0x2df2fa,null));};exports[_0x51b6('0x25')]=function(_0x29d89b,_0x155e67){return db['Action'][_0x51b6('0x2b')]({'where':{'id':_0x29d89b['params']['id']}})[_0x51b6('0x24')](handleEntityNotFound(_0x155e67,null))[_0x51b6('0x24')](removeEntity(_0x155e67,null))['catch'](handleError(_0x155e67,null));};
\ No newline at end of file
+var _0x1560=['papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','body','Action','find','catch','params','eml-format','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto'];(function(_0x28ba8d,_0x52a4f3){var _0x472f3b=function(_0x4c5ef3){while(--_0x4c5ef3){_0x28ba8d['push'](_0x28ba8d['shift']());}};_0x472f3b(++_0x52a4f3);}(_0x1560,0x155));var _0x0156=function(_0x455243,_0x524470){_0x455243=_0x455243-0x0;var _0x3bfc83=_0x1560[_0x455243];return _0x3bfc83;};'use strict';var emlformat=require(_0x0156('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0156('0x1'));var rp=require(_0x0156('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0156('0x3'));var util=require(_0x0156('0x4'));var path=require(_0x0156('0x5'));var sox=require(_0x0156('0x6'));var csv=require(_0x0156('0x7'));var ejs=require(_0x0156('0x8'));var fs=require('fs');var fs_extra=require(_0x0156('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0156('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0156('0xb'));var Redis=require('ioredis');var authService=require(_0x0156('0xc'));var qs=require(_0x0156('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0156('0xe'));var logger=require(_0x0156('0xf'))(_0x0156('0x10'));var utils=require('../../config/utils');var config=require(_0x0156('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x0156('0x12'))['db'];function respondWithStatusCode(_0x11c9f4,_0x1664e9){_0x1664e9=_0x1664e9||0xcc;return function(_0x195c19){if(_0x195c19){return _0x11c9f4[_0x0156('0x13')](_0x1664e9);}return _0x11c9f4[_0x0156('0x14')](_0x1664e9)[_0x0156('0x15')]();};}function respondWithResult(_0x9f5380,_0xc04800){_0xc04800=_0xc04800||0xc8;return function(_0x27c7a8){if(_0x27c7a8){return _0x9f5380[_0x0156('0x14')](_0xc04800)[_0x0156('0x16')](_0x27c7a8);}};}function respondWithFilteredResult(_0x31e5e8,_0x3ac20b){return function(_0x65c5bb){if(_0x65c5bb){var _0x868bb2=typeof _0x3ac20b[_0x0156('0x17')]===_0x0156('0x18')&&typeof _0x3ac20b[_0x0156('0x19')]===_0x0156('0x18');var _0x4975be=_0x65c5bb[_0x0156('0x1a')];var _0x448cd6=_0x868bb2?0x0:_0x3ac20b[_0x0156('0x17')];var _0x3f2faf=_0x868bb2?_0x65c5bb[_0x0156('0x1a')]:_0x3ac20b[_0x0156('0x17')]+_0x3ac20b[_0x0156('0x19')];var _0x20cc76;if(_0x3f2faf>=_0x4975be){_0x3f2faf=_0x4975be;_0x20cc76=0xc8;}else{_0x20cc76=0xce;}_0x31e5e8[_0x0156('0x14')](_0x20cc76);return _0x31e5e8[_0x0156('0x1b')](_0x0156('0x1c'),_0x448cd6+'-'+_0x3f2faf+'/'+_0x4975be)[_0x0156('0x16')](_0x65c5bb);}return null;};}function patchUpdates(_0x2786e3){return function(_0x266b00){try{jsonpatch[_0x0156('0x1d')](_0x266b00,_0x2786e3,!![]);}catch(_0x55a0a4){return BPromise[_0x0156('0x1e')](_0x55a0a4);}return _0x266b00[_0x0156('0x1f')]();};}function saveUpdates(_0x2dd30d,_0x29b0b5){return function(_0x268bd1){if(_0x268bd1){return _0x268bd1[_0x0156('0x20')](_0x2dd30d)[_0x0156('0x21')](function(_0x135c5b){return _0x135c5b;});}return null;};}function removeEntity(_0xd4a0d5,_0x41da50){return function(_0x5d3a24){if(_0x5d3a24){return _0x5d3a24[_0x0156('0x22')]()[_0x0156('0x21')](function(){_0xd4a0d5[_0x0156('0x14')](0xcc)[_0x0156('0x15')]();});}};}function handleEntityNotFound(_0x5ade66,_0x19fa93){return function(_0x281dbb){if(!_0x281dbb){_0x5ade66[_0x0156('0x13')](0x194);}return _0x281dbb;};}function handleError(_0x4b82c1,_0x27cca2){_0x27cca2=_0x27cca2||0x1f4;return function(_0x2b70d1){logger[_0x0156('0x23')](_0x2b70d1[_0x0156('0x24')]);if(_0x2b70d1['name']){delete _0x2b70d1[_0x0156('0x25')];}_0x4b82c1[_0x0156('0x14')](_0x27cca2)[_0x0156('0x26')](_0x2b70d1);};}exports[_0x0156('0x20')]=function(_0x53b818,_0x10636c){if(_0x53b818[_0x0156('0x27')]['id']){delete _0x53b818[_0x0156('0x27')]['id'];}return db[_0x0156('0x28')][_0x0156('0x29')]({'where':{'id':_0x53b818['params']['id']}})[_0x0156('0x21')](handleEntityNotFound(_0x10636c,null))[_0x0156('0x21')](saveUpdates(_0x53b818[_0x0156('0x27')],null))['then'](respondWithResult(_0x10636c,null))[_0x0156('0x2a')](handleError(_0x10636c,null));};exports[_0x0156('0x22')]=function(_0x1759b1,_0x41cac6){return db[_0x0156('0x28')][_0x0156('0x29')]({'where':{'id':_0x1759b1[_0x0156('0x2b')]['id']}})[_0x0156('0x21')](handleEntityNotFound(_0x41cac6,null))['then'](removeEntity(_0x41cac6,null))['catch'](handleError(_0x41cac6,null));};
\ No newline at end of file