Built motion from commit (unavailable).|2.6.0
[motion2.git] / server / api / condition / condition.controller.js
index 0ed0a7b..385106a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf44=['sendStatus','error','stack','name','send','merge','body','contact','message','agent','account','Condition','find','params','destroy','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','then'];(function(_0x89a001,_0x3a9a8c){var _0x5f3ec2=function(_0x3e849b){while(--_0x3e849b){_0x89a001['push'](_0x89a001['shift']());}};_0x5f3ec2(++_0x3a9a8c);}(_0xbf44,0xa0));var _0x4bf4=function(_0x29ee0a,_0x2e019b){_0x29ee0a=_0x29ee0a-0x0;var _0x54efbf=_0xbf44[_0x29ee0a];return _0x54efbf;};'use strict';var emlformat=require(_0x4bf4('0x0'));var rimraf=require(_0x4bf4('0x1'));var zipdir=require(_0x4bf4('0x2'));var jsonpatch=require(_0x4bf4('0x3'));var rp=require('request-promise');var moment=require(_0x4bf4('0x4'));var BPromise=require(_0x4bf4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x4bf4('0x6'));var csv=require(_0x4bf4('0x7'));var ejs=require(_0x4bf4('0x8'));var fs=require('fs');var fs_extra=require(_0x4bf4('0x9'));var _=require(_0x4bf4('0xa'));var squel=require(_0x4bf4('0xb'));var crypto=require('crypto');var jsforce=require(_0x4bf4('0xc'));var deskjs=require(_0x4bf4('0xd'));var toCsv=require(_0x4bf4('0x7'));var querystring=require('querystring');var Papa=require(_0x4bf4('0xe'));var Redis=require(_0x4bf4('0xf'));var authService=require(_0x4bf4('0x10'));var qs=require(_0x4bf4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4bf4('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4bf4('0x13'));var db=require(_0x4bf4('0x14'))['db'];function respondWithStatusCode(_0x5db4a3,_0x1fbaf7){_0x1fbaf7=_0x1fbaf7||0xcc;return function(_0xe283ae){if(_0xe283ae){return _0x5db4a3['sendStatus'](_0x1fbaf7);}return _0x5db4a3[_0x4bf4('0x15')](_0x1fbaf7)[_0x4bf4('0x16')]();};}function respondWithResult(_0x1f94a2,_0x12bf07){_0x12bf07=_0x12bf07||0xc8;return function(_0x8419ff){if(_0x8419ff){return _0x1f94a2[_0x4bf4('0x15')](_0x12bf07)['json'](_0x8419ff);}};}function respondWithFilteredResult(_0x27f8a4,_0x3404fa){return function(_0x3d7d6a){if(_0x3d7d6a){var _0x4e9c31=typeof _0x3404fa[_0x4bf4('0x17')]===_0x4bf4('0x18')&&typeof _0x3404fa[_0x4bf4('0x19')]===_0x4bf4('0x18');var _0x4f6319=_0x3d7d6a['count'];var _0x1cc14d=_0x4e9c31?0x0:_0x3404fa[_0x4bf4('0x17')];var _0x233e43=_0x4e9c31?_0x3d7d6a[_0x4bf4('0x1a')]:_0x3404fa[_0x4bf4('0x17')]+_0x3404fa['limit'];var _0x1c5ed8;if(_0x233e43>=_0x4f6319){_0x233e43=_0x4f6319;_0x1c5ed8=0xc8;}else{_0x1c5ed8=0xce;}_0x27f8a4[_0x4bf4('0x15')](_0x1c5ed8);return _0x27f8a4['set'](_0x4bf4('0x1b'),_0x1cc14d+'-'+_0x233e43+'/'+_0x4f6319)[_0x4bf4('0x1c')](_0x3d7d6a);}return null;};}function patchUpdates(_0xc39df2){return function(_0x2df888){try{jsonpatch[_0x4bf4('0x1d')](_0x2df888,_0xc39df2,!![]);}catch(_0x18bcb4){return BPromise['reject'](_0x18bcb4);}return _0x2df888[_0x4bf4('0x1e')]();};}function saveUpdates(_0x36972d,_0x593718){return function(_0x40b3e8){if(_0x40b3e8){return _0x40b3e8['update'](_0x36972d)[_0x4bf4('0x1f')](function(_0x4f0b8d){return _0x4f0b8d;});}return null;};}function removeEntity(_0x4aa129,_0x3d0cee){return function(_0x86d77f){if(_0x86d77f){return _0x86d77f['destroy']()[_0x4bf4('0x1f')](function(){_0x4aa129['status'](0xcc)[_0x4bf4('0x16')]();});}};}function handleEntityNotFound(_0x51fa77,_0x1a9bb7){return function(_0x9d0fb1){if(!_0x9d0fb1){_0x51fa77[_0x4bf4('0x20')](0x194);}return _0x9d0fb1;};}function handleError(_0x2ffc0e,_0x403670){_0x403670=_0x403670||0x1f4;return function(_0x13b45e){logger[_0x4bf4('0x21')](_0x13b45e[_0x4bf4('0x22')]);if(_0x13b45e[_0x4bf4('0x23')]){delete _0x13b45e[_0x4bf4('0x23')];}_0x2ffc0e[_0x4bf4('0x15')](_0x403670)[_0x4bf4('0x24')](_0x13b45e);};}function getMustacheRender(_0x48a2c0,_0x8584b5){return Mustache['render'](_0x48a2c0,_[_0x4bf4('0x25')](_0x8584b5[_0x4bf4('0x26')],{'contact':_0x8584b5[_0x4bf4('0x27')],'message':_0x8584b5[_0x4bf4('0x28')],'agent':_0x8584b5[_0x4bf4('0x29')],'interaction':_0x8584b5['interaction'],'account':_0x8584b5[_0x4bf4('0x2a')]}))||'';}exports['update']=function(_0x1d31a5,_0x2508ef){if(_0x1d31a5[_0x4bf4('0x26')]['id']){delete _0x1d31a5[_0x4bf4('0x26')]['id'];}return db[_0x4bf4('0x2b')][_0x4bf4('0x2c')]({'where':{'id':_0x1d31a5[_0x4bf4('0x2d')]['id']}})[_0x4bf4('0x1f')](handleEntityNotFound(_0x2508ef,null))[_0x4bf4('0x1f')](saveUpdates(_0x1d31a5[_0x4bf4('0x26')],null))[_0x4bf4('0x1f')](respondWithResult(_0x2508ef,null))['catch'](handleError(_0x2508ef,null));};exports[_0x4bf4('0x2e')]=function(_0x33aa1f,_0x1bdc42){return db[_0x4bf4('0x2b')][_0x4bf4('0x2c')]({'where':{'id':_0x33aa1f[_0x4bf4('0x2d')]['id']}})['then'](handleEntityNotFound(_0x1bdc42,null))[_0x4bf4('0x1f')](removeEntity(_0x1bdc42,null))[_0x4bf4('0x2f')](handleError(_0x1bdc42,null));};
\ No newline at end of file
+var _0x0c02=['params','catch','Condition','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','body','find'];(function(_0x58542e,_0x17c51f){var _0x5d5df8=function(_0x452e8d){while(--_0x452e8d){_0x58542e['push'](_0x58542e['shift']());}};_0x5d5df8(++_0x17c51f);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x20c0('0x0'));var zipdir=require(_0x20c0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x20c0('0x2'));var moment=require(_0x20c0('0x3'));var BPromise=require(_0x20c0('0x4'));var Mustache=require(_0x20c0('0x5'));var util=require(_0x20c0('0x6'));var path=require(_0x20c0('0x7'));var sox=require(_0x20c0('0x8'));var csv=require(_0x20c0('0x9'));var ejs=require(_0x20c0('0xa'));var fs=require('fs');var fs_extra=require(_0x20c0('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x20c0('0xc'));var toCsv=require(_0x20c0('0x9'));var querystring=require(_0x20c0('0xd'));var Papa=require(_0x20c0('0xe'));var Redis=require(_0x20c0('0xf'));var authService=require(_0x20c0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x20c0('0x11'));var config=require(_0x20c0('0x12'));var licenseUtil=require(_0x20c0('0x13'));var db=require(_0x20c0('0x14'))['db'];function respondWithStatusCode(_0x4ed79e,_0x56fa09){_0x56fa09=_0x56fa09||0xcc;return function(_0x55854e){if(_0x55854e){return _0x4ed79e['sendStatus'](_0x56fa09);}return _0x4ed79e[_0x20c0('0x15')](_0x56fa09)[_0x20c0('0x16')]();};}function respondWithResult(_0x42161f,_0x3b2bba){_0x3b2bba=_0x3b2bba||0xc8;return function(_0x37f4e0){if(_0x37f4e0){return _0x42161f[_0x20c0('0x15')](_0x3b2bba)[_0x20c0('0x17')](_0x37f4e0);}};}function respondWithFilteredResult(_0x105839,_0x280aff){return function(_0x5a5e25){if(_0x5a5e25){var _0xd80b64=typeof _0x280aff[_0x20c0('0x18')]===_0x20c0('0x19')&&typeof _0x280aff[_0x20c0('0x1a')]===_0x20c0('0x19');var _0xeff5b9=_0x5a5e25['count'];var _0x55de3b=_0xd80b64?0x0:_0x280aff['offset'];var _0x10a921=_0xd80b64?_0x5a5e25[_0x20c0('0x1b')]:_0x280aff[_0x20c0('0x18')]+_0x280aff[_0x20c0('0x1a')];var _0x5b3725;if(_0x10a921>=_0xeff5b9){_0x10a921=_0xeff5b9;_0x5b3725=0xc8;}else{_0x5b3725=0xce;}_0x105839[_0x20c0('0x15')](_0x5b3725);return _0x105839[_0x20c0('0x1c')](_0x20c0('0x1d'),_0x55de3b+'-'+_0x10a921+'/'+_0xeff5b9)['json'](_0x5a5e25);}return null;};}function patchUpdates(_0x54bd1e){return function(_0x343db7){try{jsonpatch[_0x20c0('0x1e')](_0x343db7,_0x54bd1e,!![]);}catch(_0x1407d3){return BPromise[_0x20c0('0x1f')](_0x1407d3);}return _0x343db7[_0x20c0('0x20')]();};}function saveUpdates(_0x53d8e8,_0x2213f5){return function(_0x28959a){if(_0x28959a){return _0x28959a[_0x20c0('0x21')](_0x53d8e8)[_0x20c0('0x22')](function(_0x52b8b8){return _0x52b8b8;});}return null;};}function removeEntity(_0xfea1eb,_0x3e545c){return function(_0x2447e6){if(_0x2447e6){return _0x2447e6[_0x20c0('0x23')]()[_0x20c0('0x22')](function(){_0xfea1eb[_0x20c0('0x15')](0xcc)[_0x20c0('0x16')]();});}};}function handleEntityNotFound(_0x55b129,_0x45c08c){return function(_0x595d94){if(!_0x595d94){_0x55b129[_0x20c0('0x24')](0x194);}return _0x595d94;};}function handleError(_0x31565b,_0x11da5a){_0x11da5a=_0x11da5a||0x1f4;return function(_0x14dac3){logger['error'](_0x14dac3['stack']);if(_0x14dac3[_0x20c0('0x25')]){delete _0x14dac3[_0x20c0('0x25')];}_0x31565b[_0x20c0('0x15')](_0x11da5a)['send'](_0x14dac3);};}exports[_0x20c0('0x21')]=function(_0x25592b,_0x1bcfaf){if(_0x25592b[_0x20c0('0x26')]['id']){delete _0x25592b['body']['id'];}return db['Condition'][_0x20c0('0x27')]({'where':{'id':_0x25592b[_0x20c0('0x28')]['id']}})[_0x20c0('0x22')](handleEntityNotFound(_0x1bcfaf,null))[_0x20c0('0x22')](saveUpdates(_0x25592b[_0x20c0('0x26')],null))[_0x20c0('0x22')](respondWithResult(_0x1bcfaf,null))[_0x20c0('0x29')](handleError(_0x1bcfaf,null));};exports[_0x20c0('0x23')]=function(_0x3ac0a4,_0x191ad8){return db[_0x20c0('0x2a')][_0x20c0('0x27')]({'where':{'id':_0x3ac0a4[_0x20c0('0x28')]['id']}})[_0x20c0('0x22')](handleEntityNotFound(_0x191ad8,null))['then'](removeEntity(_0x191ad8,null))[_0x20c0('0x29')](handleError(_0x191ad8,null));};
\ No newline at end of file