Built motion from commit (unavailable).|2.5.30
[motion2.git] / server / api / condition / condition.controller.js
index 7effa13..e964566 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1666=['../../config/license/util','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','body','Condition','catch','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x1915b5,_0x488d52){var _0x3cfc87=function(_0x16fc03){while(--_0x16fc03){_0x1915b5['push'](_0x1915b5['shift']());}};_0x3cfc87(++_0x488d52);}(_0x1666,0x75));var _0x6166=function(_0x5060cc,_0x187b63){_0x5060cc=_0x5060cc-0x0;var _0x5da8e4=_0x1666[_0x5060cc];return _0x5da8e4;};'use strict';var emlformat=require(_0x6166('0x0'));var rimraf=require(_0x6166('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6166('0x2'));var rp=require(_0x6166('0x3'));var moment=require(_0x6166('0x4'));var BPromise=require(_0x6166('0x5'));var Mustache=require(_0x6166('0x6'));var util=require(_0x6166('0x7'));var path=require(_0x6166('0x8'));var sox=require(_0x6166('0x9'));var csv=require('to-csv');var ejs=require(_0x6166('0xa'));var fs=require('fs');var fs_extra=require(_0x6166('0xb'));var _=require(_0x6166('0xc'));var squel=require(_0x6166('0xd'));var crypto=require(_0x6166('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6166('0xf'));var Papa=require('papaparse');var Redis=require(_0x6166('0x10'));var authService=require(_0x6166('0x11'));var qs=require(_0x6166('0x12'));var as=require(_0x6166('0x13'));var hardwareService=require(_0x6166('0x14'));var logger=require(_0x6166('0x15'))(_0x6166('0x16'));var utils=require('../../config/utils');var config=require(_0x6166('0x17'));var licenseUtil=require(_0x6166('0x18'));var db=require(_0x6166('0x19'))['db'];function respondWithStatusCode(_0x5b2335,_0x320728){_0x320728=_0x320728||0xcc;return function(_0x2ce997){if(_0x2ce997){return _0x5b2335[_0x6166('0x1a')](_0x320728);}return _0x5b2335[_0x6166('0x1b')](_0x320728)['end']();};}function respondWithResult(_0x1316f2,_0x33789f){_0x33789f=_0x33789f||0xc8;return function(_0x42abca){if(_0x42abca){return _0x1316f2[_0x6166('0x1b')](_0x33789f)[_0x6166('0x1c')](_0x42abca);}};}function respondWithFilteredResult(_0x147874,_0x56520c){return function(_0x3d2f83){if(_0x3d2f83){var _0x12f0a5=_0x3d2f83[_0x6166('0x1d')],_0x3000de=_0x56520c[_0x6166('0x1e')],_0x4eff5c=_0x56520c['offset']+_0x56520c[_0x6166('0x1f')],_0x24bdf3;if(_0x4eff5c>=_0x12f0a5){_0x4eff5c=_0x12f0a5;_0x24bdf3=0xc8;}else{_0x24bdf3=0xce;}_0x147874[_0x6166('0x1b')](_0x24bdf3);return _0x147874[_0x6166('0x20')](_0x6166('0x21'),_0x3000de+'-'+_0x4eff5c+'/'+_0x12f0a5)[_0x6166('0x1c')](_0x3d2f83);}return null;};}function patchUpdates(_0x553701){return function(_0x1c823b){try{jsonpatch[_0x6166('0x22')](_0x1c823b,_0x553701,!![]);}catch(_0x37cfe6){return BPromise[_0x6166('0x23')](_0x37cfe6);}return _0x1c823b[_0x6166('0x24')]();};}function saveUpdates(_0x28d90c,_0x2411de){return function(_0x122552){if(_0x122552){return _0x122552[_0x6166('0x25')](_0x28d90c)[_0x6166('0x26')](function(_0x30d6e5){return _0x30d6e5;});}return null;};}function removeEntity(_0x49c474,_0x1646ff){return function(_0x438ed3){if(_0x438ed3){return _0x438ed3[_0x6166('0x27')]()[_0x6166('0x26')](function(){_0x49c474[_0x6166('0x1b')](0xcc)[_0x6166('0x28')]();});}};}function handleEntityNotFound(_0x3ffd46,_0x26d926){return function(_0x57b6b5){if(!_0x57b6b5){_0x3ffd46[_0x6166('0x1a')](0x194);}return _0x57b6b5;};}function handleError(_0x5a2e7b,_0x1a1290){_0x1a1290=_0x1a1290||0x1f4;return function(_0x10a23e){logger['error'](_0x10a23e[_0x6166('0x29')]);if(_0x10a23e[_0x6166('0x2a')]){delete _0x10a23e[_0x6166('0x2a')];}_0x5a2e7b[_0x6166('0x1b')](_0x1a1290)['send'](_0x10a23e);};}exports[_0x6166('0x25')]=function(_0xcb8172,_0x47176f){if(_0xcb8172[_0x6166('0x2b')]['id']){delete _0xcb8172[_0x6166('0x2b')]['id'];}return db[_0x6166('0x2c')]['find']({'where':{'id':_0xcb8172['params']['id']}})[_0x6166('0x26')](handleEntityNotFound(_0x47176f,null))[_0x6166('0x26')](saveUpdates(_0xcb8172[_0x6166('0x2b')],null))[_0x6166('0x26')](respondWithResult(_0x47176f,null))[_0x6166('0x2d')](handleError(_0x47176f,null));};exports[_0x6166('0x27')]=function(_0x31c324,_0x57bd9e){return db['Condition'][_0x6166('0x2e')]({'where':{'id':_0x31c324['params']['id']}})[_0x6166('0x26')](handleEntityNotFound(_0x57bd9e,null))[_0x6166('0x26')](removeEntity(_0x57bd9e,null))[_0x6166('0x2d')](handleError(_0x57bd9e,null));};
\ No newline at end of file
+var _0x1015=['set','Content-Range','apply','reject','save','update','then','destroy','name','send','body','Condition','find','params','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x362d16,_0x31c1a2){var _0x5596de=function(_0x3e588b){while(--_0x3e588b){_0x362d16['push'](_0x362d16['shift']());}};_0x5596de(++_0x31c1a2);}(_0x1015,0xff));var _0x5101=function(_0x1b4fb2,_0x255702){_0x1b4fb2=_0x1b4fb2-0x0;var _0x235b37=_0x1015[_0x1b4fb2];return _0x235b37;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5101('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5101('0x1'));var rp=require(_0x5101('0x2'));var moment=require(_0x5101('0x3'));var BPromise=require(_0x5101('0x4'));var Mustache=require('mustache');var util=require(_0x5101('0x5'));var path=require(_0x5101('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5101('0x7'));var fs=require('fs');var fs_extra=require(_0x5101('0x8'));var _=require(_0x5101('0x9'));var squel=require(_0x5101('0xa'));var crypto=require(_0x5101('0xb'));var jsforce=require(_0x5101('0xc'));var deskjs=require(_0x5101('0xd'));var toCsv=require(_0x5101('0xe'));var querystring=require(_0x5101('0xf'));var Papa=require('papaparse');var Redis=require(_0x5101('0x10'));var authService=require(_0x5101('0x11'));var qs=require(_0x5101('0x12'));var as=require(_0x5101('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5101('0x14'))('api');var utils=require(_0x5101('0x15'));var config=require(_0x5101('0x16'));var licenseUtil=require(_0x5101('0x17'));var db=require(_0x5101('0x18'))['db'];function respondWithStatusCode(_0x4c300b,_0x117733){_0x117733=_0x117733||0xcc;return function(_0x2771e1){if(_0x2771e1){return _0x4c300b[_0x5101('0x19')](_0x117733);}return _0x4c300b[_0x5101('0x1a')](_0x117733)[_0x5101('0x1b')]();};}function respondWithResult(_0x24270c,_0x2c9971){_0x2c9971=_0x2c9971||0xc8;return function(_0x37ab82){if(_0x37ab82){return _0x24270c[_0x5101('0x1a')](_0x2c9971)[_0x5101('0x1c')](_0x37ab82);}};}function respondWithFilteredResult(_0x2e6d7c,_0x5a1414){return function(_0xd9b999){if(_0xd9b999){var _0x548298=typeof _0x5a1414[_0x5101('0x1d')]===_0x5101('0x1e')&&typeof _0x5a1414['limit']===_0x5101('0x1e');var _0x3ac88e=_0xd9b999['count'];var _0x40422f=_0x548298?0x0:_0x5a1414[_0x5101('0x1d')];var _0x45949e=_0x548298?_0xd9b999[_0x5101('0x1f')]:_0x5a1414[_0x5101('0x1d')]+_0x5a1414[_0x5101('0x20')];var _0x4e0a15;if(_0x45949e>=_0x3ac88e){_0x45949e=_0x3ac88e;_0x4e0a15=0xc8;}else{_0x4e0a15=0xce;}_0x2e6d7c[_0x5101('0x1a')](_0x4e0a15);return _0x2e6d7c[_0x5101('0x21')](_0x5101('0x22'),_0x40422f+'-'+_0x45949e+'/'+_0x3ac88e)[_0x5101('0x1c')](_0xd9b999);}return null;};}function patchUpdates(_0x13d726){return function(_0x5e11ec){try{jsonpatch[_0x5101('0x23')](_0x5e11ec,_0x13d726,!![]);}catch(_0x3b336f){return BPromise[_0x5101('0x24')](_0x3b336f);}return _0x5e11ec[_0x5101('0x25')]();};}function saveUpdates(_0x2c5954,_0x210937){return function(_0x5e4761){if(_0x5e4761){return _0x5e4761[_0x5101('0x26')](_0x2c5954)[_0x5101('0x27')](function(_0x4220f2){return _0x4220f2;});}return null;};}function removeEntity(_0x3da793,_0x1e74f2){return function(_0x2fbcc7){if(_0x2fbcc7){return _0x2fbcc7[_0x5101('0x28')]()['then'](function(){_0x3da793[_0x5101('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1066b3,_0x2e520e){return function(_0x1ecc48){if(!_0x1ecc48){_0x1066b3[_0x5101('0x19')](0x194);}return _0x1ecc48;};}function handleError(_0x2f4253,_0x59b2b1){_0x59b2b1=_0x59b2b1||0x1f4;return function(_0x2f54d1){logger['error'](_0x2f54d1['stack']);if(_0x2f54d1[_0x5101('0x29')]){delete _0x2f54d1['name'];}_0x2f4253['status'](_0x59b2b1)[_0x5101('0x2a')](_0x2f54d1);};}exports['update']=function(_0x3e48a6,_0x3800a3){if(_0x3e48a6[_0x5101('0x2b')]['id']){delete _0x3e48a6[_0x5101('0x2b')]['id'];}return db[_0x5101('0x2c')][_0x5101('0x2d')]({'where':{'id':_0x3e48a6[_0x5101('0x2e')]['id']}})['then'](handleEntityNotFound(_0x3800a3,null))[_0x5101('0x27')](saveUpdates(_0x3e48a6[_0x5101('0x2b')],null))[_0x5101('0x27')](respondWithResult(_0x3800a3,null))['catch'](handleError(_0x3800a3,null));};exports[_0x5101('0x28')]=function(_0x17082f,_0x202ff4){return db['Condition'][_0x5101('0x2d')]({'where':{'id':_0x17082f['params']['id']}})[_0x5101('0x27')](handleEntityNotFound(_0x202ff4,null))[_0x5101('0x27')](removeEntity(_0x202ff4,null))[_0x5101('0x2f')](handleError(_0x202ff4,null));};
\ No newline at end of file