Built motion from commit (unavailable).|2.5.0
[motion2.git] / server / api / chatApplication / chatApplication.controller.js
index 52d4932..e7e1ea6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbf5=['destroy','error','stack','name','send','show','params','keys','rawAttributes','query','filters','intersection','model','attributes','fields','includeAll','include','ChatApplication','find','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then'];(function(_0x317fba,_0x5b5b38){var _0x279bc7=function(_0xd4e6d9){while(--_0xd4e6d9){_0x317fba['push'](_0x317fba['shift']());}};_0x279bc7(++_0x5b5b38);}(_0xcbf5,0x1e5));var _0x5cbf=function(_0xf34da4,_0x30c006){_0xf34da4=_0xf34da4-0x0;var _0xc8b3ef=_0xcbf5[_0xf34da4];return _0xc8b3ef;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5cbf('0x0'));var rimraf=require(_0x5cbf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5cbf('0x2'));var rp=require(_0x5cbf('0x3'));var moment=require(_0x5cbf('0x4'));var BPromise=require(_0x5cbf('0x5'));var Mustache=require(_0x5cbf('0x6'));var util=require(_0x5cbf('0x7'));var path=require(_0x5cbf('0x8'));var sox=require(_0x5cbf('0x9'));var csv=require(_0x5cbf('0xa'));var ejs=require(_0x5cbf('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5cbf('0xc'));var crypto=require('crypto');var jsforce=require(_0x5cbf('0xd'));var deskjs=require(_0x5cbf('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5cbf('0xf'));var Redis=require(_0x5cbf('0x10'));var authService=require(_0x5cbf('0x11'));var qs=require(_0x5cbf('0x12'));var as=require(_0x5cbf('0x13'));var hardwareService=require(_0x5cbf('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x5cbf('0x15'));var config=require(_0x5cbf('0x16'));var db=require(_0x5cbf('0x17'))['db'];function respondWithStatusCode(_0x16e151,_0x5ad170){_0x5ad170=_0x5ad170||0xcc;return function(_0x5775bf){if(_0x5775bf){return _0x16e151[_0x5cbf('0x18')](_0x5ad170);}return _0x16e151[_0x5cbf('0x19')](_0x5ad170)[_0x5cbf('0x1a')]();};}function respondWithResult(_0x1963b1,_0x11268d){_0x11268d=_0x11268d||0xc8;return function(_0x135169){if(_0x135169){return _0x1963b1['status'](_0x11268d)[_0x5cbf('0x1b')](_0x135169);}};}function respondWithFilteredResult(_0x4e4f55,_0x1141ae){return function(_0x404f19){if(_0x404f19){var _0x10a59f=_0x404f19[_0x5cbf('0x1c')],_0x277802=_0x1141ae[_0x5cbf('0x1d')],_0x275508=_0x1141ae[_0x5cbf('0x1d')]+_0x1141ae[_0x5cbf('0x1e')],_0x524093;if(_0x275508>=_0x10a59f){_0x275508=_0x10a59f;_0x524093=0xc8;}else{_0x524093=0xce;}_0x4e4f55['status'](_0x524093);return _0x4e4f55[_0x5cbf('0x1f')]('Content-Range',_0x277802+'-'+_0x275508+'/'+_0x10a59f)[_0x5cbf('0x1b')](_0x404f19);}return null;};}function patchUpdates(_0x1a5ea2){return function(_0xab5cf6){try{jsonpatch[_0x5cbf('0x20')](_0xab5cf6,_0x1a5ea2,!![]);}catch(_0x285ad0){return BPromise[_0x5cbf('0x21')](_0x285ad0);}return _0xab5cf6[_0x5cbf('0x22')]();};}function saveUpdates(_0x47616c,_0x4a7c34){return function(_0x5ea5b7){if(_0x5ea5b7){return _0x5ea5b7[_0x5cbf('0x23')](_0x47616c)[_0x5cbf('0x24')](function(_0x31be2c){return _0x31be2c;});}return null;};}function removeEntity(_0x355d26,_0x3a978c){return function(_0x565d00){if(_0x565d00){return _0x565d00[_0x5cbf('0x25')]()['then'](function(){_0x355d26['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f604c,_0x474aa6){return function(_0x31358f){if(!_0x31358f){_0x1f604c[_0x5cbf('0x18')](0x194);}return _0x31358f;};}function handleError(_0x5bf1e9,_0x5dcde5){_0x5dcde5=_0x5dcde5||0x1f4;return function(_0x2741ae){logger[_0x5cbf('0x26')](_0x2741ae[_0x5cbf('0x27')]);if(_0x2741ae['name']){delete _0x2741ae[_0x5cbf('0x28')];}_0x5bf1e9[_0x5cbf('0x19')](_0x5dcde5)[_0x5cbf('0x29')](_0x2741ae);};}exports[_0x5cbf('0x2a')]=function(_0x528fea,_0x5d9b4e){var _0x33cb9c={'raw':!![],'where':{'id':_0x528fea[_0x5cbf('0x2b')]['id']}},_0xe84a17={};_0xe84a17['model']=_[_0x5cbf('0x2c')](db['ChatApplication'][_0x5cbf('0x2d')]);_0xe84a17['query']=_[_0x5cbf('0x2c')](_0x528fea[_0x5cbf('0x2e')]);_0xe84a17[_0x5cbf('0x2f')]=_[_0x5cbf('0x30')](_0xe84a17[_0x5cbf('0x31')],_0xe84a17[_0x5cbf('0x2e')]);_0x33cb9c[_0x5cbf('0x32')]=_[_0x5cbf('0x30')](_0xe84a17[_0x5cbf('0x31')],qs[_0x5cbf('0x33')](_0x528fea[_0x5cbf('0x2e')][_0x5cbf('0x33')]));_0x33cb9c[_0x5cbf('0x32')]=_0x33cb9c[_0x5cbf('0x32')]['length']?_0x33cb9c['attributes']:_0xe84a17[_0x5cbf('0x31')];if(_0x528fea[_0x5cbf('0x2e')][_0x5cbf('0x34')]){_0x33cb9c[_0x5cbf('0x35')]=[{'all':!![]}];}_0x33cb9c=_['merge']({},_0x33cb9c,_0x528fea['options']);return db[_0x5cbf('0x36')][_0x5cbf('0x37')](_0x33cb9c)[_0x5cbf('0x24')](handleEntityNotFound(_0x5d9b4e,null))['then'](respondWithResult(_0x5d9b4e,null))[_0x5cbf('0x38')](handleError(_0x5d9b4e,null));};exports[_0x5cbf('0x23')]=function(_0x44376c,_0x4dbd6b){if(_0x44376c[_0x5cbf('0x39')]['id']){delete _0x44376c[_0x5cbf('0x39')]['id'];}return db[_0x5cbf('0x36')][_0x5cbf('0x37')]({'where':{'id':_0x44376c[_0x5cbf('0x2b')]['id']}})['then'](handleEntityNotFound(_0x4dbd6b,null))[_0x5cbf('0x24')](saveUpdates(_0x44376c[_0x5cbf('0x39')],null))['then'](respondWithResult(_0x4dbd6b,null))[_0x5cbf('0x38')](handleError(_0x4dbd6b,null));};exports[_0x5cbf('0x25')]=function(_0x1c1148,_0x57aa34){return db[_0x5cbf('0x36')][_0x5cbf('0x37')]({'where':{'id':_0x1c1148[_0x5cbf('0x2b')]['id']}})['then'](handleEntityNotFound(_0x57aa34,null))[_0x5cbf('0x24')](removeEntity(_0x57aa34,null))[_0x5cbf('0x38')](handleError(_0x57aa34,null));};
\ No newline at end of file
+var _0xeb36=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','then','destroy','error','name','send','show','model','keys','ChatApplication','query','intersection','fields','includeAll','include','merge','catch','update','body','params','find','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x9731b4,_0x26aac3){var _0x3d7a66=function(_0x4be24c){while(--_0x4be24c){_0x9731b4['push'](_0x9731b4['shift']());}};_0x3d7a66(++_0x26aac3);}(_0xeb36,0x182));var _0x6eb3=function(_0xffa1a3,_0x24bbfd){_0xffa1a3=_0xffa1a3-0x0;var _0x2eaf16=_0xeb36[_0xffa1a3];return _0x2eaf16;};'use strict';var pdf=require(_0x6eb3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6eb3('0x1'));var zipdir=require(_0x6eb3('0x2'));var jsonpatch=require(_0x6eb3('0x3'));var rp=require(_0x6eb3('0x4'));var moment=require(_0x6eb3('0x5'));var BPromise=require(_0x6eb3('0x6'));var Mustache=require(_0x6eb3('0x7'));var util=require('util');var path=require(_0x6eb3('0x8'));var sox=require(_0x6eb3('0x9'));var csv=require(_0x6eb3('0xa'));var ejs=require(_0x6eb3('0xb'));var fs=require('fs');var _=require(_0x6eb3('0xc'));var squel=require(_0x6eb3('0xd'));var crypto=require(_0x6eb3('0xe'));var jsforce=require(_0x6eb3('0xf'));var deskjs=require(_0x6eb3('0x10'));var toCsv=require(_0x6eb3('0xa'));var querystring=require(_0x6eb3('0x11'));var Papa=require(_0x6eb3('0x12'));var Redis=require(_0x6eb3('0x13'));var authService=require(_0x6eb3('0x14'));var qs=require(_0x6eb3('0x15'));var as=require(_0x6eb3('0x16'));var hardwareService=require(_0x6eb3('0x17'));var logger=require('../../config/logger')(_0x6eb3('0x18'));var utils=require(_0x6eb3('0x19'));var config=require(_0x6eb3('0x1a'));var db=require(_0x6eb3('0x1b'))['db'];function respondWithStatusCode(_0x14ad1f,_0x4f09b3){_0x4f09b3=_0x4f09b3||0xcc;return function(_0x1b30ac){if(_0x1b30ac){return _0x14ad1f[_0x6eb3('0x1c')](_0x4f09b3);}return _0x14ad1f[_0x6eb3('0x1d')](_0x4f09b3)[_0x6eb3('0x1e')]();};}function respondWithResult(_0x3d0316,_0x3ed747){_0x3ed747=_0x3ed747||0xc8;return function(_0x520a1d){if(_0x520a1d){return _0x3d0316['status'](_0x3ed747)[_0x6eb3('0x1f')](_0x520a1d);}};}function respondWithFilteredResult(_0x4c2912,_0x3bb8d0){return function(_0x4326c1){if(_0x4326c1){var _0x35d665=_0x4326c1['count'],_0x563f18=_0x3bb8d0[_0x6eb3('0x20')],_0x138be7=_0x3bb8d0[_0x6eb3('0x20')]+_0x3bb8d0['limit'],_0x181ecf;if(_0x138be7>=_0x35d665){_0x138be7=_0x35d665;_0x181ecf=0xc8;}else{_0x181ecf=0xce;}_0x4c2912[_0x6eb3('0x1d')](_0x181ecf);return _0x4c2912[_0x6eb3('0x21')](_0x6eb3('0x22'),_0x563f18+'-'+_0x138be7+'/'+_0x35d665)['json'](_0x4326c1);}return null;};}function patchUpdates(_0x2cbf85){return function(_0x30e69c){try{jsonpatch[_0x6eb3('0x23')](_0x30e69c,_0x2cbf85,!![]);}catch(_0x4d800e){return BPromise[_0x6eb3('0x24')](_0x4d800e);}return _0x30e69c[_0x6eb3('0x25')]();};}function saveUpdates(_0x3a940e,_0x33aa9e){return function(_0x259d1d){if(_0x259d1d){return _0x259d1d['update'](_0x3a940e)[_0x6eb3('0x26')](function(_0x4a1890){return _0x4a1890;});}return null;};}function removeEntity(_0x4c6c12,_0x3c6c7c){return function(_0x1bb645){if(_0x1bb645){return _0x1bb645[_0x6eb3('0x27')]()[_0x6eb3('0x26')](function(){_0x4c6c12[_0x6eb3('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dedf0,_0x4ed2b2){return function(_0x5515de){if(!_0x5515de){_0x3dedf0['sendStatus'](0x194);}return _0x5515de;};}function handleError(_0x4f8a4b,_0x5e36a2){_0x5e36a2=_0x5e36a2||0x1f4;return function(_0x4963f6){logger[_0x6eb3('0x28')](_0x4963f6['stack']);if(_0x4963f6[_0x6eb3('0x29')]){delete _0x4963f6[_0x6eb3('0x29')];}_0x4f8a4b[_0x6eb3('0x1d')](_0x5e36a2)[_0x6eb3('0x2a')](_0x4963f6);};}exports[_0x6eb3('0x2b')]=function(_0x4128e0,_0x454ed0){var _0x3ad878={'raw':!![],'where':{'id':_0x4128e0['params']['id']}},_0x49ac3f={};_0x49ac3f[_0x6eb3('0x2c')]=_[_0x6eb3('0x2d')](db[_0x6eb3('0x2e')]['rawAttributes']);_0x49ac3f['query']=_['keys'](_0x4128e0[_0x6eb3('0x2f')]);_0x49ac3f['filters']=_[_0x6eb3('0x30')](_0x49ac3f[_0x6eb3('0x2c')],_0x49ac3f['query']);_0x3ad878['attributes']=_[_0x6eb3('0x30')](_0x49ac3f[_0x6eb3('0x2c')],qs['fields'](_0x4128e0[_0x6eb3('0x2f')][_0x6eb3('0x31')]));_0x3ad878['attributes']=_0x3ad878['attributes']['length']?_0x3ad878['attributes']:_0x49ac3f[_0x6eb3('0x2c')];if(_0x4128e0['query'][_0x6eb3('0x32')]){_0x3ad878[_0x6eb3('0x33')]=[{'all':!![]}];}_0x3ad878=_[_0x6eb3('0x34')]({},_0x3ad878,_0x4128e0['options']);return db[_0x6eb3('0x2e')]['find'](_0x3ad878)[_0x6eb3('0x26')](handleEntityNotFound(_0x454ed0,null))['then'](respondWithResult(_0x454ed0,null))[_0x6eb3('0x35')](handleError(_0x454ed0,null));};exports[_0x6eb3('0x36')]=function(_0x386279,_0x47c394){if(_0x386279[_0x6eb3('0x37')]['id']){delete _0x386279[_0x6eb3('0x37')]['id'];}return db[_0x6eb3('0x2e')]['find']({'where':{'id':_0x386279[_0x6eb3('0x38')]['id']}})['then'](handleEntityNotFound(_0x47c394,null))['then'](saveUpdates(_0x386279['body'],null))[_0x6eb3('0x26')](respondWithResult(_0x47c394,null))['catch'](handleError(_0x47c394,null));};exports['destroy']=function(_0x4fff9e,_0x3962f3){return db[_0x6eb3('0x2e')][_0x6eb3('0x39')]({'where':{'id':_0x4fff9e['params']['id']}})['then'](handleEntityNotFound(_0x3962f3,null))[_0x6eb3('0x26')](removeEntity(_0x3962f3,null))[_0x6eb3('0x35')](handleError(_0x3962f3,null));};
\ No newline at end of file