Built motion from commit (unavailable).|2.5.29
[motion2.git] / server / api / condition / condition.controller.js
index 764ebd0..646cdc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c6c=['save','destroy','error','stack','name','send','update','body','Condition','find','then','params','catch','html-pdf','eml-format','zip-dir','request-promise','mustache','util','path','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','set','Content-Range','apply','reject'];(function(_0x1548a0,_0x4bd793){var _0x27d824=function(_0x56e0bf){while(--_0x56e0bf){_0x1548a0['push'](_0x1548a0['shift']());}};_0x27d824(++_0x4bd793);}(_0x8c6c,0x133));var _0xc8c6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8c6c[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0xc8c6('0x0'));var emlformat=require(_0xc8c6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc8c6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc8c6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc8c6('0x4'));var util=require(_0xc8c6('0x5'));var path=require(_0xc8c6('0x6'));var sox=require('sox');var csv=require(_0xc8c6('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xc8c6('0x8'));var crypto=require('crypto');var jsforce=require(_0xc8c6('0x9'));var deskjs=require(_0xc8c6('0xa'));var toCsv=require(_0xc8c6('0x7'));var querystring=require(_0xc8c6('0xb'));var Papa=require('papaparse');var Redis=require(_0xc8c6('0xc'));var authService=require(_0xc8c6('0xd'));var qs=require(_0xc8c6('0xe'));var as=require(_0xc8c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc8c6('0x10'))(_0xc8c6('0x11'));var utils=require(_0xc8c6('0x12'));var config=require(_0xc8c6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x116f8c,_0xd9c8f0){_0xd9c8f0=_0xd9c8f0||0xcc;return function(_0x523fc8){if(_0x523fc8){return _0x116f8c[_0xc8c6('0x14')](_0xd9c8f0);}return _0x116f8c[_0xc8c6('0x15')](_0xd9c8f0)[_0xc8c6('0x16')]();};}function respondWithResult(_0x4416f2,_0x95c5ec){_0x95c5ec=_0x95c5ec||0xc8;return function(_0x3b20d4){if(_0x3b20d4){return _0x4416f2[_0xc8c6('0x15')](_0x95c5ec)[_0xc8c6('0x17')](_0x3b20d4);}};}function respondWithFilteredResult(_0xe53ca3,_0x175f57){return function(_0x12a8a1){if(_0x12a8a1){var _0x280323=_0x12a8a1['count'],_0xab935f=_0x175f57[_0xc8c6('0x18')],_0x10aac6=_0x175f57[_0xc8c6('0x18')]+_0x175f57['limit'],_0x2c4cb4;if(_0x10aac6>=_0x280323){_0x10aac6=_0x280323;_0x2c4cb4=0xc8;}else{_0x2c4cb4=0xce;}_0xe53ca3[_0xc8c6('0x15')](_0x2c4cb4);return _0xe53ca3[_0xc8c6('0x19')](_0xc8c6('0x1a'),_0xab935f+'-'+_0x10aac6+'/'+_0x280323)[_0xc8c6('0x17')](_0x12a8a1);}return null;};}function patchUpdates(_0x1fffbb){return function(_0x96dfa6){try{jsonpatch[_0xc8c6('0x1b')](_0x96dfa6,_0x1fffbb,!![]);}catch(_0x1a4982){return BPromise[_0xc8c6('0x1c')](_0x1a4982);}return _0x96dfa6[_0xc8c6('0x1d')]();};}function saveUpdates(_0x30b380,_0x2f8ada){return function(_0x3f259a){if(_0x3f259a){return _0x3f259a['update'](_0x30b380)['then'](function(_0x1020aa){return _0x1020aa;});}return null;};}function removeEntity(_0x56af2b,_0x4e0669){return function(_0x4f7c03){if(_0x4f7c03){return _0x4f7c03[_0xc8c6('0x1e')]()['then'](function(){_0x56af2b[_0xc8c6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x308f35,_0x13e3b7){return function(_0x4b6948){if(!_0x4b6948){_0x308f35[_0xc8c6('0x14')](0x194);}return _0x4b6948;};}function handleError(_0x2b4a40,_0x5c37fa){_0x5c37fa=_0x5c37fa||0x1f4;return function(_0x2effec){logger[_0xc8c6('0x1f')](_0x2effec[_0xc8c6('0x20')]);if(_0x2effec[_0xc8c6('0x21')]){delete _0x2effec[_0xc8c6('0x21')];}_0x2b4a40[_0xc8c6('0x15')](_0x5c37fa)[_0xc8c6('0x22')](_0x2effec);};}exports[_0xc8c6('0x23')]=function(_0x5d8595,_0x459f8b){if(_0x5d8595[_0xc8c6('0x24')]['id']){delete _0x5d8595[_0xc8c6('0x24')]['id'];}return db[_0xc8c6('0x25')][_0xc8c6('0x26')]({'where':{'id':_0x5d8595['params']['id']}})[_0xc8c6('0x27')](handleEntityNotFound(_0x459f8b,null))[_0xc8c6('0x27')](saveUpdates(_0x5d8595['body'],null))[_0xc8c6('0x27')](respondWithResult(_0x459f8b,null))['catch'](handleError(_0x459f8b,null));};exports[_0xc8c6('0x1e')]=function(_0x5a63cc,_0x18e507){return db[_0xc8c6('0x25')][_0xc8c6('0x26')]({'where':{'id':_0x5a63cc[_0xc8c6('0x28')]['id']}})[_0xc8c6('0x27')](handleEntityNotFound(_0x18e507,null))[_0xc8c6('0x27')](removeEntity(_0x18e507,null))[_0xc8c6('0x29')](handleError(_0x18e507,null));};
\ No newline at end of file
+var _0xac1d=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','body','find','params','catch','Condition','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis'];(function(_0x39fff0,_0x259d98){var _0x547163=function(_0x267edf){while(--_0x267edf){_0x39fff0['push'](_0x39fff0['shift']());}};_0x547163(++_0x259d98);}(_0xac1d,0xab));var _0xdac1=function(_0x4cc46d,_0x1c3fbf){_0x4cc46d=_0x4cc46d-0x0;var _0x249eef=_0xac1d[_0x4cc46d];return _0x249eef;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdac1('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdac1('0x1'));var moment=require(_0xdac1('0x2'));var BPromise=require(_0xdac1('0x3'));var Mustache=require(_0xdac1('0x4'));var util=require(_0xdac1('0x5'));var path=require(_0xdac1('0x6'));var sox=require(_0xdac1('0x7'));var csv=require(_0xdac1('0x8'));var ejs=require(_0xdac1('0x9'));var fs=require('fs');var fs_extra=require(_0xdac1('0xa'));var _=require(_0xdac1('0xb'));var squel=require(_0xdac1('0xc'));var crypto=require('crypto');var jsforce=require(_0xdac1('0xd'));var deskjs=require(_0xdac1('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdac1('0xf'));var Redis=require(_0xdac1('0x10'));var authService=require(_0xdac1('0x11'));var qs=require(_0xdac1('0x12'));var as=require(_0xdac1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xdac1('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xdac1('0x15'));var db=require(_0xdac1('0x16'))['db'];function respondWithStatusCode(_0x2f0f6e,_0x327dd1){_0x327dd1=_0x327dd1||0xcc;return function(_0x401597){if(_0x401597){return _0x2f0f6e[_0xdac1('0x17')](_0x327dd1);}return _0x2f0f6e[_0xdac1('0x18')](_0x327dd1)[_0xdac1('0x19')]();};}function respondWithResult(_0x180e09,_0x361055){_0x361055=_0x361055||0xc8;return function(_0x35f61c){if(_0x35f61c){return _0x180e09['status'](_0x361055)[_0xdac1('0x1a')](_0x35f61c);}};}function respondWithFilteredResult(_0x3eacb6,_0x39e630){return function(_0x47ed51){if(_0x47ed51){var _0x27907b=typeof _0x39e630[_0xdac1('0x1b')]===_0xdac1('0x1c')&&typeof _0x39e630[_0xdac1('0x1d')]==='undefined';var _0x595c48=_0x47ed51['count'];var _0x182031=_0x27907b?0x0:_0x39e630[_0xdac1('0x1b')];var _0x11a6f7=_0x27907b?_0x47ed51[_0xdac1('0x1e')]:_0x39e630[_0xdac1('0x1b')]+_0x39e630[_0xdac1('0x1d')];var _0x1565f7;if(_0x11a6f7>=_0x595c48){_0x11a6f7=_0x595c48;_0x1565f7=0xc8;}else{_0x1565f7=0xce;}_0x3eacb6[_0xdac1('0x18')](_0x1565f7);return _0x3eacb6['set'](_0xdac1('0x1f'),_0x182031+'-'+_0x11a6f7+'/'+_0x595c48)[_0xdac1('0x1a')](_0x47ed51);}return null;};}function patchUpdates(_0x37c4d7){return function(_0xb78070){try{jsonpatch[_0xdac1('0x20')](_0xb78070,_0x37c4d7,!![]);}catch(_0x49fc47){return BPromise[_0xdac1('0x21')](_0x49fc47);}return _0xb78070[_0xdac1('0x22')]();};}function saveUpdates(_0x3f9edf,_0xb9f45c){return function(_0x2b2b6b){if(_0x2b2b6b){return _0x2b2b6b[_0xdac1('0x23')](_0x3f9edf)[_0xdac1('0x24')](function(_0x302f9e){return _0x302f9e;});}return null;};}function removeEntity(_0x416912,_0x2e1064){return function(_0xe308d1){if(_0xe308d1){return _0xe308d1[_0xdac1('0x25')]()[_0xdac1('0x24')](function(){_0x416912[_0xdac1('0x18')](0xcc)[_0xdac1('0x19')]();});}};}function handleEntityNotFound(_0x4f2e09,_0x23744b){return function(_0x57c2b8){if(!_0x57c2b8){_0x4f2e09[_0xdac1('0x17')](0x194);}return _0x57c2b8;};}function handleError(_0x8cb67c,_0x2c0c58){_0x2c0c58=_0x2c0c58||0x1f4;return function(_0x49bb2e){logger[_0xdac1('0x26')](_0x49bb2e[_0xdac1('0x27')]);if(_0x49bb2e[_0xdac1('0x28')]){delete _0x49bb2e[_0xdac1('0x28')];}_0x8cb67c[_0xdac1('0x18')](_0x2c0c58)[_0xdac1('0x29')](_0x49bb2e);};}exports[_0xdac1('0x23')]=function(_0xc3b864,_0x3082bb){if(_0xc3b864[_0xdac1('0x2a')]['id']){delete _0xc3b864[_0xdac1('0x2a')]['id'];}return db['Condition'][_0xdac1('0x2b')]({'where':{'id':_0xc3b864[_0xdac1('0x2c')]['id']}})[_0xdac1('0x24')](handleEntityNotFound(_0x3082bb,null))[_0xdac1('0x24')](saveUpdates(_0xc3b864[_0xdac1('0x2a')],null))[_0xdac1('0x24')](respondWithResult(_0x3082bb,null))[_0xdac1('0x2d')](handleError(_0x3082bb,null));};exports[_0xdac1('0x25')]=function(_0x2f7cc1,_0x240b26){return db[_0xdac1('0x2e')][_0xdac1('0x2b')]({'where':{'id':_0x2f7cc1[_0xdac1('0x2c')]['id']}})[_0xdac1('0x24')](handleEntityNotFound(_0x240b26,null))[_0xdac1('0x24')](removeEntity(_0x240b26,null))[_0xdac1('0x2d')](handleError(_0x240b26,null));};
\ No newline at end of file