Built motion from commit (unavailable).|2.3.4
[motion2.git] / server / api / chatApplication / chatApplication.controller.js
index 94c873b..9db10ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6fa=['rawAttributes','query','filters','attributes','intersection','fields','includeAll','include','merge','options','ChatApplication','find','then','catch','body','html-pdf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','params','model','keys'];(function(_0x98e7d4,_0x4926a3){var _0x20ff14=function(_0x2e06f4){while(--_0x2e06f4){_0x98e7d4['push'](_0x98e7d4['shift']());}};_0x20ff14(++_0x4926a3);}(_0xc6fa,0x13b));var _0xac6f=function(_0x4fd109,_0x33c503){_0x4fd109=_0x4fd109-0x0;var _0x30f0a6=_0xc6fa[_0x4fd109];return _0x30f0a6;};'use strict';var pdf=require(_0xac6f('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xac6f('0x1'));var jsonpatch=require(_0xac6f('0x2'));var rp=require(_0xac6f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xac6f('0x4'));var util=require(_0xac6f('0x5'));var path=require(_0xac6f('0x6'));var sox=require(_0xac6f('0x7'));var csv=require(_0xac6f('0x8'));var ejs=require(_0xac6f('0x9'));var fs=require('fs');var _=require(_0xac6f('0xa'));var squel=require(_0xac6f('0xb'));var crypto=require(_0xac6f('0xc'));var jsforce=require(_0xac6f('0xd'));var deskjs=require(_0xac6f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xac6f('0xf'));var Papa=require(_0xac6f('0x10'));var authService=require(_0xac6f('0x11'));var hardwareService=require(_0xac6f('0x12'));var Redis=require(_0xac6f('0x13'));var qs=require(_0xac6f('0x14'));var logger=require(_0xac6f('0x15'))(_0xac6f('0x16'));var utils=require('../../config/utils');var config=require(_0xac6f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x545605,_0x25b8a4){_0x25b8a4=_0x25b8a4||0xcc;return function(_0x392ecd){if(_0x392ecd){return _0x545605[_0xac6f('0x18')](_0x25b8a4);}return _0x545605[_0xac6f('0x19')](_0x25b8a4)[_0xac6f('0x1a')]();};}function respondWithResult(_0xce68c0,_0x4c921b){_0x4c921b=_0x4c921b||0xc8;return function(_0x24515e){if(_0x24515e){return _0xce68c0[_0xac6f('0x19')](_0x4c921b)[_0xac6f('0x1b')](_0x24515e);}};}function respondWithFilteredResult(_0x5eec9c,_0x3150b4){return function(_0x1cae72){if(_0x1cae72){var _0x5b7e32=_0x1cae72[_0xac6f('0x1c')],_0x5d367f=_0x3150b4[_0xac6f('0x1d')],_0x5a8f3e=_0x3150b4['offset']+_0x3150b4[_0xac6f('0x1e')],_0x4f6067;if(_0x5a8f3e>=_0x5b7e32){_0x5a8f3e=_0x5b7e32;_0x4f6067=0xc8;}else{_0x4f6067=0xce;}_0x5eec9c['status'](_0x4f6067);return _0x5eec9c[_0xac6f('0x1f')](_0xac6f('0x20'),_0x5d367f+'-'+_0x5a8f3e+'/'+_0x5b7e32)[_0xac6f('0x1b')](_0x1cae72);}return null;};}function patchUpdates(_0x143760){return function(_0x17b89a){try{jsonpatch[_0xac6f('0x21')](_0x17b89a,_0x143760,!![]);}catch(_0x3fc3f3){return BPromise[_0xac6f('0x22')](_0x3fc3f3);}return _0x17b89a[_0xac6f('0x23')]();};}function saveUpdates(_0x20a2b6,_0x58ce35){return function(_0x14e74d){if(_0x14e74d){return _0x14e74d[_0xac6f('0x24')](_0x20a2b6)['then'](function(_0x534df4){return _0x534df4;});}return null;};}function removeEntity(_0x31085a,_0x428afa){return function(_0xe19b6c){if(_0xe19b6c){return _0xe19b6c[_0xac6f('0x25')]()['then'](function(){_0x31085a[_0xac6f('0x19')](0xcc)[_0xac6f('0x1a')]();});}};}function handleEntityNotFound(_0x43d548,_0x27f307){return function(_0x2cf8a0){if(!_0x2cf8a0){_0x43d548[_0xac6f('0x18')](0x194);}return _0x2cf8a0;};}function handleError(_0x244104,_0x8aa3dc){_0x8aa3dc=_0x8aa3dc||0x1f4;return function(_0x3f1c7f){logger[_0xac6f('0x26')](_0x3f1c7f[_0xac6f('0x27')]);if(_0x3f1c7f['name']){delete _0x3f1c7f[_0xac6f('0x28')];}_0x244104[_0xac6f('0x19')](_0x8aa3dc)[_0xac6f('0x29')](_0x3f1c7f);};}exports['show']=function(_0x4da63f,_0x6ed0ea){var _0x3a8ba0={'raw':!![],'where':{'id':_0x4da63f[_0xac6f('0x2a')]['id']}},_0x419070={};_0x419070[_0xac6f('0x2b')]=_[_0xac6f('0x2c')](db['ChatApplication'][_0xac6f('0x2d')]);_0x419070['query']=_['keys'](_0x4da63f[_0xac6f('0x2e')]);_0x419070[_0xac6f('0x2f')]=_['intersection'](_0x419070[_0xac6f('0x2b')],_0x419070[_0xac6f('0x2e')]);_0x3a8ba0[_0xac6f('0x30')]=_[_0xac6f('0x31')](_0x419070['model'],qs[_0xac6f('0x32')](_0x4da63f['query'][_0xac6f('0x32')]));_0x3a8ba0[_0xac6f('0x30')]=_0x3a8ba0[_0xac6f('0x30')]['length']?_0x3a8ba0['attributes']:_0x419070[_0xac6f('0x2b')];if(_0x4da63f[_0xac6f('0x2e')][_0xac6f('0x33')]){_0x3a8ba0[_0xac6f('0x34')]=[{'all':!![]}];}_0x3a8ba0=_[_0xac6f('0x35')]({},_0x3a8ba0,_0x4da63f[_0xac6f('0x36')]);return db[_0xac6f('0x37')][_0xac6f('0x38')](_0x3a8ba0)[_0xac6f('0x39')](handleEntityNotFound(_0x6ed0ea,null))[_0xac6f('0x39')](respondWithResult(_0x6ed0ea,null))[_0xac6f('0x3a')](handleError(_0x6ed0ea,null));};exports[_0xac6f('0x24')]=function(_0x8e3133,_0x23e93a){if(_0x8e3133[_0xac6f('0x3b')]['id']){delete _0x8e3133[_0xac6f('0x3b')]['id'];}return db[_0xac6f('0x37')][_0xac6f('0x38')]({'where':{'id':_0x8e3133[_0xac6f('0x2a')]['id']}})[_0xac6f('0x39')](handleEntityNotFound(_0x23e93a,null))['then'](saveUpdates(_0x8e3133[_0xac6f('0x3b')],null))[_0xac6f('0x39')](respondWithResult(_0x23e93a,null))['catch'](handleError(_0x23e93a,null));};exports[_0xac6f('0x25')]=function(_0xf9bdf2,_0x2297d2){return db['ChatApplication'][_0xac6f('0x38')]({'where':{'id':_0xf9bdf2['params']['id']}})[_0xac6f('0x39')](handleEntityNotFound(_0x2297d2,null))['then'](removeEntity(_0x2297d2,null))[_0xac6f('0x3a')](handleError(_0x2297d2,null));};
\ No newline at end of file
+var _0x00a2=['attributes','fields','query','length','includeAll','include','merge','find','catch','update','body','params','html-pdf','eml-format','rimraf','moment','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','Content-Range','save','then','destroy','sendStatus','error','stack','name','model','keys','ChatApplication','rawAttributes','filters'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x00a2,0xb1));var _0x200a=function(_0x1946de,_0x198468){_0x1946de=_0x1946de-0x0;var _0x144e21=_0x00a2[_0x1946de];return _0x144e21;};'use strict';var pdf=require(_0x200a('0x0'));var emlformat=require(_0x200a('0x1'));var rimraf=require(_0x200a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x200a('0x3'));var BPromise=require(_0x200a('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x200a('0x5'));var sox=require(_0x200a('0x6'));var csv=require(_0x200a('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x200a('0x8'));var squel=require(_0x200a('0x9'));var crypto=require(_0x200a('0xa'));var jsforce=require(_0x200a('0xb'));var deskjs=require(_0x200a('0xc'));var toCsv=require(_0x200a('0x7'));var querystring=require(_0x200a('0xd'));var Papa=require(_0x200a('0xe'));var authService=require(_0x200a('0xf'));var hardwareService=require(_0x200a('0x10'));var Redis=require(_0x200a('0x11'));var qs=require(_0x200a('0x12'));var logger=require(_0x200a('0x13'))(_0x200a('0x14'));var utils=require(_0x200a('0x15'));var config=require(_0x200a('0x16'));var db=require(_0x200a('0x17'))['db'];function respondWithStatusCode(_0x1775e2,_0x328a10){_0x328a10=_0x328a10||0xcc;return function(_0xc3f6f8){if(_0xc3f6f8){return _0x1775e2['sendStatus'](_0x328a10);}return _0x1775e2[_0x200a('0x18')](_0x328a10)[_0x200a('0x19')]();};}function respondWithResult(_0x5d40ef,_0x4ee277){_0x4ee277=_0x4ee277||0xc8;return function(_0x4eaede){if(_0x4eaede){return _0x5d40ef['status'](_0x4ee277)[_0x200a('0x1a')](_0x4eaede);}};}function respondWithFilteredResult(_0x5f242f,_0x5b0ad6){return function(_0x177188){if(_0x177188){var _0xed4671=_0x177188[_0x200a('0x1b')],_0x164a40=_0x5b0ad6[_0x200a('0x1c')],_0x491c5b=_0x5b0ad6[_0x200a('0x1c')]+_0x5b0ad6[_0x200a('0x1d')],_0x38de01;if(_0x491c5b>=_0xed4671){_0x491c5b=_0xed4671;_0x38de01=0xc8;}else{_0x38de01=0xce;}_0x5f242f['status'](_0x38de01);return _0x5f242f['set'](_0x200a('0x1e'),_0x164a40+'-'+_0x491c5b+'/'+_0xed4671)['json'](_0x177188);}return null;};}function patchUpdates(_0x3bf4f5){return function(_0x22d335){try{jsonpatch['apply'](_0x22d335,_0x3bf4f5,!![]);}catch(_0x3c6ed9){return BPromise['reject'](_0x3c6ed9);}return _0x22d335[_0x200a('0x1f')]();};}function saveUpdates(_0xc6b109,_0x5881bd){return function(_0x164eef){if(_0x164eef){return _0x164eef['update'](_0xc6b109)[_0x200a('0x20')](function(_0xf1e683){return _0xf1e683;});}return null;};}function removeEntity(_0x21dd59,_0x1421e3){return function(_0x196e03){if(_0x196e03){return _0x196e03[_0x200a('0x21')]()[_0x200a('0x20')](function(){_0x21dd59[_0x200a('0x18')](0xcc)[_0x200a('0x19')]();});}};}function handleEntityNotFound(_0x1e8d1,_0x3cc87f){return function(_0x7e91d7){if(!_0x7e91d7){_0x1e8d1[_0x200a('0x22')](0x194);}return _0x7e91d7;};}function handleError(_0x2974a9,_0x66f0ba){_0x66f0ba=_0x66f0ba||0x1f4;return function(_0x2b2fe0){logger[_0x200a('0x23')](_0x2b2fe0[_0x200a('0x24')]);if(_0x2b2fe0[_0x200a('0x25')]){delete _0x2b2fe0[_0x200a('0x25')];}_0x2974a9[_0x200a('0x18')](_0x66f0ba)['send'](_0x2b2fe0);};}exports['show']=function(_0x361b37,_0x152469){var _0x5d5de2={'raw':!![],'where':{'id':_0x361b37['params']['id']}},_0x419669={};_0x419669[_0x200a('0x26')]=_[_0x200a('0x27')](db[_0x200a('0x28')][_0x200a('0x29')]);_0x419669['query']=_['keys'](_0x361b37['query']);_0x419669[_0x200a('0x2a')]=_['intersection'](_0x419669[_0x200a('0x26')],_0x419669['query']);_0x5d5de2[_0x200a('0x2b')]=_['intersection'](_0x419669[_0x200a('0x26')],qs[_0x200a('0x2c')](_0x361b37[_0x200a('0x2d')][_0x200a('0x2c')]));_0x5d5de2[_0x200a('0x2b')]=_0x5d5de2[_0x200a('0x2b')][_0x200a('0x2e')]?_0x5d5de2[_0x200a('0x2b')]:_0x419669[_0x200a('0x26')];if(_0x361b37['query'][_0x200a('0x2f')]){_0x5d5de2[_0x200a('0x30')]=[{'all':!![]}];}_0x5d5de2=_[_0x200a('0x31')]({},_0x5d5de2,_0x361b37['options']);return db['ChatApplication'][_0x200a('0x32')](_0x5d5de2)['then'](handleEntityNotFound(_0x152469,null))['then'](respondWithResult(_0x152469,null))[_0x200a('0x33')](handleError(_0x152469,null));};exports[_0x200a('0x34')]=function(_0x24d774,_0x252b45){if(_0x24d774['body']['id']){delete _0x24d774[_0x200a('0x35')]['id'];}return db[_0x200a('0x28')][_0x200a('0x32')]({'where':{'id':_0x24d774[_0x200a('0x36')]['id']}})['then'](handleEntityNotFound(_0x252b45,null))[_0x200a('0x20')](saveUpdates(_0x24d774[_0x200a('0x35')],null))[_0x200a('0x20')](respondWithResult(_0x252b45,null))['catch'](handleError(_0x252b45,null));};exports['destroy']=function(_0x49316f,_0x154b8e){return db[_0x200a('0x28')]['find']({'where':{'id':_0x49316f[_0x200a('0x36')]['id']}})[_0x200a('0x20')](handleEntityNotFound(_0x154b8e,null))[_0x200a('0x20')](removeEntity(_0x154b8e,null))[_0x200a('0x33')](handleError(_0x154b8e,null));};
\ No newline at end of file