Built motion from commit 06eb8eb0.|2.6.31
[motion2.git] / server / api / chatApplication / chatApplication.controller.js
index 1da59cc..c74036f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10b8=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','model','ChatApplication','rawAttributes','query','keys','filters','attributes','intersection','fields','length','includeAll','include','options','find','catch','body','params','eml-format','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x10b8,0x166));var _0x810b=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x10b8[_0xef8146];return _0x5a6cb0;};'use strict';var emlformat=require(_0x810b('0x0'));var rimraf=require(_0x810b('0x1'));var zipdir=require(_0x810b('0x2'));var jsonpatch=require(_0x810b('0x3'));var rp=require(_0x810b('0x4'));var moment=require(_0x810b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x810b('0x6'));var util=require(_0x810b('0x7'));var path=require(_0x810b('0x8'));var sox=require('sox');var csv=require(_0x810b('0x9'));var ejs=require(_0x810b('0xa'));var fs=require('fs');var fs_extra=require(_0x810b('0xb'));var _=require(_0x810b('0xc'));var squel=require(_0x810b('0xd'));var crypto=require(_0x810b('0xe'));var jsforce=require(_0x810b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x810b('0x9'));var querystring=require('querystring');var Papa=require(_0x810b('0x10'));var Redis=require(_0x810b('0x11'));var authService=require(_0x810b('0x12'));var qs=require(_0x810b('0x13'));var as=require(_0x810b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x810b('0x15'))(_0x810b('0x16'));var utils=require(_0x810b('0x17'));var config=require(_0x810b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x810b('0x19'))['db'];function respondWithStatusCode(_0x1cc57d,_0x24bb1d){_0x24bb1d=_0x24bb1d||0xcc;return function(_0x2069a9){if(_0x2069a9){return _0x1cc57d[_0x810b('0x1a')](_0x24bb1d);}return _0x1cc57d[_0x810b('0x1b')](_0x24bb1d)[_0x810b('0x1c')]();};}function respondWithResult(_0xcdb5c2,_0x26209b){_0x26209b=_0x26209b||0xc8;return function(_0x3e3e52){if(_0x3e3e52){return _0xcdb5c2['status'](_0x26209b)['json'](_0x3e3e52);}};}function respondWithFilteredResult(_0x249f8a,_0xbbc69b){return function(_0x1f2d52){if(_0x1f2d52){var _0xea1d2a=typeof _0xbbc69b[_0x810b('0x1d')]===_0x810b('0x1e')&&typeof _0xbbc69b[_0x810b('0x1f')]===_0x810b('0x1e');var _0x43f099=_0x1f2d52[_0x810b('0x20')];var _0x4a31a6=_0xea1d2a?0x0:_0xbbc69b[_0x810b('0x1d')];var _0x540741=_0xea1d2a?_0x1f2d52[_0x810b('0x20')]:_0xbbc69b[_0x810b('0x1d')]+_0xbbc69b[_0x810b('0x1f')];var _0x55ea1c;if(_0x540741>=_0x43f099){_0x540741=_0x43f099;_0x55ea1c=0xc8;}else{_0x55ea1c=0xce;}_0x249f8a[_0x810b('0x1b')](_0x55ea1c);return _0x249f8a['set'](_0x810b('0x21'),_0x4a31a6+'-'+_0x540741+'/'+_0x43f099)['json'](_0x1f2d52);}return null;};}function patchUpdates(_0x2906df){return function(_0x51b3be){try{jsonpatch[_0x810b('0x22')](_0x51b3be,_0x2906df,!![]);}catch(_0x24e74c){return BPromise[_0x810b('0x23')](_0x24e74c);}return _0x51b3be['save']();};}function saveUpdates(_0x1e3642,_0x483284){return function(_0x121178){if(_0x121178){return _0x121178[_0x810b('0x24')](_0x1e3642)[_0x810b('0x25')](function(_0x4578a5){return _0x4578a5;});}return null;};}function removeEntity(_0x4fdf04,_0x6196a7){return function(_0x525277){if(_0x525277){return _0x525277[_0x810b('0x26')]()[_0x810b('0x25')](function(){_0x4fdf04[_0x810b('0x1b')](0xcc)[_0x810b('0x1c')]();});}};}function handleEntityNotFound(_0x4fbde7,_0x2cf6e4){return function(_0x4bd4f9){if(!_0x4bd4f9){_0x4fbde7[_0x810b('0x1a')](0x194);}return _0x4bd4f9;};}function handleError(_0x466211,_0x46b9d3){_0x46b9d3=_0x46b9d3||0x1f4;return function(_0x550ab8){logger[_0x810b('0x27')](_0x550ab8[_0x810b('0x28')]);if(_0x550ab8[_0x810b('0x29')]){delete _0x550ab8[_0x810b('0x29')];}_0x466211[_0x810b('0x1b')](_0x46b9d3)[_0x810b('0x2a')](_0x550ab8);};}exports['show']=function(_0x4eb0f3,_0x190f9d){var _0x217c0a={'raw':!![],'where':{'id':_0x4eb0f3['params']['id']}},_0x18129d={};_0x18129d[_0x810b('0x2b')]=_['keys'](db[_0x810b('0x2c')][_0x810b('0x2d')]);_0x18129d[_0x810b('0x2e')]=_[_0x810b('0x2f')](_0x4eb0f3[_0x810b('0x2e')]);_0x18129d[_0x810b('0x30')]=_['intersection'](_0x18129d[_0x810b('0x2b')],_0x18129d['query']);_0x217c0a[_0x810b('0x31')]=_[_0x810b('0x32')](_0x18129d[_0x810b('0x2b')],qs['fields'](_0x4eb0f3[_0x810b('0x2e')][_0x810b('0x33')]));_0x217c0a['attributes']=_0x217c0a[_0x810b('0x31')][_0x810b('0x34')]?_0x217c0a[_0x810b('0x31')]:_0x18129d['model'];if(_0x4eb0f3[_0x810b('0x2e')][_0x810b('0x35')]){_0x217c0a[_0x810b('0x36')]=[{'all':!![]}];}_0x217c0a=_['merge']({},_0x217c0a,_0x4eb0f3[_0x810b('0x37')]);return db['ChatApplication'][_0x810b('0x38')](_0x217c0a)['then'](handleEntityNotFound(_0x190f9d,null))[_0x810b('0x25')](respondWithResult(_0x190f9d,null))[_0x810b('0x39')](handleError(_0x190f9d,null));};exports[_0x810b('0x24')]=function(_0x4b61e3,_0x3cbe75){if(_0x4b61e3[_0x810b('0x3a')]['id']){delete _0x4b61e3[_0x810b('0x3a')]['id'];}return db[_0x810b('0x2c')][_0x810b('0x38')]({'where':{'id':_0x4b61e3[_0x810b('0x3b')]['id']}})[_0x810b('0x25')](handleEntityNotFound(_0x3cbe75,null))[_0x810b('0x25')](saveUpdates(_0x4b61e3['body'],null))[_0x810b('0x25')](respondWithResult(_0x3cbe75,null))[_0x810b('0x39')](handleError(_0x3cbe75,null));};exports[_0x810b('0x26')]=function(_0x30cfc6,_0x4cb58c){return db[_0x810b('0x2c')][_0x810b('0x38')]({'where':{'id':_0x30cfc6[_0x810b('0x3b')]['id']}})[_0x810b('0x25')](handleEntityNotFound(_0x4cb58c,null))[_0x810b('0x25')](removeEntity(_0x4cb58c,null))[_0x810b('0x39')](handleError(_0x4cb58c,null));};
\ No newline at end of file
+var _0xbf6e=['save','update','then','destroy','error','name','send','show','model','keys','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','ChatApplication','find','body','params','catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbf6e,0x149));var _0xebf6=function(_0x1b1cf1,_0x252de7){_0x1b1cf1=_0x1b1cf1-0x0;var _0x383298=_0xbf6e[_0x1b1cf1];return _0x383298;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xebf6('0x0'));var jsonpatch=require(_0xebf6('0x1'));var rp=require(_0xebf6('0x2'));var moment=require(_0xebf6('0x3'));var BPromise=require(_0xebf6('0x4'));var Mustache=require(_0xebf6('0x5'));var util=require(_0xebf6('0x6'));var path=require('path');var sox=require(_0xebf6('0x7'));var csv=require(_0xebf6('0x8'));var ejs=require(_0xebf6('0x9'));var fs=require('fs');var fs_extra=require(_0xebf6('0xa'));var _=require(_0xebf6('0xb'));var squel=require(_0xebf6('0xc'));var crypto=require(_0xebf6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xebf6('0xe'));var toCsv=require(_0xebf6('0x8'));var querystring=require(_0xebf6('0xf'));var Papa=require('papaparse');var Redis=require(_0xebf6('0x10'));var authService=require(_0xebf6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xebf6('0x12'));var hardwareService=require(_0xebf6('0x13'));var logger=require(_0xebf6('0x14'))(_0xebf6('0x15'));var utils=require(_0xebf6('0x16'));var config=require(_0xebf6('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xebf6('0x18'))['db'];function respondWithStatusCode(_0xedc361,_0x4919f1){_0x4919f1=_0x4919f1||0xcc;return function(_0x332ca0){if(_0x332ca0){return _0xedc361[_0xebf6('0x19')](_0x4919f1);}return _0xedc361[_0xebf6('0x1a')](_0x4919f1)[_0xebf6('0x1b')]();};}function respondWithResult(_0x3f69e6,_0x4dbf51){_0x4dbf51=_0x4dbf51||0xc8;return function(_0x4c01f4){if(_0x4c01f4){return _0x3f69e6['status'](_0x4dbf51)[_0xebf6('0x1c')](_0x4c01f4);}};}function respondWithFilteredResult(_0x1ae2f7,_0x50d80f){return function(_0x35570e){if(_0x35570e){var _0x2c980f=typeof _0x50d80f[_0xebf6('0x1d')]===_0xebf6('0x1e')&&typeof _0x50d80f[_0xebf6('0x1f')]===_0xebf6('0x1e');var _0x219621=_0x35570e[_0xebf6('0x20')];var _0x2d3984=_0x2c980f?0x0:_0x50d80f[_0xebf6('0x1d')];var _0x55fa31=_0x2c980f?_0x35570e['count']:_0x50d80f[_0xebf6('0x1d')]+_0x50d80f[_0xebf6('0x1f')];var _0x10051e;if(_0x55fa31>=_0x219621){_0x55fa31=_0x219621;_0x10051e=0xc8;}else{_0x10051e=0xce;}_0x1ae2f7[_0xebf6('0x1a')](_0x10051e);return _0x1ae2f7[_0xebf6('0x21')](_0xebf6('0x22'),_0x2d3984+'-'+_0x55fa31+'/'+_0x219621)[_0xebf6('0x1c')](_0x35570e);}return null;};}function patchUpdates(_0x80f523){return function(_0x4fb497){try{jsonpatch[_0xebf6('0x23')](_0x4fb497,_0x80f523,!![]);}catch(_0x81fdb3){return BPromise[_0xebf6('0x24')](_0x81fdb3);}return _0x4fb497[_0xebf6('0x25')]();};}function saveUpdates(_0x6303ac,_0x14c8ac){return function(_0x2f419e){if(_0x2f419e){return _0x2f419e[_0xebf6('0x26')](_0x6303ac)[_0xebf6('0x27')](function(_0x2e32c6){return _0x2e32c6;});}return null;};}function removeEntity(_0x232074,_0x2dd2ed){return function(_0x43c4e2){if(_0x43c4e2){return _0x43c4e2[_0xebf6('0x28')]()[_0xebf6('0x27')](function(){_0x232074[_0xebf6('0x1a')](0xcc)[_0xebf6('0x1b')]();});}};}function handleEntityNotFound(_0x1534b2,_0x3b58cb){return function(_0x4dadf7){if(!_0x4dadf7){_0x1534b2['sendStatus'](0x194);}return _0x4dadf7;};}function handleError(_0x2605a2,_0x4dc5be){_0x4dc5be=_0x4dc5be||0x1f4;return function(_0x230d84){logger[_0xebf6('0x29')](_0x230d84['stack']);if(_0x230d84['name']){delete _0x230d84[_0xebf6('0x2a')];}_0x2605a2[_0xebf6('0x1a')](_0x4dc5be)[_0xebf6('0x2b')](_0x230d84);};}exports[_0xebf6('0x2c')]=function(_0xedaaeb,_0x2dc0cf){var _0x7976d={'raw':!![],'where':{'id':_0xedaaeb['params']['id']}},_0x7551ce={};_0x7551ce[_0xebf6('0x2d')]=_[_0xebf6('0x2e')](db['ChatApplication'][_0xebf6('0x2f')]);_0x7551ce[_0xebf6('0x30')]=_['keys'](_0xedaaeb[_0xebf6('0x30')]);_0x7551ce[_0xebf6('0x31')]=_[_0xebf6('0x32')](_0x7551ce[_0xebf6('0x2d')],_0x7551ce[_0xebf6('0x30')]);_0x7976d[_0xebf6('0x33')]=_['intersection'](_0x7551ce[_0xebf6('0x2d')],qs[_0xebf6('0x34')](_0xedaaeb['query']['fields']));_0x7976d[_0xebf6('0x33')]=_0x7976d[_0xebf6('0x33')]['length']?_0x7976d[_0xebf6('0x33')]:_0x7551ce[_0xebf6('0x2d')];if(_0xedaaeb['query'][_0xebf6('0x35')]){_0x7976d[_0xebf6('0x36')]=[{'all':!![]}];}_0x7976d=_[_0xebf6('0x37')]({},_0x7976d,_0xedaaeb['options']);return db[_0xebf6('0x38')][_0xebf6('0x39')](_0x7976d)[_0xebf6('0x27')](handleEntityNotFound(_0x2dc0cf,null))[_0xebf6('0x27')](respondWithResult(_0x2dc0cf,null))['catch'](handleError(_0x2dc0cf,null));};exports['update']=function(_0x262af2,_0x46ef2d){if(_0x262af2['body']['id']){delete _0x262af2[_0xebf6('0x3a')]['id'];}return db[_0xebf6('0x38')]['find']({'where':{'id':_0x262af2[_0xebf6('0x3b')]['id']}})[_0xebf6('0x27')](handleEntityNotFound(_0x46ef2d,null))[_0xebf6('0x27')](saveUpdates(_0x262af2[_0xebf6('0x3a')],null))[_0xebf6('0x27')](respondWithResult(_0x46ef2d,null))['catch'](handleError(_0x46ef2d,null));};exports[_0xebf6('0x28')]=function(_0x48943e,_0x3a09fe){return db['ChatApplication'][_0xebf6('0x39')]({'where':{'id':_0x48943e[_0xebf6('0x3b')]['id']}})[_0xebf6('0x27')](handleEntityNotFound(_0x3a09fe,null))[_0xebf6('0x27')](removeEntity(_0x3a09fe,null))[_0xebf6('0x3c')](handleError(_0x3a09fe,null));};
\ No newline at end of file