Built motion from commit eddce310.|2.6.12
[motion2.git] / server / api / chatApplication / chatApplication.controller.js
index 0b8eb79..529ac8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e0d=['sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','show','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','ChatApplication','find','catch','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x27371f,_0x94445f){var _0xa8587c=function(_0x490c25){while(--_0x490c25){_0x27371f['push'](_0x27371f['shift']());}};_0xa8587c(++_0x94445f);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x10c80d,_0x58e4bf){_0x10c80d=_0x10c80d-0x0;var _0x47659e=_0x9e0d[_0x10c80d];return _0x47659e;};'use strict';var emlformat=require(_0xd9e0('0x0'));var rimraf=require(_0xd9e0('0x1'));var zipdir=require(_0xd9e0('0x2'));var jsonpatch=require(_0xd9e0('0x3'));var rp=require('request-promise');var moment=require(_0xd9e0('0x4'));var BPromise=require(_0xd9e0('0x5'));var Mustache=require(_0xd9e0('0x6'));var util=require(_0xd9e0('0x7'));var path=require(_0xd9e0('0x8'));var sox=require(_0xd9e0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd9e0('0xa'));var _=require(_0xd9e0('0xb'));var squel=require(_0xd9e0('0xc'));var crypto=require(_0xd9e0('0xd'));var jsforce=require(_0xd9e0('0xe'));var deskjs=require(_0xd9e0('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd9e0('0x10'));var Papa=require(_0xd9e0('0x11'));var Redis=require(_0xd9e0('0x12'));var authService=require(_0xd9e0('0x13'));var qs=require(_0xd9e0('0x14'));var as=require(_0xd9e0('0x15'));var hardwareService=require(_0xd9e0('0x16'));var logger=require('../../config/logger')(_0xd9e0('0x17'));var utils=require(_0xd9e0('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd9e0('0x19'));var db=require(_0xd9e0('0x1a'))['db'];function respondWithStatusCode(_0x418d84,_0x1fb454){_0x1fb454=_0x1fb454||0xcc;return function(_0x18fdf2){if(_0x18fdf2){return _0x418d84['sendStatus'](_0x1fb454);}return _0x418d84[_0xd9e0('0x1b')](_0x1fb454)['end']();};}function respondWithResult(_0x2f311c,_0x55c704){_0x55c704=_0x55c704||0xc8;return function(_0x24d361){if(_0x24d361){return _0x2f311c[_0xd9e0('0x1b')](_0x55c704)[_0xd9e0('0x1c')](_0x24d361);}};}function respondWithFilteredResult(_0x18301b,_0x3e4c5d){return function(_0x4da900){if(_0x4da900){var _0x58d44c=typeof _0x3e4c5d['offset']===_0xd9e0('0x1d')&&typeof _0x3e4c5d[_0xd9e0('0x1e')]===_0xd9e0('0x1d');var _0x1cdcb6=_0x4da900['count'];var _0x209c04=_0x58d44c?0x0:_0x3e4c5d['offset'];var _0x483b74=_0x58d44c?_0x4da900[_0xd9e0('0x1f')]:_0x3e4c5d[_0xd9e0('0x20')]+_0x3e4c5d['limit'];var _0x5ac8f5;if(_0x483b74>=_0x1cdcb6){_0x483b74=_0x1cdcb6;_0x5ac8f5=0xc8;}else{_0x5ac8f5=0xce;}_0x18301b[_0xd9e0('0x1b')](_0x5ac8f5);return _0x18301b[_0xd9e0('0x21')]('Content-Range',_0x209c04+'-'+_0x483b74+'/'+_0x1cdcb6)[_0xd9e0('0x1c')](_0x4da900);}return null;};}function patchUpdates(_0x4cc3c9){return function(_0xd3d455){try{jsonpatch[_0xd9e0('0x22')](_0xd3d455,_0x4cc3c9,!![]);}catch(_0x67f69f){return BPromise[_0xd9e0('0x23')](_0x67f69f);}return _0xd3d455[_0xd9e0('0x24')]();};}function saveUpdates(_0x5711a1,_0x19534a){return function(_0x333233){if(_0x333233){return _0x333233['update'](_0x5711a1)[_0xd9e0('0x25')](function(_0x124ca7){return _0x124ca7;});}return null;};}function removeEntity(_0x5d4549,_0x357bd9){return function(_0x5e17d4){if(_0x5e17d4){return _0x5e17d4[_0xd9e0('0x26')]()[_0xd9e0('0x25')](function(){_0x5d4549['status'](0xcc)[_0xd9e0('0x27')]();});}};}function handleEntityNotFound(_0x53cf67,_0x554aeb){return function(_0x50f57d){if(!_0x50f57d){_0x53cf67[_0xd9e0('0x28')](0x194);}return _0x50f57d;};}function handleError(_0x21c796,_0x7065c6){_0x7065c6=_0x7065c6||0x1f4;return function(_0x1c36df){logger[_0xd9e0('0x29')](_0x1c36df[_0xd9e0('0x2a')]);if(_0x1c36df[_0xd9e0('0x2b')]){delete _0x1c36df['name'];}_0x21c796[_0xd9e0('0x1b')](_0x7065c6)[_0xd9e0('0x2c')](_0x1c36df);};}exports[_0xd9e0('0x2d')]=function(_0x17a899,_0x2738e9){var _0x4f5367={'raw':!![],'where':{'id':_0x17a899['params']['id']}},_0x4b4f7d={};_0x4b4f7d[_0xd9e0('0x2e')]=_[_0xd9e0('0x2f')](db['ChatApplication'][_0xd9e0('0x30')]);_0x4b4f7d[_0xd9e0('0x31')]=_[_0xd9e0('0x2f')](_0x17a899[_0xd9e0('0x31')]);_0x4b4f7d[_0xd9e0('0x32')]=_[_0xd9e0('0x33')](_0x4b4f7d[_0xd9e0('0x2e')],_0x4b4f7d['query']);_0x4f5367[_0xd9e0('0x34')]=_[_0xd9e0('0x33')](_0x4b4f7d[_0xd9e0('0x2e')],qs[_0xd9e0('0x35')](_0x17a899[_0xd9e0('0x31')][_0xd9e0('0x35')]));_0x4f5367[_0xd9e0('0x34')]=_0x4f5367[_0xd9e0('0x34')][_0xd9e0('0x36')]?_0x4f5367[_0xd9e0('0x34')]:_0x4b4f7d[_0xd9e0('0x2e')];if(_0x17a899[_0xd9e0('0x31')]['includeAll']){_0x4f5367[_0xd9e0('0x37')]=[{'all':!![]}];}_0x4f5367=_[_0xd9e0('0x38')]({},_0x4f5367,_0x17a899[_0xd9e0('0x39')]);return db[_0xd9e0('0x3a')][_0xd9e0('0x3b')](_0x4f5367)['then'](handleEntityNotFound(_0x2738e9,null))[_0xd9e0('0x25')](respondWithResult(_0x2738e9,null))[_0xd9e0('0x3c')](handleError(_0x2738e9,null));};exports[_0xd9e0('0x3d')]=function(_0x23901a,_0x588f8c){if(_0x23901a[_0xd9e0('0x3e')]['id']){delete _0x23901a['body']['id'];}return db[_0xd9e0('0x3a')][_0xd9e0('0x3b')]({'where':{'id':_0x23901a[_0xd9e0('0x3f')]['id']}})[_0xd9e0('0x25')](handleEntityNotFound(_0x588f8c,null))[_0xd9e0('0x25')](saveUpdates(_0x23901a[_0xd9e0('0x3e')],null))[_0xd9e0('0x25')](respondWithResult(_0x588f8c,null))[_0xd9e0('0x3c')](handleError(_0x588f8c,null));};exports[_0xd9e0('0x26')]=function(_0x5065f7,_0x318679){return db[_0xd9e0('0x3a')][_0xd9e0('0x3b')]({'where':{'id':_0x5065f7[_0xd9e0('0x3f')]['id']}})['then'](handleEntityNotFound(_0x318679,null))[_0xd9e0('0x25')](removeEntity(_0x318679,null))[_0xd9e0('0x3c')](handleError(_0x318679,null));};
\ No newline at end of file
+var _0x38d0=['bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','error','stack','name','send','model','keys','query','filters','attributes','intersection','fields','length','includeAll','merge','options','ChatApplication','find','catch','update','body','params','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x4342f0,_0x3009c8){var _0x5ce9f0=function(_0x576eed){while(--_0x576eed){_0x4342f0['push'](_0x4342f0['shift']());}};_0x5ce9f0(++_0x3009c8);}(_0x38d0,0x123));var _0x038d=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x38d0[_0x17b6e3];return _0x3906f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x038d('0x0'));var zipdir=require(_0x038d('0x1'));var jsonpatch=require(_0x038d('0x2'));var rp=require('request-promise');var moment=require(_0x038d('0x3'));var BPromise=require(_0x038d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x038d('0x5'));var sox=require('sox');var csv=require(_0x038d('0x6'));var ejs=require(_0x038d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x038d('0x8'));var squel=require(_0x038d('0x9'));var crypto=require(_0x038d('0xa'));var jsforce=require(_0x038d('0xb'));var deskjs=require(_0x038d('0xc'));var toCsv=require(_0x038d('0x6'));var querystring=require(_0x038d('0xd'));var Papa=require(_0x038d('0xe'));var Redis=require(_0x038d('0xf'));var authService=require(_0x038d('0x10'));var qs=require(_0x038d('0x11'));var as=require(_0x038d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x038d('0x13'))(_0x038d('0x14'));var utils=require(_0x038d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x038d('0x16'));var db=require(_0x038d('0x17'))['db'];function respondWithStatusCode(_0x1be329,_0x225683){_0x225683=_0x225683||0xcc;return function(_0x12c34d){if(_0x12c34d){return _0x1be329[_0x038d('0x18')](_0x225683);}return _0x1be329[_0x038d('0x19')](_0x225683)[_0x038d('0x1a')]();};}function respondWithResult(_0x4311b8,_0x4e78d3){_0x4e78d3=_0x4e78d3||0xc8;return function(_0x5adcd5){if(_0x5adcd5){return _0x4311b8['status'](_0x4e78d3)[_0x038d('0x1b')](_0x5adcd5);}};}function respondWithFilteredResult(_0x3ab49a,_0x4c36ee){return function(_0x4b7bfb){if(_0x4b7bfb){var _0x4e4960=typeof _0x4c36ee['offset']===_0x038d('0x1c')&&typeof _0x4c36ee[_0x038d('0x1d')]===_0x038d('0x1c');var _0x2b5feb=_0x4b7bfb[_0x038d('0x1e')];var _0x42c17f=_0x4e4960?0x0:_0x4c36ee[_0x038d('0x1f')];var _0x40c307=_0x4e4960?_0x4b7bfb[_0x038d('0x1e')]:_0x4c36ee[_0x038d('0x1f')]+_0x4c36ee[_0x038d('0x1d')];var _0x21773e;if(_0x40c307>=_0x2b5feb){_0x40c307=_0x2b5feb;_0x21773e=0xc8;}else{_0x21773e=0xce;}_0x3ab49a[_0x038d('0x19')](_0x21773e);return _0x3ab49a[_0x038d('0x20')]('Content-Range',_0x42c17f+'-'+_0x40c307+'/'+_0x2b5feb)['json'](_0x4b7bfb);}return null;};}function patchUpdates(_0x42b6af){return function(_0x42ab21){try{jsonpatch[_0x038d('0x21')](_0x42ab21,_0x42b6af,!![]);}catch(_0x1a8efc){return BPromise[_0x038d('0x22')](_0x1a8efc);}return _0x42ab21[_0x038d('0x23')]();};}function saveUpdates(_0x40586e,_0x4eb93e){return function(_0x89c6f1){if(_0x89c6f1){return _0x89c6f1['update'](_0x40586e)[_0x038d('0x24')](function(_0x4eaaff){return _0x4eaaff;});}return null;};}function removeEntity(_0x5ea43b,_0x19e932){return function(_0x3611ff){if(_0x3611ff){return _0x3611ff[_0x038d('0x25')]()[_0x038d('0x24')](function(){_0x5ea43b[_0x038d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x107d51,_0x3e1286){return function(_0x1dc3f3){if(!_0x1dc3f3){_0x107d51['sendStatus'](0x194);}return _0x1dc3f3;};}function handleError(_0x593d4a,_0x525908){_0x525908=_0x525908||0x1f4;return function(_0x4379d9){logger[_0x038d('0x26')](_0x4379d9[_0x038d('0x27')]);if(_0x4379d9[_0x038d('0x28')]){delete _0x4379d9[_0x038d('0x28')];}_0x593d4a[_0x038d('0x19')](_0x525908)[_0x038d('0x29')](_0x4379d9);};}exports['show']=function(_0x5044db,_0x2c0b46){var _0x1f7cdb={'raw':!![],'where':{'id':_0x5044db['params']['id']}},_0x33fa99={};_0x33fa99[_0x038d('0x2a')]=_[_0x038d('0x2b')](db['ChatApplication']['rawAttributes']);_0x33fa99[_0x038d('0x2c')]=_[_0x038d('0x2b')](_0x5044db[_0x038d('0x2c')]);_0x33fa99[_0x038d('0x2d')]=_['intersection'](_0x33fa99[_0x038d('0x2a')],_0x33fa99['query']);_0x1f7cdb[_0x038d('0x2e')]=_[_0x038d('0x2f')](_0x33fa99['model'],qs[_0x038d('0x30')](_0x5044db[_0x038d('0x2c')][_0x038d('0x30')]));_0x1f7cdb['attributes']=_0x1f7cdb[_0x038d('0x2e')][_0x038d('0x31')]?_0x1f7cdb['attributes']:_0x33fa99[_0x038d('0x2a')];if(_0x5044db[_0x038d('0x2c')][_0x038d('0x32')]){_0x1f7cdb['include']=[{'all':!![]}];}_0x1f7cdb=_[_0x038d('0x33')]({},_0x1f7cdb,_0x5044db[_0x038d('0x34')]);return db[_0x038d('0x35')][_0x038d('0x36')](_0x1f7cdb)['then'](handleEntityNotFound(_0x2c0b46,null))[_0x038d('0x24')](respondWithResult(_0x2c0b46,null))[_0x038d('0x37')](handleError(_0x2c0b46,null));};exports[_0x038d('0x38')]=function(_0x38dafe,_0x27da2b){if(_0x38dafe['body']['id']){delete _0x38dafe[_0x038d('0x39')]['id'];}return db[_0x038d('0x35')][_0x038d('0x36')]({'where':{'id':_0x38dafe[_0x038d('0x3a')]['id']}})['then'](handleEntityNotFound(_0x27da2b,null))[_0x038d('0x24')](saveUpdates(_0x38dafe[_0x038d('0x39')],null))[_0x038d('0x24')](respondWithResult(_0x27da2b,null))[_0x038d('0x37')](handleError(_0x27da2b,null));};exports['destroy']=function(_0x2cf043,_0x37f749){return db['ChatApplication'][_0x038d('0x36')]({'where':{'id':_0x2cf043['params']['id']}})[_0x038d('0x24')](handleEntityNotFound(_0x37f749,null))[_0x038d('0x24')](removeEntity(_0x37f749,null))['catch'](handleError(_0x37f749,null));};
\ No newline at end of file