Built motion from commit 994c64e1.|2.6.1
[motion2.git] / server / api / chatApplication / chatApplication.controller.js
index fe7fd4a..f4f540a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97a2=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','show','keys','ChatApplication','rawAttributes','query','model','attributes','intersection','fields','length','includeAll','include','merge','catch','update','body','params','find','eml-format'];(function(_0xe19ad4,_0x37db41){var _0x439b24=function(_0x1d6f00){while(--_0x1d6f00){_0xe19ad4['push'](_0xe19ad4['shift']());}};_0x439b24(++_0x37db41);}(_0x97a2,0x1b1));var _0x297a=function(_0x44a08a,_0x48e921){_0x44a08a=_0x44a08a-0x0;var _0x280df9=_0x97a2[_0x44a08a];return _0x280df9;};'use strict';var emlformat=require(_0x297a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x297a('0x1'));var jsonpatch=require(_0x297a('0x2'));var rp=require(_0x297a('0x3'));var moment=require(_0x297a('0x4'));var BPromise=require(_0x297a('0x5'));var Mustache=require(_0x297a('0x6'));var util=require(_0x297a('0x7'));var path=require(_0x297a('0x8'));var sox=require('sox');var csv=require(_0x297a('0x9'));var ejs=require(_0x297a('0xa'));var fs=require('fs');var fs_extra=require(_0x297a('0xb'));var _=require(_0x297a('0xc'));var squel=require(_0x297a('0xd'));var crypto=require(_0x297a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x297a('0xf'));var toCsv=require(_0x297a('0x9'));var querystring=require(_0x297a('0x10'));var Papa=require(_0x297a('0x11'));var Redis=require(_0x297a('0x12'));var authService=require(_0x297a('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x297a('0x14'))(_0x297a('0x15'));var utils=require(_0x297a('0x16'));var config=require(_0x297a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x297a('0x18'))['db'];function respondWithStatusCode(_0x3db3e9,_0x278334){_0x278334=_0x278334||0xcc;return function(_0x413bc4){if(_0x413bc4){return _0x3db3e9[_0x297a('0x19')](_0x278334);}return _0x3db3e9[_0x297a('0x1a')](_0x278334)[_0x297a('0x1b')]();};}function respondWithResult(_0x5020b0,_0x4d826d){_0x4d826d=_0x4d826d||0xc8;return function(_0x417def){if(_0x417def){return _0x5020b0['status'](_0x4d826d)[_0x297a('0x1c')](_0x417def);}};}function respondWithFilteredResult(_0x1016ea,_0x53f1e4){return function(_0x188540){if(_0x188540){var _0x40f080=typeof _0x53f1e4['offset']===_0x297a('0x1d')&&typeof _0x53f1e4[_0x297a('0x1e')]===_0x297a('0x1d');var _0x4d6b59=_0x188540[_0x297a('0x1f')];var _0x3af847=_0x40f080?0x0:_0x53f1e4[_0x297a('0x20')];var _0x4d6194=_0x40f080?_0x188540[_0x297a('0x1f')]:_0x53f1e4[_0x297a('0x20')]+_0x53f1e4['limit'];var _0x26b878;if(_0x4d6194>=_0x4d6b59){_0x4d6194=_0x4d6b59;_0x26b878=0xc8;}else{_0x26b878=0xce;}_0x1016ea[_0x297a('0x1a')](_0x26b878);return _0x1016ea[_0x297a('0x21')](_0x297a('0x22'),_0x3af847+'-'+_0x4d6194+'/'+_0x4d6b59)[_0x297a('0x1c')](_0x188540);}return null;};}function patchUpdates(_0xde6d1c){return function(_0x3e42c5){try{jsonpatch[_0x297a('0x23')](_0x3e42c5,_0xde6d1c,!![]);}catch(_0x101583){return BPromise[_0x297a('0x24')](_0x101583);}return _0x3e42c5[_0x297a('0x25')]();};}function saveUpdates(_0x5889c7,_0x481f59){return function(_0x5bb38a){if(_0x5bb38a){return _0x5bb38a['update'](_0x5889c7)[_0x297a('0x26')](function(_0xcebadc){return _0xcebadc;});}return null;};}function removeEntity(_0x4ad883,_0xfbf16a){return function(_0x40919d){if(_0x40919d){return _0x40919d[_0x297a('0x27')]()[_0x297a('0x26')](function(){_0x4ad883['status'](0xcc)[_0x297a('0x1b')]();});}};}function handleEntityNotFound(_0x3267eb,_0x33f803){return function(_0x4cc530){if(!_0x4cc530){_0x3267eb[_0x297a('0x19')](0x194);}return _0x4cc530;};}function handleError(_0x67dfdb,_0xbe22aa){_0xbe22aa=_0xbe22aa||0x1f4;return function(_0x3c20f7){logger[_0x297a('0x28')](_0x3c20f7[_0x297a('0x29')]);if(_0x3c20f7[_0x297a('0x2a')]){delete _0x3c20f7[_0x297a('0x2a')];}_0x67dfdb[_0x297a('0x1a')](_0xbe22aa)[_0x297a('0x2b')](_0x3c20f7);};}exports[_0x297a('0x2c')]=function(_0x57327a,_0x26e263){var _0x1204b4={'raw':!![],'where':{'id':_0x57327a['params']['id']}},_0xc30c85={};_0xc30c85['model']=_[_0x297a('0x2d')](db[_0x297a('0x2e')][_0x297a('0x2f')]);_0xc30c85[_0x297a('0x30')]=_[_0x297a('0x2d')](_0x57327a[_0x297a('0x30')]);_0xc30c85['filters']=_['intersection'](_0xc30c85[_0x297a('0x31')],_0xc30c85['query']);_0x1204b4[_0x297a('0x32')]=_[_0x297a('0x33')](_0xc30c85[_0x297a('0x31')],qs[_0x297a('0x34')](_0x57327a[_0x297a('0x30')]['fields']));_0x1204b4[_0x297a('0x32')]=_0x1204b4[_0x297a('0x32')][_0x297a('0x35')]?_0x1204b4[_0x297a('0x32')]:_0xc30c85[_0x297a('0x31')];if(_0x57327a[_0x297a('0x30')][_0x297a('0x36')]){_0x1204b4[_0x297a('0x37')]=[{'all':!![]}];}_0x1204b4=_[_0x297a('0x38')]({},_0x1204b4,_0x57327a['options']);return db[_0x297a('0x2e')]['find'](_0x1204b4)[_0x297a('0x26')](handleEntityNotFound(_0x26e263,null))[_0x297a('0x26')](respondWithResult(_0x26e263,null))[_0x297a('0x39')](handleError(_0x26e263,null));};exports[_0x297a('0x3a')]=function(_0x5de9f5,_0x27f7cc){if(_0x5de9f5['body']['id']){delete _0x5de9f5[_0x297a('0x3b')]['id'];}return db[_0x297a('0x2e')]['find']({'where':{'id':_0x5de9f5[_0x297a('0x3c')]['id']}})[_0x297a('0x26')](handleEntityNotFound(_0x27f7cc,null))[_0x297a('0x26')](saveUpdates(_0x5de9f5['body'],null))['then'](respondWithResult(_0x27f7cc,null))[_0x297a('0x39')](handleError(_0x27f7cc,null));};exports[_0x297a('0x27')]=function(_0x22e365,_0x4e7fed){return db[_0x297a('0x2e')][_0x297a('0x3d')]({'where':{'id':_0x22e365[_0x297a('0x3c')]['id']}})[_0x297a('0x26')](handleEntityNotFound(_0x4e7fed,null))[_0x297a('0x26')](removeEntity(_0x4e7fed,null))[_0x297a('0x39')](handleError(_0x4e7fed,null));};
\ No newline at end of file
+var _0x80ed=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','end','error','name','send','params','model','keys','ChatApplication','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring'];(function(_0x50469c,_0x2f7330){var _0xa39a69=function(_0xacad02){while(--_0xacad02){_0x50469c['push'](_0x50469c['shift']());}};_0xa39a69(++_0x2f7330);}(_0x80ed,0x11c));var _0xd80e=function(_0x133e57,_0x4387ce){_0x133e57=_0x133e57-0x0;var _0x5c20f6=_0x80ed[_0x133e57];return _0x5c20f6;};'use strict';var emlformat=require(_0xd80e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd80e('0x1'));var jsonpatch=require(_0xd80e('0x2'));var rp=require(_0xd80e('0x3'));var moment=require('moment');var BPromise=require(_0xd80e('0x4'));var Mustache=require(_0xd80e('0x5'));var util=require(_0xd80e('0x6'));var path=require(_0xd80e('0x7'));var sox=require('sox');var csv=require(_0xd80e('0x8'));var ejs=require(_0xd80e('0x9'));var fs=require('fs');var fs_extra=require(_0xd80e('0xa'));var _=require('lodash');var squel=require(_0xd80e('0xb'));var crypto=require(_0xd80e('0xc'));var jsforce=require(_0xd80e('0xd'));var deskjs=require(_0xd80e('0xe'));var toCsv=require(_0xd80e('0x8'));var querystring=require(_0xd80e('0xf'));var Papa=require(_0xd80e('0x10'));var Redis=require(_0xd80e('0x11'));var authService=require(_0xd80e('0x12'));var qs=require(_0xd80e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd80e('0x14'));var logger=require(_0xd80e('0x15'))(_0xd80e('0x16'));var utils=require(_0xd80e('0x17'));var config=require(_0xd80e('0x18'));var licenseUtil=require(_0xd80e('0x19'));var db=require(_0xd80e('0x1a'))['db'];function respondWithStatusCode(_0x118f53,_0x1d3fcf){_0x1d3fcf=_0x1d3fcf||0xcc;return function(_0x4fb01c){if(_0x4fb01c){return _0x118f53['sendStatus'](_0x1d3fcf);}return _0x118f53['status'](_0x1d3fcf)['end']();};}function respondWithResult(_0x145766,_0x3d233b){_0x3d233b=_0x3d233b||0xc8;return function(_0x3096ae){if(_0x3096ae){return _0x145766[_0xd80e('0x1b')](_0x3d233b)[_0xd80e('0x1c')](_0x3096ae);}};}function respondWithFilteredResult(_0x58a17e,_0x595683){return function(_0x2c8c61){if(_0x2c8c61){var _0x3124e8=typeof _0x595683[_0xd80e('0x1d')]===_0xd80e('0x1e')&&typeof _0x595683[_0xd80e('0x1f')]===_0xd80e('0x1e');var _0x22ab67=_0x2c8c61['count'];var _0x21ceec=_0x3124e8?0x0:_0x595683[_0xd80e('0x1d')];var _0x3b543d=_0x3124e8?_0x2c8c61[_0xd80e('0x20')]:_0x595683['offset']+_0x595683[_0xd80e('0x1f')];var _0x175c67;if(_0x3b543d>=_0x22ab67){_0x3b543d=_0x22ab67;_0x175c67=0xc8;}else{_0x175c67=0xce;}_0x58a17e[_0xd80e('0x1b')](_0x175c67);return _0x58a17e['set'](_0xd80e('0x21'),_0x21ceec+'-'+_0x3b543d+'/'+_0x22ab67)[_0xd80e('0x1c')](_0x2c8c61);}return null;};}function patchUpdates(_0x2765ea){return function(_0x147134){try{jsonpatch[_0xd80e('0x22')](_0x147134,_0x2765ea,!![]);}catch(_0x5509d4){return BPromise['reject'](_0x5509d4);}return _0x147134[_0xd80e('0x23')]();};}function saveUpdates(_0x3fa159,_0x3b39bf){return function(_0x2d46e7){if(_0x2d46e7){return _0x2d46e7[_0xd80e('0x24')](_0x3fa159)[_0xd80e('0x25')](function(_0x43152c){return _0x43152c;});}return null;};}function removeEntity(_0x5430b6,_0x1fbf8a){return function(_0x57d70){if(_0x57d70){return _0x57d70[_0xd80e('0x26')]()['then'](function(){_0x5430b6[_0xd80e('0x1b')](0xcc)[_0xd80e('0x27')]();});}};}function handleEntityNotFound(_0xe9bb59,_0x482779){return function(_0x521aa4){if(!_0x521aa4){_0xe9bb59['sendStatus'](0x194);}return _0x521aa4;};}function handleError(_0x31ff9d,_0x4b8291){_0x4b8291=_0x4b8291||0x1f4;return function(_0x9f9287){logger[_0xd80e('0x28')](_0x9f9287['stack']);if(_0x9f9287[_0xd80e('0x29')]){delete _0x9f9287[_0xd80e('0x29')];}_0x31ff9d[_0xd80e('0x1b')](_0x4b8291)[_0xd80e('0x2a')](_0x9f9287);};}exports['show']=function(_0x15f317,_0x1ad3bc){var _0x845451={'raw':!![],'where':{'id':_0x15f317[_0xd80e('0x2b')]['id']}},_0x39088b={};_0x39088b[_0xd80e('0x2c')]=_[_0xd80e('0x2d')](db[_0xd80e('0x2e')]['rawAttributes']);_0x39088b['query']=_[_0xd80e('0x2d')](_0x15f317[_0xd80e('0x2f')]);_0x39088b[_0xd80e('0x30')]=_[_0xd80e('0x31')](_0x39088b[_0xd80e('0x2c')],_0x39088b[_0xd80e('0x2f')]);_0x845451['attributes']=_['intersection'](_0x39088b[_0xd80e('0x2c')],qs[_0xd80e('0x32')](_0x15f317[_0xd80e('0x2f')][_0xd80e('0x32')]));_0x845451[_0xd80e('0x33')]=_0x845451[_0xd80e('0x33')][_0xd80e('0x34')]?_0x845451[_0xd80e('0x33')]:_0x39088b['model'];if(_0x15f317['query'][_0xd80e('0x35')]){_0x845451[_0xd80e('0x36')]=[{'all':!![]}];}_0x845451=_[_0xd80e('0x37')]({},_0x845451,_0x15f317[_0xd80e('0x38')]);return db[_0xd80e('0x2e')][_0xd80e('0x39')](_0x845451)[_0xd80e('0x25')](handleEntityNotFound(_0x1ad3bc,null))[_0xd80e('0x25')](respondWithResult(_0x1ad3bc,null))[_0xd80e('0x3a')](handleError(_0x1ad3bc,null));};exports[_0xd80e('0x24')]=function(_0x503dc8,_0x36efc2){if(_0x503dc8['body']['id']){delete _0x503dc8[_0xd80e('0x3b')]['id'];}return db[_0xd80e('0x2e')][_0xd80e('0x39')]({'where':{'id':_0x503dc8[_0xd80e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x36efc2,null))[_0xd80e('0x25')](saveUpdates(_0x503dc8['body'],null))[_0xd80e('0x25')](respondWithResult(_0x36efc2,null))['catch'](handleError(_0x36efc2,null));};exports[_0xd80e('0x26')]=function(_0x3da220,_0x4b7f32){return db[_0xd80e('0x2e')][_0xd80e('0x39')]({'where':{'id':_0x3da220[_0xd80e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x4b7f32,null))[_0xd80e('0x25')](removeEntity(_0x4b7f32,null))[_0xd80e('0x3a')](handleError(_0x4b7f32,null));};
\ No newline at end of file